| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |