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

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

Issue 23513013: Have Text constructor take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/CDATASection.cpp ('k') | Source/core/dom/Text.h » ('j') | 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 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 return !m_import || !m_import->isBlocked(); 791 return !m_import || !m_import->isBlocked();
792 } 792 }
793 793
794 PassRefPtr<DocumentFragment> Document::createDocumentFragment() 794 PassRefPtr<DocumentFragment> Document::createDocumentFragment()
795 { 795 {
796 return DocumentFragment::create(document()); 796 return DocumentFragment::create(document());
797 } 797 }
798 798
799 PassRefPtr<Text> Document::createTextNode(const String& data) 799 PassRefPtr<Text> Document::createTextNode(const String& data)
800 { 800 {
801 return Text::create(this, data); 801 return Text::create(*this, data);
802 } 802 }
803 803
804 PassRefPtr<Comment> Document::createComment(const String& data) 804 PassRefPtr<Comment> Document::createComment(const String& data)
805 { 805 {
806 return Comment::create(this, data); 806 return Comment::create(this, data);
807 } 807 }
808 808
809 PassRefPtr<CDATASection> Document::createCDATASection(const String& data, Except ionState& es) 809 PassRefPtr<CDATASection> Document::createCDATASection(const String& data, Except ionState& es)
810 { 810 {
811 if (isHTMLDocument()) { 811 if (isHTMLDocument()) {
812 es.throwDOMException(NotSupportedError); 812 es.throwDOMException(NotSupportedError);
813 return 0; 813 return 0;
814 } 814 }
815 if (data.find("]]>") != WTF::notFound) { 815 if (data.find("]]>") != WTF::notFound) {
816 es.throwDOMException(InvalidCharacterError, "String cannot contain ']]>' since that is the end delimiter of a CData section."); 816 es.throwDOMException(InvalidCharacterError, "String cannot contain ']]>' since that is the end delimiter of a CData section.");
817 return 0; 817 return 0;
818 } 818 }
819 return CDATASection::create(this, data); 819 return CDATASection::create(*this, data);
820 } 820 }
821 821
822 PassRefPtr<ProcessingInstruction> Document::createProcessingInstruction(const St ring& target, const String& data, ExceptionState& es) 822 PassRefPtr<ProcessingInstruction> Document::createProcessingInstruction(const St ring& target, const String& data, ExceptionState& es)
823 { 823 {
824 if (!isValidName(target)) { 824 if (!isValidName(target)) {
825 es.throwDOMException(InvalidCharacterError); 825 es.throwDOMException(InvalidCharacterError);
826 return 0; 826 return 0;
827 } 827 }
828 if (isHTMLDocument()) { 828 if (isHTMLDocument()) {
829 es.throwDOMException(NotSupportedError); 829 es.throwDOMException(NotSupportedError);
830 return 0; 830 return 0;
831 } 831 }
832 return ProcessingInstruction::create(this, target, data); 832 return ProcessingInstruction::create(this, target, data);
833 } 833 }
834 834
835 PassRefPtr<Text> Document::createEditingTextNode(const String& text) 835 PassRefPtr<Text> Document::createEditingTextNode(const String& text)
836 { 836 {
837 return Text::createEditingText(this, text); 837 return Text::createEditingText(*this, text);
838 } 838 }
839 839
840 PassRefPtr<CSSStyleDeclaration> Document::createCSSStyleDeclaration() 840 PassRefPtr<CSSStyleDeclaration> Document::createCSSStyleDeclaration()
841 { 841 {
842 return MutableStylePropertySet::create()->ensureCSSStyleDeclaration(); 842 return MutableStylePropertySet::create()->ensureCSSStyleDeclaration();
843 } 843 }
844 844
845 PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionSt ate& es) 845 PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionSt ate& es)
846 { 846 {
847 if (!importedNode) { 847 if (!importedNode) {
(...skipping 4524 matching lines...) Expand 10 before | Expand all | Expand 10 after
5372 { 5372 {
5373 return DocumentLifecycleNotifier::create(this); 5373 return DocumentLifecycleNotifier::create(this);
5374 } 5374 }
5375 5375
5376 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5376 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5377 { 5377 {
5378 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5378 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5379 } 5379 }
5380 5380
5381 } // namespace WebCore 5381 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/CDATASection.cpp ('k') | Source/core/dom/Text.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698