Commit 3b3112c7 authored by Philip Rogers's avatar Philip Rogers Committed by Commit Bot

Ensure CompositedLayerMapping updates when hit testing changes

When blocking event handlers change, we need to ensure
CompositedLayerMapping updates "PaintsHitTest" on GraphicsLayers. This
is done via CompositedLayerMapping::UpdateDrawsContentAndPaintsHitTest.

Bug: 1134524
Change-Id: I7d54b709c4fe7097ee14ba34fee3f8e81bef1e03
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2446529
Auto-Submit: Philip Rogers <pdr@chromium.org>
Reviewed-by: default avatarSam Fortiner <samfort@microsoft.com>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813511}
parent 92eeac91
......@@ -885,6 +885,29 @@ TEST_P(ScrollingTest, WindowTouchEventHandlerInvalidation) {
EXPECT_TRUE(region.IsEmpty());
}
TEST_P(ScrollingTest, TouchActionChangeWithoutContent) {
LoadHTML(R"HTML(
<div id="blocking"
style="will-change: transform; width: 100px; height: 100px;"></div>
)HTML");
ForceFullCompositingUpdate();
// Adding a blocking window event handler should create a touch action region.
auto* listener = MakeGarbageCollected<ScrollingTestMockEventListener>();
auto* resolved_options =
MakeGarbageCollected<AddEventListenerOptionsResolved>();
resolved_options->setPassive(false);
auto* target_element = GetFrame()->GetDocument()->getElementById("blocking");
target_element->addEventListener(event_type_names::kTouchstart, listener,
resolved_options);
ForceFullCompositingUpdate();
const auto* cc_layer = LayerByDOMElementId("blocking");
cc::Region region = cc_layer->touch_action_region().GetRegionForTouchAction(
TouchAction::kNone);
EXPECT_EQ(region.bounds(), gfx::Rect(0, 0, 100, 100));
}
// Ensure we don't crash when a plugin becomes a LayoutInline
TEST_P(ScrollingTest, PluginBecomesLayoutInline) {
LoadHTML(R"HTML(
......
......@@ -362,6 +362,7 @@ void PrePaintTreeWalk::InvalidatePaintForHitTesting(
context.paint_invalidator_context.painting_layer->SetNeedsRepaint();
ObjectPaintInvalidator(object).InvalidateDisplayItemClient(
object, PaintInvalidationReason::kHitTest);
SetNeedsCompositingLayerPropertyUpdate(object);
}
void PrePaintTreeWalk::UpdateAuxiliaryObjectProperties(
......
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