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

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

Issue 22880029: Make AttachBehavior a required argument. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/DOMImplementation.cpp ('k') | Source/core/dom/Node.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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 } 858 }
859 RefPtr<Element> newElement = createElement(oldElement->tagQName(), false ); 859 RefPtr<Element> newElement = createElement(oldElement->tagQName(), false );
860 860
861 newElement->cloneDataFromElement(*oldElement); 861 newElement->cloneDataFromElement(*oldElement);
862 862
863 if (deep) { 863 if (deep) {
864 for (Node* oldChild = oldElement->firstChild(); oldChild; oldChild = oldChild->nextSibling()) { 864 for (Node* oldChild = oldElement->firstChild(); oldChild; oldChild = oldChild->nextSibling()) {
865 RefPtr<Node> newChild = importNode(oldChild, true, es); 865 RefPtr<Node> newChild = importNode(oldChild, true, es);
866 if (es.hadException()) 866 if (es.hadException())
867 return 0; 867 return 0;
868 newElement->appendChild(newChild.release(), es); 868 newElement->appendChild(newChild.release(), es, DeprecatedAttach Now);
869 if (es.hadException()) 869 if (es.hadException())
870 return 0; 870 return 0;
871 } 871 }
872 } 872 }
873 873
874 return newElement.release(); 874 return newElement.release();
875 } 875 }
876 case ATTRIBUTE_NODE: 876 case ATTRIBUTE_NODE:
877 return Attr::create(this, QualifiedName(nullAtom, toAttr(importedNode)-> name(), nullAtom), toAttr(importedNode)->value()); 877 return Attr::create(this, QualifiedName(nullAtom, toAttr(importedNode)-> name(), nullAtom), toAttr(importedNode)->value());
878 case DOCUMENT_FRAGMENT_NODE: { 878 case DOCUMENT_FRAGMENT_NODE: {
879 if (importedNode->isShadowRoot()) { 879 if (importedNode->isShadowRoot()) {
880 // ShadowRoot nodes should not be explicitly importable. 880 // ShadowRoot nodes should not be explicitly importable.
881 // Either they are imported along with their host node, or created i mplicitly. 881 // Either they are imported along with their host node, or created i mplicitly.
882 break; 882 break;
883 } 883 }
884 DocumentFragment* oldFragment = static_cast<DocumentFragment*>(importedN ode); 884 DocumentFragment* oldFragment = static_cast<DocumentFragment*>(importedN ode);
885 RefPtr<DocumentFragment> newFragment = createDocumentFragment(); 885 RefPtr<DocumentFragment> newFragment = createDocumentFragment();
886 if (deep) { 886 if (deep) {
887 for (Node* oldChild = oldFragment->firstChild(); oldChild; oldChild = oldChild->nextSibling()) { 887 for (Node* oldChild = oldFragment->firstChild(); oldChild; oldChild = oldChild->nextSibling()) {
888 RefPtr<Node> newChild = importNode(oldChild, true, es); 888 RefPtr<Node> newChild = importNode(oldChild, true, es);
889 if (es.hadException()) 889 if (es.hadException())
890 return 0; 890 return 0;
891 newFragment->appendChild(newChild.release(), es); 891 newFragment->appendChild(newChild.release(), es, DeprecatedAttac hNow);
892 if (es.hadException()) 892 if (es.hadException())
893 return 0; 893 return 0;
894 } 894 }
895 } 895 }
896 896
897 return newFragment.release(); 897 return newFragment.release();
898 } 898 }
899 case ENTITY_NODE: 899 case ENTITY_NODE:
900 case NOTATION_NODE: 900 case NOTATION_NODE:
901 // FIXME: It should be possible to import these node types, however in D OM3 the DocumentType is readonly, so there isn't much sense in doing that. 901 // FIXME: It should be possible to import these node types, however in D OM3 the DocumentType is readonly, so there isn't much sense in doing that.
(...skipping 4318 matching lines...) Expand 10 before | Expand all | Expand 10 after
5220 { 5220 {
5221 return DocumentLifecycleNotifier::create(this); 5221 return DocumentLifecycleNotifier::create(this);
5222 } 5222 }
5223 5223
5224 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5224 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5225 { 5225 {
5226 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5226 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5227 } 5227 }
5228 5228
5229 } // namespace WebCore 5229 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/DOMImplementation.cpp ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698