Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: Source/core/dom/Document.cpp

Issue 22911020: Block "]]>" in createCDataSection (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added trailing whitespace to "expected". Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/dom/Document/createCDATASection-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 { 799 {
800 return Comment::create(this, data); 800 return Comment::create(this, data);
801 } 801 }
802 802
803 PassRefPtr<CDATASection> Document::createCDATASection(const String& data, Except ionState& es) 803 PassRefPtr<CDATASection> Document::createCDATASection(const String& data, Except ionState& es)
804 { 804 {
805 if (isHTMLDocument()) { 805 if (isHTMLDocument()) {
806 es.throwDOMException(NotSupportedError); 806 es.throwDOMException(NotSupportedError);
807 return 0; 807 return 0;
808 } 808 }
809 if (data.find("]]>") != WTF::notFound) {
810 es.throwDOMException(InvalidCharacterError, "String cannot contain ']]>' since that is the end delimiter of a CData section.");
811 return 0;
812 }
809 return CDATASection::create(this, data); 813 return CDATASection::create(this, data);
810 } 814 }
811 815
812 PassRefPtr<ProcessingInstruction> Document::createProcessingInstruction(const St ring& target, const String& data, ExceptionState& es) 816 PassRefPtr<ProcessingInstruction> Document::createProcessingInstruction(const St ring& target, const String& data, ExceptionState& es)
813 { 817 {
814 if (!isValidName(target)) { 818 if (!isValidName(target)) {
815 es.throwDOMException(InvalidCharacterError); 819 es.throwDOMException(InvalidCharacterError);
816 return 0; 820 return 0;
817 } 821 }
818 if (isHTMLDocument()) { 822 if (isHTMLDocument()) {
(...skipping 4423 matching lines...) Expand 10 before | Expand all | Expand 10 after
5242 { 5246 {
5243 return DocumentLifecycleNotifier::create(this); 5247 return DocumentLifecycleNotifier::create(this);
5244 } 5248 }
5245 5249
5246 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5250 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5247 { 5251 {
5248 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5252 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5249 } 5253 }
5250 5254
5251 } // namespace WebCore 5255 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/Document/createCDATASection-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698