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

Unified Diff: sky/engine/core/dom/StyleEngine.cpp

Issue 807933003: Don't sort tree scopes in StyleEngine. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « sky/engine/core/dom/StyleEngine.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/StyleEngine.cpp
diff --git a/sky/engine/core/dom/StyleEngine.cpp b/sky/engine/core/dom/StyleEngine.cpp
index 79af43eb20e1600881ca0eaa8b66ba3f2b7dd8ac..b0fc8b8fbca05b989d252b47642cd1537541a4f0 100644
--- a/sky/engine/core/dom/StyleEngine.cpp
+++ b/sky/engine/core/dom/StyleEngine.cpp
@@ -85,33 +85,6 @@ const Vector<RefPtr<CSSStyleSheet>>& StyleEngine::activeAuthorStyleSheetsFor(Tre
return ensureStyleSheetCollectionFor(treeScope)->activeAuthorStyleSheets();
}
-void StyleEngine::insertTreeScopeInDocumentOrder(TreeScopeSet& treeScopes, TreeScope* treeScope)
-{
- if (treeScopes.isEmpty()) {
- treeScopes.add(treeScope);
- return;
- }
- if (treeScopes.contains(treeScope))
- return;
-
- TreeScopeSet::iterator begin = treeScopes.begin();
- TreeScopeSet::iterator end = treeScopes.end();
- TreeScopeSet::iterator it = end;
- TreeScope* followingTreeScope = 0;
- do {
- --it;
- TreeScope* n = *it;
- unsigned short position = n->comparePosition(*treeScope);
- if (position & Node::DOCUMENT_POSITION_FOLLOWING) {
- treeScopes.insertBefore(followingTreeScope, treeScope);
- return;
- }
- followingTreeScope = n;
- } while (it != begin);
-
- treeScopes.insertBefore(followingTreeScope, treeScope);
-}
-
StyleSheetCollection* StyleEngine::ensureStyleSheetCollectionFor(TreeScope& treeScope)
{
if (treeScope == m_document)
@@ -162,7 +135,7 @@ void StyleEngine::addStyleSheetCandidateNode(Node* node, bool createdByParser)
markTreeScopeDirty(treeScope);
if (treeScope != m_document)
- insertTreeScopeInDocumentOrder(m_activeTreeScopes, &treeScope);
+ m_activeTreeScopes.add(&treeScope);
}
void StyleEngine::removeStyleSheetCandidateNode(Node* node, ContainerNode* scopingNode, TreeScope& treeScope)
« no previous file with comments | « sky/engine/core/dom/StyleEngine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698