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

Unified Diff: third_party/WebKit/Source/core/dom/custom/CustomElementUpgradeReaction.cpp

Issue 2067853002: Upgrade custom elements when inserting a node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dominicc nits Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/custom/CustomElementUpgradeReaction.cpp
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementUpgradeReaction.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElementUpgradeReaction.cpp
index 8da5f43b04b0a562c632977f40902cca1a9dd23c..8296c3ab40c53843c270451d94618dba8c536f55 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementUpgradeReaction.cpp
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementUpgradeReaction.cpp
@@ -16,7 +16,11 @@ CustomElementUpgradeReaction::CustomElementUpgradeReaction(
void CustomElementUpgradeReaction::invoke(Element* element)
{
- m_definition->upgrade(element);
+ // Don't call upgrade() if it's already upgraded. Multiple upgrade reactions
+ // could be enqueued because the state changes in step 10 of upgrades.
+ // https://html.spec.whatwg.org/multipage/scripting.html#upgrades
+ if (element->getCustomElementState() == CustomElementState::Undefined)
+ m_definition->upgrade(element);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698