Commit 9f9d9096 authored by Philip Rogers's avatar Philip Rogers Committed by Commit Bot

Remove touch action rect special-case from RenderThrottlingStatusChanged

The render throttling code is very complex and is poorly understood (see
recent bugs: https://crbug.com/963782, https://crbug.com/962382,
and https://crbug.com/942022). This patch simplifies this code by
removing a special-case for invalidating touch action rects in
RenderThrottlingStatusChanged which was different from the other
invalidations in the function. Touch action rects are now calculated in
the paint lifecycle step and do not need special invalidation logic.

This special touch action rect invalidation was added in
https://crrev.com/388479, which pre-dated PaintTouchActionRects:
https://docs.google.com/document/d/1ksiqEPkDeDuI_l5HvWlq1MfzFyDxSnsNB8YXIaXa3sE/view

Change-Id: Ie5172918dc4de7935372ebc91b9f71f7a37be824
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617630
Commit-Queue: Philip Rogers <pdr@chromium.org>
Auto-Submit: Philip Rogers <pdr@chromium.org>
Reviewed-by: default avatarStefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660905}
parent a535fd6c
......@@ -53,7 +53,6 @@
#include "third_party/blink/renderer/core/events/error_event.h"
#include "third_party/blink/renderer/core/exported/web_plugin_container_impl.h"
#include "third_party/blink/renderer/core/frame/browser_controls.h"
#include "third_party/blink/renderer/core/frame/event_handler_registry.h"
#include "third_party/blink/renderer/core/frame/find_in_page.h"
#include "third_party/blink/renderer/core/frame/frame_overlay.h"
#include "third_party/blink/renderer/core/frame/frame_view_auto_size_info.h"
......@@ -4021,11 +4020,10 @@ void LocalFrameView::RenderThrottlingStatusChanged() {
if (RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled())
GraphicsLayersDidChange();
ScrollingCoordinator* scrolling_coordinator = this->GetScrollingCoordinator();
if (!CanThrottleRendering()) {
// ScrollingCoordinator needs to update according to the new throttling
// status.
if (scrolling_coordinator)
if (auto* scrolling_coordinator = GetScrollingCoordinator())
scrolling_coordinator->NotifyGeometryChanged(this);
// Start ticking animation frames again if necessary.
if (GetPage())
......@@ -4043,20 +4041,6 @@ void LocalFrameView::RenderThrottlingStatusChanged() {
}
}
if (scrolling_coordinator) {
EventHandlerRegistry& registry = frame_->GetEventHandlerRegistry();
bool has_handlers =
(registry.HasEventHandlers(EventHandlerRegistry::kTouchAction) ||
registry.HasEventHandlers(
EventHandlerRegistry::kTouchStartOrMoveEventBlocking) ||
registry.HasEventHandlers(
EventHandlerRegistry::kTouchStartOrMoveEventBlockingLowLatency));
if (has_handlers) {
scrolling_coordinator->TouchEventTargetRectsDidChange(
&GetFrame().LocalFrameRoot());
}
}
if (FrameScheduler* frame_scheduler = frame_->GetFrameScheduler()) {
frame_scheduler->SetFrameVisible(!IsHiddenForThrottling());
frame_scheduler->SetCrossOrigin(frame_->IsCrossOriginSubframe());
......
......@@ -804,7 +804,6 @@ TEST_P(FrameThrottlingTest, ThrottledTopLevelEventHandlerIgnored) {
DocumentLifecycle::AllowThrottlingScope throttling_scope(
GetDocument().Lifecycle());
CompositeFrame(); // Throttle the frame.
CompositeFrame(); // Update touch handler regions.
// In here, throttle iframe doesn't throttle the main frame.
EXPECT_TRUE(
......@@ -825,7 +824,6 @@ TEST_P(FrameThrottlingTest, ThrottledTopLevelEventHandlerIgnored) {
// there is only one rectangle in total.
frame_element->setAttribute(kStyleAttr, "transform: translateY(0px)");
CompositeFrame(); // Unthrottle the frame.
CompositeFrame(); // Update touch handler regions.
EXPECT_EQ(1u, TouchHandlerRegionSize());
}
......@@ -858,7 +856,6 @@ TEST_P(FrameThrottlingTest, ThrottledEventHandlerIgnored) {
DocumentLifecycle::AllowThrottlingScope throttling_scope(
GetDocument().Lifecycle());
CompositeFrame(); // Throttle the frame.
CompositeFrame(); // Update touch handler regions.
// In here, throttle iframe doesn't throttle the main frame.
EXPECT_TRUE(
......@@ -877,7 +874,6 @@ TEST_P(FrameThrottlingTest, ThrottledEventHandlerIgnored) {
// Unthrottling the frame makes the touch handler active again.
frame_element->setAttribute(kStyleAttr, "transform: translateY(0px)");
CompositeFrame(); // Unthrottle the frame.
CompositeFrame(); // Update touch handler regions.
EXPECT_EQ(1u, TouchHandlerRegionSize());
}
......
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