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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp

Issue 2242743002: Make custom elements work in HTML imports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve most comments Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/custom/CustomElementDefinition.h" 5 #include "core/dom/custom/CustomElementDefinition.h"
6 6
7 #include "core/dom/Attr.h" 7 #include "core/dom/Attr.h"
8 #include "core/dom/ExceptionCode.h" 8 #include "core/dom/ExceptionCode.h"
9 #include "core/dom/custom/CustomElement.h" 9 #include "core/dom/custom/CustomElement.h"
10 #include "core/dom/custom/CustomElementAdoptedCallbackReaction.h" 10 #include "core/dom/custom/CustomElementAdoptedCallbackReaction.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // 6.1.4. If result's attribute list is not empty, then throw a NotSupported Error. 48 // 6.1.4. If result's attribute list is not empty, then throw a NotSupported Error.
49 if (element->hasAttributes()) 49 if (element->hasAttributes())
50 return "The result must not have attributes"; 50 return "The result must not have attributes";
51 // 6.1.5. If result has children, then throw a NotSupportedError. 51 // 6.1.5. If result has children, then throw a NotSupportedError.
52 if (element->hasChildren()) 52 if (element->hasChildren())
53 return "The result must not have children"; 53 return "The result must not have children";
54 // 6.1.6. If result's parent is not null, then throw a NotSupportedError. 54 // 6.1.6. If result's parent is not null, then throw a NotSupportedError.
55 if (element->parentNode()) 55 if (element->parentNode())
56 return "The result must not have a parent"; 56 return "The result must not have a parent";
57 // 6.1.7. If result's node document is not document, then throw a NotSupport edError. 57 // 6.1.7. If result's node document is not document, then throw a NotSupport edError.
58 if (&element->document() != &document) 58 if (&element->document() != &document
dominicc (has gone to gerrit) 2016/08/22 08:07:36 I have two problems with this. First, you write a
kochi 2016/08/22 12:01:59 CustomElementsRegistry constructor and constructor
59 && element->document().contextDocument() != document.contextDocument()) {
59 return "The result must be in the same document"; 60 return "The result must be in the same document";
61 }
60 // 6.1.8. If result's namespace is not the HTML namespace, then throw a NotS upportedError. 62 // 6.1.8. If result's namespace is not the HTML namespace, then throw a NotS upportedError.
61 if (element->namespaceURI() != HTMLNames::xhtmlNamespaceURI) 63 if (element->namespaceURI() != HTMLNames::xhtmlNamespaceURI)
62 return "The result must have HTML namespace"; 64 return "The result must have HTML namespace";
63 // 6.1.9. If result's local name is not equal to localName, then throw a Not SupportedError. 65 // 6.1.9. If result's local name is not equal to localName, then throw a Not SupportedError.
64 if (element->localName() != tagName.localName()) 66 if (element->localName() != tagName.localName())
65 return "The result must have the same localName"; 67 return "The result must have the same localName";
66 return String(); 68 return String();
67 } 69 }
68 70
69 void CustomElementDefinition::checkConstructorResult(Element* element, 71 void CustomElementDefinition::checkConstructorResult(Element* element,
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 element->synchronizeAttribute(name); 187 element->synchronizeAttribute(name);
186 for (const auto& attribute : element->attributesWithoutUpdate()) { 188 for (const auto& attribute : element->attributesWithoutUpdate()) {
187 if (hasAttributeChangedCallback(attribute.name())) { 189 if (hasAttributeChangedCallback(attribute.name())) {
188 enqueueAttributeChangedCallback(element, attribute.name(), 190 enqueueAttributeChangedCallback(element, attribute.name(),
189 nullAtom, attribute.value()); 191 nullAtom, attribute.value());
190 } 192 }
191 } 193 }
192 } 194 }
193 195
194 } // namespace blink 196 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698