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

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

Issue 2252003002: Change custom element state in documents without browsing context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dominicc review Created 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/custom-elements/spec/selectors/pseudo-class-defined.html ('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 // 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/CustomElement.h" 5 #include "core/dom/custom/CustomElement.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/QualifiedName.h" 8 #include "core/dom/QualifiedName.h"
9 #include "core/dom/custom/CEReactionsScope.h" 9 #include "core/dom/custom/CEReactionsScope.h"
10 #include "core/dom/custom/CustomElementDefinition.h" 10 #include "core/dom/custom/CustomElementDefinition.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 "font-face-format", 74 "font-face-format",
75 "font-face-name", 75 "font-face-name",
76 "missing-glyph", 76 "missing-glyph",
77 })); 77 }));
78 return !hyphenContainingElementNames.contains(name); 78 return !hyphenContainingElementNames.contains(name);
79 } 79 }
80 80
81 bool CustomElement::shouldCreateCustomElement(Document& document, const AtomicSt ring& localName) 81 bool CustomElement::shouldCreateCustomElement(Document& document, const AtomicSt ring& localName)
82 { 82 {
83 return RuntimeEnabledFeatures::customElementsV1Enabled() 83 return RuntimeEnabledFeatures::customElementsV1Enabled()
84 && document.frame() && isValidName(localName); 84 && isValidName(localName);
85 } 85 }
86 86
87 bool CustomElement::shouldCreateCustomElement(Document& document, const Qualifie dName& tagName) 87 bool CustomElement::shouldCreateCustomElement(Document& document, const Qualifie dName& tagName)
88 { 88 {
89 return shouldCreateCustomElement(document, tagName.localName()) 89 return shouldCreateCustomElement(document, tagName.localName())
90 && tagName.namespaceURI() == HTMLNames::xhtmlNamespaceURI; 90 && tagName.namespaceURI() == HTMLNames::xhtmlNamespaceURI;
91 } 91 }
92 92
93 static CustomElementDefinition* definitionForName(const Document& document, cons t QualifiedName& name) 93 static CustomElementDefinition* definitionForName(const Document& document, cons t QualifiedName& name)
94 { 94 {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 CustomElementsRegistry* registry = CustomElement::registry(*element); 240 CustomElementsRegistry* registry = CustomElement::registry(*element);
241 if (!registry) 241 if (!registry)
242 return; 242 return;
243 if (CustomElementDefinition* definition = registry->definitionForName(elemen t->localName())) 243 if (CustomElementDefinition* definition = registry->definitionForName(elemen t->localName()))
244 definition->enqueueUpgradeReaction(element); 244 definition->enqueueUpgradeReaction(element);
245 else 245 else
246 registry->addCandidate(element); 246 registry->addCandidate(element);
247 } 247 }
248 248
249 } // namespace blink 249 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/custom-elements/spec/selectors/pseudo-class-defined.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698