Commit 3644f5ab authored by Vladimir Levin's avatar Vladimir Levin Committed by Commit Bot

ContentVisibility: Remove unneeded frame-schedules on lock/unlock.

This patch removes ScheduleAnimation calls from lock/unlock. These
are not required because we invalidate paint anyway so the lifecycle
will already happen. Either that or we are already in the lifecycle
when we determine that we need to lock.

R=chrishtr@chromium.org, szager@chromium.org

Change-Id: I1284b435882e2365f75b1b8baaf79fab8713ba99
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2375069Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Reviewed-by: default avatarStefan Zager <szager@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801466}
parent 42abce79
...@@ -307,10 +307,6 @@ void DisplayLockContext::Lock() { ...@@ -307,10 +307,6 @@ void DisplayLockContext::Lock() {
element_->NotifyPriorityScrollAnchorStatusChanged(); element_->NotifyPriorityScrollAnchorStatusChanged();
} }
// In either case, we schedule an animation. If we're already inside a
// lifecycle update, this will be a no-op.
ScheduleAnimation();
// We need to notify the AX cache (if it exists) to update |element_|'s // We need to notify the AX cache (if it exists) to update |element_|'s
// children in the AX cache. // children in the AX cache.
if (AXObjectCache* cache = element_->GetDocument().ExistingAXObjectCache()) if (AXObjectCache* cache = element_->GetDocument().ExistingAXObjectCache())
...@@ -534,17 +530,12 @@ void DisplayLockContext::Unlock() { ...@@ -534,17 +530,12 @@ void DisplayLockContext::Unlock() {
if (!ConnectedToView()) if (!ConnectedToView())
return; return;
ScheduleAnimation();
// There are a few ways we can get unlocked: // There are a few ways we can get unlocked:
// 1. A new content-visibility property needs us to be ulocked. // 1. A new content-visibility property needs us to be ulocked.
// 2. We're in 'auto' mode and we are intersecting the viewport. // 2. We're in 'auto' mode and we are intersecting the viewport.
// 3. We're activating in hidden-matchable or auto mode
// In the first case, we are already in style processing, so we don't need to // In the first case, we are already in style processing, so we don't need to
// invalidate style. However, in the second and third cases we invalidate // invalidate style. However, in the second case we invalidate style so that
// style so that `AdjustElementStyle()` can be called. // `AdjustElementStyle()` can be called.
// TODO(vmpstr): Case 3 needs to be reworked, since the spec no longer has a
// notion of activation.
if (!document_->InStyleRecalc()) { if (!document_->InStyleRecalc()) {
// Since size containment depends on the activatability state, we should // Since size containment depends on the activatability state, we should
// invalidate the style for this element, so that the style adjuster can // invalidate the style for this element, so that the style adjuster can
......
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