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

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

Issue 727283002: Custom Elements in template should not be upgraded (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Using ensureTemplateDocument() Created 6 years, 1 month 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/HTMLTemplateElement/import-template-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 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 return nullptr; 986 return nullptr;
987 } 987 }
988 RefPtrWillBeRawPtr<Element> newElement = createElement(oldElement->tagQN ame(), false); 988 RefPtrWillBeRawPtr<Element> newElement = createElement(oldElement->tagQN ame(), false);
989 989
990 newElement->cloneDataFromElement(*oldElement); 990 newElement->cloneDataFromElement(*oldElement);
991 991
992 if (deep) { 992 if (deep) {
993 if (!importContainerNodeChildren(oldElement, newElement, exceptionSt ate)) 993 if (!importContainerNodeChildren(oldElement, newElement, exceptionSt ate))
994 return nullptr; 994 return nullptr;
995 if (isHTMLTemplateElement(*oldElement) 995 if (isHTMLTemplateElement(*oldElement)
996 && !importContainerNodeChildren(toHTMLTemplateElement(oldElement )->content(), toHTMLTemplateElement(newElement)->content(), exceptionState)) 996 && !ensureTemplateDocument().importContainerNodeChildren(
997 toHTMLTemplateElement(oldElement)->content(),
998 toHTMLTemplateElement(newElement)->content(), exceptionState ))
997 return nullptr; 999 return nullptr;
998 } 1000 }
999 1001
1000 return newElement.release(); 1002 return newElement.release();
1001 } 1003 }
1002 case ATTRIBUTE_NODE: 1004 case ATTRIBUTE_NODE:
1003 return Attr::create(*this, QualifiedName(nullAtom, AtomicString(toAttr(i mportedNode)->name()), nullAtom), toAttr(importedNode)->value()); 1005 return Attr::create(*this, QualifiedName(nullAtom, AtomicString(toAttr(i mportedNode)->name()), nullAtom), toAttr(importedNode)->value());
1004 case DOCUMENT_FRAGMENT_NODE: { 1006 case DOCUMENT_FRAGMENT_NODE: {
1005 if (importedNode->isShadowRoot()) { 1007 if (importedNode->isShadowRoot()) {
1006 // ShadowRoot nodes should not be explicitly importable. 1008 // ShadowRoot nodes should not be explicitly importable.
(...skipping 4823 matching lines...) Expand 10 before | Expand all | Expand 10 after
5830 #ifndef NDEBUG 5832 #ifndef NDEBUG
5831 using namespace blink; 5833 using namespace blink;
5832 void showLiveDocumentInstances() 5834 void showLiveDocumentInstances()
5833 { 5835 {
5834 WeakDocumentSet& set = liveDocumentSet(); 5836 WeakDocumentSet& set = liveDocumentSet();
5835 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5837 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5836 for (Document* document : set) 5838 for (Document* document : set)
5837 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5839 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5838 } 5840 }
5839 #endif 5841 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/HTMLTemplateElement/import-template-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698