Index: Source/core/css/TreeBoundaryCrossingRules.cpp |
diff --git a/Source/core/css/TreeBoundaryCrossingRules.cpp b/Source/core/css/TreeBoundaryCrossingRules.cpp |
index e45aa3f8d1546a1beb9e5b3603d14e9dbfd2c914..503eb839a9988fed48b940fa82369c9ba1b8dc06 100644 |
--- a/Source/core/css/TreeBoundaryCrossingRules.cpp |
+++ b/Source/core/css/TreeBoundaryCrossingRules.cpp |
@@ -32,7 +32,6 @@ |
#include "core/css/ElementRuleCollector.h" |
#include "core/css/RuleFeature.h" |
#include "core/dom/StyleEngine.h" |
-#include "core/dom/shadow/InsertionPoint.h" |
#include "core/dom/shadow/ShadowRoot.h" |
namespace WebCore { |
@@ -74,8 +73,6 @@ void TreeBoundaryCrossingRules::collectTreeBoundaryCrossingRules(Element* elemen |
// When comparing rules declared in inner treescopes, inner's rules win. |
CascadeOrder innerCascadeOrder = size(); |
- // FIXME: This is n^2 across the number of scoping nodes in the entire document! We need to walk the |
- // ancestors of |element| instead. |
for (DocumentOrderedList::iterator it = m_scopingNodes.begin(); it != m_scopingNodes.end(); ++it) { |
const ContainerNode* scopingNode = toContainerNode(*it); |
CSSStyleSheetRuleSubSet* ruleSubSet = m_treeBoundaryCrossingRuleSetMap.get(scopingNode); |
@@ -89,24 +86,12 @@ void TreeBoundaryCrossingRules::collectTreeBoundaryCrossingRules(Element* elemen |
scopingNode = toShadowRoot(scopingNode)->host(); |
} |
- // FIXME: This is a terrible hack to avoid doing most of the work in this n^2 loop. |
- // Instead we should just fix the loop to collect the proper scopes up the tree instead |
- // of iterating all possible scopes. |
- const InsertionPoint* insertionPoint = resolveReprojection(element); |
- if ((insertionPoint && !scopingNode->containsIncludingShadowDOM(insertionPoint)) |
- || (!insertionPoint && !scopingNode->containsIncludingShadowDOM(element))) { |
- ++innerCascadeOrder; |
- --outerCascadeOrder; |
- continue; |
- } |
- |
CascadeOrder cascadeOrder = isInnerTreeScope ? innerCascadeOrder : outerCascadeOrder; |
for (CSSStyleSheetRuleSubSet::iterator it = ruleSubSet->begin(); it != ruleSubSet->end(); ++it) { |
CSSStyleSheet* parentStyleSheet = it->first; |
RuleSet* ruleSet = it->second.get(); |
collector.collectMatchingRules(MatchRequest(ruleSet, includeEmptyRules, scopingNode, parentStyleSheet), ruleRange, static_cast<SelectorChecker::BehaviorAtBoundary>(boundaryBehavior), ignoreCascadeScope, cascadeOrder); |
} |
- |
++innerCascadeOrder; |
--outerCascadeOrder; |
} |