| Index: third_party/WebKit/Source/core/dom/custom/CustomElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElement.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElement.cpp
|
| index f2d27d95ca9fc53d8e08912523b735382b2afc97..9a25fae89425cffb20de18482d8f72cd61635d28 100644
|
| --- a/third_party/WebKit/Source/core/dom/custom/CustomElement.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/custom/CustomElement.cpp
|
| @@ -186,4 +186,20 @@ void CustomElement::enqueueAttributeChangedCallback(Element* element,
|
| definition->enqueueAttributeChangedCallback(element, name, oldValue, newValue);
|
| }
|
|
|
| +void CustomElement::tryToUpgrade(Element* element)
|
| +{
|
| + // Try to upgrade an element
|
| + // https://html.spec.whatwg.org/multipage/scripting.html#concept-try-upgrade
|
| +
|
| + DCHECK_EQ(element->getCustomElementState(), CustomElementState::Undefined);
|
| +
|
| + CustomElementsRegistry* registry = CustomElement::registry(*element);
|
| + if (!registry)
|
| + return;
|
| + if (CustomElementDefinition* definition = registry->definitionForName(element->localName()))
|
| + definition->enqueueUpgradeReaction(element);
|
| + else
|
| + registry->addCandidate(element);
|
| +}
|
| +
|
| } // namespace blink
|
|
|