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

Unified Diff: Source/core/dom/CustomElementUpgradeCandidateMap.cpp

Issue 23009004: Process Custom Elements in post-order. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/CustomElementUpgradeCandidateMap.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/CustomElementUpgradeCandidateMap.cpp
diff --git a/Source/core/dom/CustomElementUpgradeCandidateMap.cpp b/Source/core/dom/CustomElementUpgradeCandidateMap.cpp
index 7a66312d0f6ce9dc26bb56c30525b30dbf2b66a2..8583eb2046550b9cf3676a2e5cd3ca31b6d28a8c 100644
--- a/Source/core/dom/CustomElementUpgradeCandidateMap.cpp
+++ b/Source/core/dom/CustomElementUpgradeCandidateMap.cpp
@@ -78,6 +78,23 @@ void CustomElementUpgradeCandidateMap::removeCommon(Element* element)
m_upgradeCandidates.remove(candidate);
}
+void CustomElementUpgradeCandidateMap::elementDidFinishParsingChildren(Element* element)
+{
+ // An upgrade candidate finished parsing; reorder so that eventual
+ // upgrade order matches finished-parsing order.
+ moveToEnd(element);
+}
+
+void CustomElementUpgradeCandidateMap::moveToEnd(Element* element)
+{
+ UpgradeCandidateMap::iterator candidate = m_upgradeCandidates.find(element);
+ ASSERT(candidate != m_upgradeCandidates.end());
+
+ UnresolvedDefinitionMap::iterator elements = m_unresolvedDefinitions.find(candidate->value);
+ ASSERT(elements != m_unresolvedDefinitions.end());
+ elements->value.appendOrMoveToLast(element);
+}
+
ListHashSet<Element*> CustomElementUpgradeCandidateMap::takeUpgradeCandidatesFor(const CustomElementDescriptor& descriptor)
{
const ListHashSet<Element*>& candidates = m_unresolvedDefinitions.take(descriptor);
« no previous file with comments | « Source/core/dom/CustomElementUpgradeCandidateMap.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698