Commit a1c594c8 authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

Fix touch action rect computation for continuation

This CL fixes the touch action rects computation for continuation
case. In this case, we need to mark white listed touch action
changed for a object's continuation.

The correctness can be verified by passing an existing test.

Bug: 853912
Cq-Include-Trybots: luci.chromium.try:linux-blink-gen-property-trees;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I88a5bd5989d2dbf42c921fd71ca2ca5aa5f893c6
Reviewed-on: https://chromium-review.googlesource.com/1154888
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583727}
parent 98acdea7
......@@ -1396,3 +1396,5 @@ Bug(none) compositing/overflow/scrollbar-layer-placement-negative-z-index-child-
Bug(none) fast/events/touch/compositor-touch-hit-rects-svg.html [ Failure ]
Bug(none) virtual/paint-touchaction-rects/fast/events/touch/compositor-touch-hit-rects-svg.html [ Failure ]
Bug(none) fast/events/touch/compositor-touch-hit-rects-continuation.html [ Failure ]
Bug(none) virtual/paint-touchaction-rects/fast/events/touch/compositor-touch-hit-rects-continuation.html [ Failure ]
This tests verifies the hit test regions given to the compositor specifically for continuation case. It can only be run in DumpRenderTree.
continuation: #document scrolling (13, 79, 101, 11)
continuation: #document scrolling (13, 90, 290, 12)
continuation: #document scrolling (13, 102, 121, 11)
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="resources/compositor-touch-hit-rects.css">
</head>
<body>
<p id="description">
This tests verifies the hit test regions given to the compositor specifically for
continuation case. It can only be run in DumpRenderTree.</p>
<div id="tests">
<div>
<b class="testcase" id="continuation">
This b tag
<div>causes a</div>
continuation
</b>
</div>
</div>
<div id="console"></div>
<script src="resources/compositor-touch-hit-rects.js"></script>
</body>
......@@ -292,8 +292,14 @@ void EventHandlerRegistry::NotifyHasHandlersChanged(
if (handler_class == kTouchStartOrMoveEventBlocking ||
handler_class == kTouchStartOrMoveEventBlockingLowLatency) {
if (auto* node = target->ToNode()) {
if (auto* layout_object = node->GetLayoutObject())
if (auto* layout_object = node->GetLayoutObject()) {
layout_object->MarkEffectiveWhitelistedTouchActionChanged();
auto* continuation = layout_object->VirtualContinuation();
while (continuation) {
continuation->MarkEffectiveWhitelistedTouchActionChanged();
continuation = continuation->VirtualContinuation();
}
}
} else if (auto* dom_window = target->ToLocalDOMWindow()) {
// This event handler is on a window. Ensure the layout view is
// invalidated because the layout view tracks the window's blocking
......
......@@ -167,6 +167,12 @@ bool HasBlockingTouchEventHandler(const LayoutObject& object) {
}
auto* node = object.GetNode();
if (!node && object.IsLayoutBlockFlow() &&
ToLayoutBlockFlow(object).IsAnonymousBlockContinuation()) {
// An anonymous continuation does not have handlers so we need to check the
// DOM ancestor for handlers using |NodeForHitTest|.
node = object.NodeForHitTest();
}
if (!node)
return false;
return HasBlockingTouchEventHandler(*object.GetFrame(), *node);
......
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