[IntersectionObserver] Optimize occlusion checking
Calculating occlusion information for IntersectionObserver V2 is
expensive. To enable IntersectionObserver V2 running in an OOP iframe
we must determine, in the process of the parent frame, whether the
iframe element is occluded. However, we should only do that
calculation if the child frame actually needs it.
This CL adds IPC's to request a parent frame to compute occlusion
information for an OOP child frame. This way, the cost is only paid
when the feature is being used.
BUG=926539
[email protected]
Change-Id: I4b6982b004b839145c371047cc989a8d3eef0011
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1512698
Commit-Queue: Stefan Zager <[email protected]>
Reviewed-by: Nasko Oskov <[email protected]>
Reviewed-by: Chris Harrelson <[email protected]>
Cr-Commit-Position: refs/heads/master@{#639783}
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index a7dcbd2a..e5f551c 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -51,6 +51,7 @@
#include "mojo/public/cpp/bindings/binding.h"
#include "ppapi/buildflags/buildflags.h"
#include "services/network/public/mojom/referrer_policy.mojom.h"
+#include "third_party/blink/public/common/frame/occlusion_state.h"
#include "third_party/blink/public/common/manifest/web_display_mode.h"
#include "third_party/blink/public/platform/web_input_event.h"
#include "third_party/blink/public/platform/web_rect.h"
@@ -713,7 +714,7 @@
const gfx::Rect& window_screen_rect);
void OnSetViewportIntersection(const gfx::Rect& viewport_intersection,
const gfx::Rect& compositor_visible_rect,
- bool occluded_or_obscured);
+ blink::FrameOcclusionState occlusion_state);
void OnSetIsInert(bool);
void OnSetInheritedEffectiveTouchAction(cc::TouchAction touch_action);
void OnUpdateRenderThrottlingStatus(bool is_throttled,