| Index: third_party/WebKit/Source/core/dom/ContainerNode.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
|
| index 380860b6f13af335379ef04f5c2677be1af494f2..5522d9af9eeac4b34968ccb81e3ef7c61ef79606 100644
|
| --- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
|
| @@ -1305,9 +1305,6 @@ void ContainerNode::recalcChildStyle(StyleRecalcChange change)
|
| ASSERT(change >= UpdatePseudoElements || childNeedsStyleRecalc());
|
| ASSERT(!needsStyleRecalc());
|
|
|
| - if (change < Force && hasRareData() && childNeedsStyleRecalc())
|
| - checkForChildrenAdjacentRuleChanges();
|
| -
|
| // This loop is deliberately backwards because we use insertBefore in the layout tree, and want to avoid
|
| // a potentially n^2 loop to find the insertion point while resolving style. Having us start from the last
|
| // child and work our way back means in the common case, we'll find the insertion point in O(1) time.
|
| @@ -1330,33 +1327,6 @@ void ContainerNode::recalcChildStyle(StyleRecalcChange change)
|
| }
|
| }
|
|
|
| -void ContainerNode::checkForChildrenAdjacentRuleChanges()
|
| -{
|
| - bool hasDirectAdjacentRules = childrenAffectedByDirectAdjacentRules();
|
| - bool hasIndirectAdjacentRules = childrenAffectedByIndirectAdjacentRules();
|
| -
|
| - if (!hasDirectAdjacentRules && !hasIndirectAdjacentRules)
|
| - return;
|
| -
|
| - unsigned forceCheckOfNextElementCount = 0;
|
| - bool forceCheckOfAnyElementSibling = false;
|
| - Document& document = this->document();
|
| -
|
| - for (Element* child = ElementTraversal::firstChild(*this); child; child = ElementTraversal::nextSibling(*child)) {
|
| - bool childRulesChanged = child->needsStyleRecalc() && child->styleChangeType() >= SubtreeStyleChange;
|
| -
|
| - if (forceCheckOfNextElementCount || forceCheckOfAnyElementSibling)
|
| - child->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::SiblingSelector));
|
| -
|
| - if (childRulesChanged && hasDirectAdjacentRules)
|
| - forceCheckOfNextElementCount = document.styleEngine().maxDirectAdjacentSelectors();
|
| - else if (forceCheckOfNextElementCount)
|
| - --forceCheckOfNextElementCount;
|
| -
|
| - forceCheckOfAnyElementSibling = forceCheckOfAnyElementSibling || (childRulesChanged && hasIndirectAdjacentRules);
|
| - }
|
| -}
|
| -
|
| void ContainerNode::checkForSiblingStyleChanges(SiblingCheckType changeType, Node* nodeBeforeChange, Node* nodeAfterChange)
|
| {
|
| if (!inActiveDocument() || document().hasPendingForcedStyleRecalc() || styleChangeType() >= SubtreeStyleChange)
|
| @@ -1422,7 +1392,8 @@ void ContainerNode::checkForSiblingStyleChanges(SiblingCheckType changeType, Nod
|
| // The + selector. We need to invalidate the first element following the change. It is the only possible element
|
| // that could be affected by this DOM change.
|
| if (childrenAffectedByDirectAdjacentRules() && nodeAfterChange) {
|
| - if (Element* elementAfterChange = nodeAfterChange->isElementNode() ? toElement(nodeAfterChange) : ElementTraversal::nextSibling(*nodeAfterChange))
|
| + Element* elementAfterChange = nodeAfterChange->isElementNode() ? toElement(nodeAfterChange) : ElementTraversal::nextSibling(*nodeAfterChange);
|
| + for (unsigned i = document().styleEngine().maxDirectAdjacentSelectors(); i && elementAfterChange; --i, elementAfterChange = ElementTraversal::nextSibling(*elementAfterChange))
|
| elementAfterChange->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::SiblingSelector));
|
| }
|
| }
|
|
|