| 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/HTMLElementFactory.h" | 7 #include "core/HTMLElementFactory.h" |
| 8 #include "core/HTMLElementTypeHelpers.h" | 8 #include "core/HTMLElementTypeHelpers.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/dom/QualifiedName.h" | 10 #include "core/dom/QualifiedName.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 HTMLElement* element; | 163 HTMLElement* element; |
| 164 if (V0CustomElement::isValidName(tagName.localName()) && | 164 if (V0CustomElement::isValidName(tagName.localName()) && |
| 165 document.registrationContext()) { | 165 document.registrationContext()) { |
| 166 Element* v0element = document.registrationContext()->createCustomTagElement( | 166 Element* v0element = document.registrationContext()->createCustomTagElement( |
| 167 document, tagName); | 167 document, tagName); |
| 168 SECURITY_DCHECK(v0element->isHTMLElement()); | 168 SECURITY_DCHECK(v0element->isHTMLElement()); |
| 169 element = toHTMLElement(v0element); | 169 element = toHTMLElement(v0element); |
| 170 } else if (shouldCreateBuiltin) { | 170 } else if (shouldCreateBuiltin) { |
| 171 element = HTMLElementFactory::createHTMLElement( | 171 element = HTMLElementFactory::createHTMLElement( |
| 172 tagName.localName(), document, nullptr, CreatedByCreateElement); | 172 tagName.localName(), document, CreatedByCreateElement); |
| 173 } else { | 173 } else { |
| 174 element = HTMLElement::create(tagName, document); | 174 element = HTMLElement::create(tagName, document); |
| 175 } | 175 } |
| 176 | 176 |
| 177 element->setCustomElementState(CustomElementState::Undefined); | 177 element->setCustomElementState(CustomElementState::Undefined); |
| 178 | 178 |
| 179 return element; | 179 return element; |
| 180 } | 180 } |
| 181 | 181 |
| 182 HTMLElement* CustomElement::createFailedElement(Document& document, | 182 HTMLElement* CustomElement::createFailedElement(Document& document, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 if (!registry) | 258 if (!registry) |
| 259 return; | 259 return; |
| 260 if (CustomElementDefinition* definition = registry->definitionFor( | 260 if (CustomElementDefinition* definition = registry->definitionFor( |
| 261 CustomElementDescriptor(element->localName(), element->localName()))) | 261 CustomElementDescriptor(element->localName(), element->localName()))) |
| 262 definition->enqueueUpgradeReaction(element); | 262 definition->enqueueUpgradeReaction(element); |
| 263 else | 263 else |
| 264 registry->addCandidate(element); | 264 registry->addCandidate(element); |
| 265 } | 265 } |
| 266 | 266 |
| 267 } // namespace blink | 267 } // namespace blink |
| OLD | NEW |