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

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: Now with tests 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
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 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 { 798 {
799 return Comment::create(this, data); 799 return Comment::create(this, data);
800 } 800 }
801 801
802 PassRefPtr<CDATASection> Document::createCDATASection(const String& data, Except ionState& es) 802 PassRefPtr<CDATASection> Document::createCDATASection(const String& data, Except ionState& es)
803 { 803 {
804 if (isHTMLDocument()) { 804 if (isHTMLDocument()) {
805 es.throwDOMException(NotSupportedError); 805 es.throwDOMException(NotSupportedError);
806 return 0; 806 return 0;
807 } 807 }
808 if (data.find("]]>") != WTF::notFound) {
809 es.throwDOMException(InvalidCharacterError, "String cannot contain ']]>' since that is the end delimiter of a CData section.");
810 return 0;
811 }
808 return CDATASection::create(this, data); 812 return CDATASection::create(this, data);
809 } 813 }
810 814
811 PassRefPtr<ProcessingInstruction> Document::createProcessingInstruction(const St ring& target, const String& data, ExceptionState& es) 815 PassRefPtr<ProcessingInstruction> Document::createProcessingInstruction(const St ring& target, const String& data, ExceptionState& es)
812 { 816 {
813 if (!isValidName(target)) { 817 if (!isValidName(target)) {
814 es.throwDOMException(InvalidCharacterError); 818 es.throwDOMException(InvalidCharacterError);
815 return 0; 819 return 0;
816 } 820 }
817 if (isHTMLDocument()) { 821 if (isHTMLDocument()) {
(...skipping 4373 matching lines...) Expand 10 before | Expand all | Expand 10 after
5191 { 5195 {
5192 return DocumentLifecycleNotifier::create(this); 5196 return DocumentLifecycleNotifier::create(this);
5193 } 5197 }
5194 5198
5195 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5199 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5196 { 5200 {
5197 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5201 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5198 } 5202 }
5199 5203
5200 } // namespace WebCore 5204 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698