Commit 555b4daa authored by Xiaocheng Hu's avatar Xiaocheng Hu Committed by Commit Bot

[LayoutNG] Add scrolled offset when hit testing scrolled content

This patch takes scrolled offset into account when hit testing the
children of a scroll container, so that scrolled contents can be hit
tested correctly.

Bug: 855279
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ic84b40c06302c457cf32cacaa5e79f419dcc3a2b
Reviewed-on: https://chromium-review.googlesource.com/1125312Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572398}
parent b38610a1
......@@ -418,7 +418,6 @@ crbug.com/591099 fast/dynamic/first-letter-after-list-marker.html [ Failure ]
crbug.com/591099 fast/dynamic/text-combine.html [ Failure ]
crbug.com/591099 fast/encoding/utf-16-big-endian.html [ Failure ]
crbug.com/591099 fast/encoding/utf-16-little-endian.html [ Failure ]
crbug.com/591099 fast/events/mouse-relative-position.html [ Failure ]
crbug.com/591099 fast/events/select-element.html [ Failure ]
crbug.com/591099 fast/events/touch/compositor-touch-hit-rects.html [ Failure ]
crbug.com/591099 fast/events/wheel/mainthread-touchpad-fling-latching.html [ Pass ]
......@@ -716,7 +715,6 @@ crbug.com/591099 paint/invalidation/svg/resize-svg-invalidate-children-2.html [
crbug.com/714962 paint/invalidation/svg/resize-svg-invalidate-children-fixed-size-relative-child.html [ Failure ]
crbug.com/591099 paint/invalidation/svg/resize-svg-invalidate-children.html [ Failure ]
crbug.com/591099 paint/invalidation/svg/scale-change-huge-geometry.html [ Failure ]
crbug.com/591099 paint/invalidation/svg/scroll-hit-test.xhtml [ Failure ]
crbug.com/728378 paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem.html [ Failure ]
# rightsizing-grid.html is truly flaky, show flakiness on reload
crbug.com/591099 svg/wicd/rightsizing-grid.html [ Pass Failure ]
......@@ -799,7 +797,6 @@ crbug.com/591099 virtual/gpu/fast/canvas/shadow-huge-blur.html [ Pass ]
crbug.com/591099 virtual/layout_ng/ [ Skip ]
crbug.com/824918 virtual/layout_ng_experimental/ [ Skip ]
crbug.com/591099 virtual/mojo-blob-urls/external/wpt/FileAPI/url/sandboxed-iframe.html [ Pass ]
crbug.com/591099 virtual/mouseevent_fractional/fast/events/mouse-relative-position.html [ Failure ]
crbug.com/591099 virtual/mouseevent_fractional/fast/events/select-element.html [ Failure ]
crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/compositor-touch-hit-rects.html [ Failure ]
crbug.com/591099 virtual/mouseevent_fractional/fast/events/wheel/mainthread-touchpad-fling-latching.html [ Pass ]
......@@ -819,7 +816,6 @@ crbug.com/591099 virtual/stable/ [ Skip ]
crbug.com/591099 virtual/threaded/ [ Skip ]
crbug.com/591099 virtual/user-activation-v2/fast/dom/Window/window-lookup-precedence.html [ Failure ]
crbug.com/591099 virtual/user-activation-v2/fast/events/mouse-cursor.html [ Failure ]
crbug.com/591099 virtual/user-activation-v2/fast/events/mouse-relative-position.html [ Failure ]
crbug.com/591099 virtual/user-activation-v2/fast/events/select-element.html [ Failure ]
crbug.com/591099 virtual/user-activation-v2/fast/events/touch/compositor-touch-hit-rects.html [ Failure ]
crbug.com/591099 virtual/user-activation-v2/fullscreen/full-screen-with-flex-item.html [ Failure ]
......
......@@ -876,10 +876,15 @@ bool NGBoxFragmentPainter::NodeAtPoint(
}
}
if (!skip_children &&
HitTestChildren(result, box_fragment_.Children(), location_in_container,
physical_offset, action)) {
return true;
if (!skip_children) {
const IntSize scrolled_offset =
box_fragment_.HasOverflowClip()
? PhysicalFragment().ScrolledContentOffset()
: IntSize();
if (HitTestChildren(result, box_fragment_.Children(), location_in_container,
physical_offset - scrolled_offset, action)) {
return true;
}
}
if (style.HasBorderRadius() &&
......
......@@ -114,8 +114,9 @@ class NGBoxFragmentPainter : public BoxPainterBase {
// Hit tests the children of a container fragment, which is either
// |box_fragment_|, or one of its child line box fragments.
// @param physical_offset Physical offset of the container fragment in paint
// layer.
// @param physical_offset Physical offset of the container fragment's content
// box in paint layer. Note that this includes scrolling offset when the
// container has 'overflow: scroll'.
bool HitTestChildren(HitTestResult&,
const Vector<std::unique_ptr<NGPaintFragment>>&,
const HitTestLocation& location_in_container,
......
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