Commit 91a8470f authored by wkorman's avatar wkorman Committed by Commit bot

Revert of Remove clearing of pending invalidation sets. (patchset #2 id:20001...

Revert of Remove clearing of pending invalidation sets. (patchset #2 id:20001 of https://codereview.chromium.org/1507653002/ )

Reason for revert:
Suspect root cause of crash in blink::StyleInvalidator::pushInvalidationSetsForElement

http://crbug.com/568502

Original issue's description:
> Remove clearing of pending invalidation sets.
>
> In preparation for making SubtreeStyleChange not affect the sibling
> forest.
>
> We can skip scheduling descendant invalidation sets for elements whose
> styleChangeType is SubtreeStyleChange. However, with sibling invalidation
> sets, we still need to schedule invalidations for invalidating the
> sibling forest when we change SubtreeStyleChange to be a strict subtree
> recalc.
>
> We may not clear pending invalidations on detach either, unless the node
> was actually removed from the dom tree, since there might be pending
> sibling invalidations.
>
> R=dstockwell@chromium.org,ericwilligers@chromium.org
> BUG=557440
>
> Committed: https://crrev.com/c0735df3d8f8efa24af168a6e8d5c02a7be0641c
> Cr-Commit-Position: refs/heads/master@{#364064}

TBR=dstockwell@chromium.org,ericwilligers@chromium.org,rune@opera.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=557440

Review URL: https://codereview.chromium.org/1518793002

Cr-Commit-Position: refs/heads/master@{#364416}
parent 461aa3ad
......@@ -43,22 +43,23 @@ void StyleInvalidator::invalidate(Document& document)
void StyleInvalidator::scheduleInvalidationSetsForElement(const InvalidationLists& invalidationLists, Element& element)
{
ASSERT(element.inActiveDocument());
if (element.styleChangeType() >= SubtreeStyleChange)
return;
bool requiresDescendantInvalidation = false;
if (element.styleChangeType() < SubtreeStyleChange) {
for (auto& invalidationSet : invalidationLists.descendants) {
if (invalidationSet->wholeSubtreeInvalid()) {
element.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleInvalidator));
requiresDescendantInvalidation = false;
break;
}
for (auto& invalidationSet : invalidationLists.descendants) {
if (invalidationSet->wholeSubtreeInvalid()) {
element.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleInvalidator));
clearInvalidation(element);
return;
}
if (invalidationSet->invalidatesSelf())
element.setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleInvalidator));
if (invalidationSet->invalidatesSelf())
element.setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleInvalidator));
if (!invalidationSet->isEmpty())
requiresDescendantInvalidation = true;
}
if (!invalidationSet->isEmpty())
requiresDescendantInvalidation = true;
}
if (invalidationLists.siblings.isEmpty() && !requiresDescendantInvalidation)
......
......@@ -1548,8 +1548,6 @@ void Element::removedFrom(ContainerNode* insertionPoint, Node* next)
if (ElementAnimations* elementAnimations = data->elementAnimations())
elementAnimations->cssAnimations().cancel();
}
document().styleEngine().styleInvalidator().clearInvalidation(*this);
}
void Element::attach(const AttachContext& context)
......@@ -1636,6 +1634,8 @@ void Element::detach(const AttachContext& context)
document().userActionElements().didDetach(*this);
}
document().styleEngine().styleInvalidator().clearInvalidation(*this);
if (svgFilterNeedsLayerUpdate())
document().unscheduleSVGFilterLayerUpdateHack(*this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment