Commit 871cc78c authored by Vladimir Levin's avatar Vladimir Levin Committed by Commit Bot

[DL]: Check whether we have locked display locks before checking ancestors.

This patch fixes one spot that navigates up the ancestor chain to first
check whether the document has any locked display locks.

R=chrishtr@chromium.org

Bug: 882663
Change-Id: I461d01e339ecd82ff14e3732dfa1cec79c054c9c
Reviewed-on: https://chromium-review.googlesource.com/c/1473812Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632345}
parent 8948833f
......@@ -1120,12 +1120,11 @@ void Node::MarkAncestorsWithChildNeedsStyleRecalc() {
return;
// If we're in a locked subtree, then we should not update the style recalc
// roots. These would be updated when we commit the lock.
// TODO(vmpstr): There's currently no easy way to determine whether we're in a
// locked subtree other than navigating up the ancestor chain. We can probably
// do better and only do this walk if there is in fact a lock somewhere in the
// document.
if (RuntimeEnabledFeatures::DisplayLockingEnabled()) {
// roots. These would be updated when we commit the lock. If we have locked
// display locks somewhere in the document, we iterate up the ancestor chain
// to check if we're in one such subtree.
if (RuntimeEnabledFeatures::DisplayLockingEnabled() &&
GetDocument().LockedDisplayLockCount() > 0) {
for (auto* ancestor_copy = ancestor; ancestor_copy;
ancestor_copy = ancestor_copy->ParentOrShadowHostNode()) {
if (ancestor_copy->IsElementNode() &&
......
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