Commit f9b806e5 authored by Vladimir Levin's avatar Vladimir Levin Committed by Chromium LUCI CQ

IO: Don't process post-layout delivery observers in post lifecycle.

This patch extends the previous early out to ensure that we skip
doing work for post-layout observers in post-lifecycle. Previously
the early out only skipped non-post-layout observers in post-layout.

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

Bug: 1165803
Change-Id: I639354ef603fc1aa25598816f6ef2bb8852f1fe3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2625128Reviewed-by: default avatarStefan Zager <szager@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842664}
parent e0276e11
......@@ -105,13 +105,15 @@ bool IntersectionObservation::ShouldCompute(unsigned flags) {
return false;
// If we're processing post-layout deliveries only and we don't have a
// post-layout delivery observer, then return early.
if (flags & kPostLayoutDeliveryOnly) {
if (Observer()->GetDeliveryBehavior() !=
IntersectionObserver::kDeliverDuringPostLayoutSteps) {
return false;
}
}
// post-layout delivery observer, then return early. Likewise, return if we
// need to compute non-post-layout-delivery observations but the observer
// behavior is post-layout.
bool post_layout_delivery_only = flags & kPostLayoutDeliveryOnly;
bool is_post_layout_delivery_observer =
Observer()->GetDeliveryBehavior() ==
IntersectionObserver::kDeliverDuringPostLayoutSteps;
if (post_layout_delivery_only != is_post_layout_delivery_observer)
return false;
if (flags &
(observer_->RootIsImplicit() ? kImplicitRootObserversNeedUpdate
......
......@@ -445,11 +445,16 @@ bool IntersectionObserver::ComputeIntersections(unsigned flags) {
return false;
// If we're processing post-layout deliveries only and we're not a post-layout
// delivery observer, then return early.
if (flags & IntersectionObservation::kPostLayoutDeliveryOnly) {
if (GetDeliveryBehavior() != kDeliverDuringPostLayoutSteps)
return false;
}
// delivery observer, then return early. Likewise, return if we need to
// compute non-post-layout-delivery observations but the observer behavior is
// post-layout.
bool post_layout_delivery_only =
flags & IntersectionObservation::kPostLayoutDeliveryOnly;
bool is_post_layout_delivery_observer =
GetDeliveryBehavior() ==
IntersectionObserver::kDeliverDuringPostLayoutSteps;
if (post_layout_delivery_only != is_post_layout_delivery_observer)
return false;
IntersectionGeometry::RootGeometry root_geometry(
IntersectionGeometry::GetRootLayoutObjectForTarget(root(), nullptr,
......
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