fune/testing/web-platform/tests/css/css-ui/pointer-events-no-scrollbars-001-ref.html
L. David Baron f2cc75445d Bug 1822324 [wpt PR 38989] - Improve interaction of pointer-events with scroll gesture hit testing, scrollability decisions, and overlay scrollbars, a=testonly
Automatic update from web-platform-tests
Improve interaction of pointer-events with scroll gesture hit testing, scrollability decisions, and overlay scrollbars

* First, this change stops considering pointer-events when deciding
  whether a paint layer is scrollable.  This avoids pointer-events
  having strange effects on decisions about whether to show overlay
  scrollbars.  These strange effects include the backdrop of a <dialog>
  causing the things behind it to become inert (and thus have
  pointer-events: none) and cause overlay scrollbars to spontaneously
  appear.

  This is done by changing a test of
  ComputedStyle::VisibleToHitTesting() to test only
  ComputedStyle::Visibility(), which is one of the two parts of
  VisibleToHitTesting().  This test dates back to
  9de09a320e%5E%21/
  and I don't think the pointer-events part of the test makes sense.
  (I'm somewhat suspicious of the visibility part of the test as well,
  although the authors of the tests at
  web_tests/fast/scrolling/scrollable-area-{frame{,-scrolling-no}-visibility-hidden-child,overflow-auto-visibility-hidden{,-in-parent}}.html
  believed in that part at least enough to write 4 tests for it.)  It
  doesn't seem to me that pointer-events (or, really, visibility) should
  affect the result of ScrollsOverflow since it doesn't affect whether
  something can be scrolled programmatically (or, for pointer-events,
  via the keyboard).

  Additionally, this CL then undoes the effect that the above change
  would have on decisions about implicit promotion to the root scroller.

  On Mac (but not Linux), the two added tests show the bug without this
  change, when run in virtual/overlay-scrollbar/, but are fixed by this
  change.

* Second, in order to both fix regressions from the above change and
  fix existing bugs that exist prior to it, this change changes how
  gesture scrolls are targeted when some but not all elements have
  pointer-events: none, so that gesture scrolls are reliably hit tested
  based on the pointer-events values of the elements involved.  In
  particular, it forces a scrollable region that is not visible to hit
  testing to use the main thread hit testing codepath (since it may have
  arbitrary descendants, scrollable or not, that are visible to hit
  testing).  It also adjusts the hit testing of scrollbars themselves to
  match.

  This is needed to avoid regressing
  external/wpt/pointerevents/pointerevent_hit_test_scroll.html on Mac
  only, and to avoid
  pointerevent_hit_test_scroll_visible_descendant.html starting to fail
  again (after being fixed by the first part) on Linux and Windows.  (I
  don't fully understand why the regression in
  pointerevent_hit_test_scroll.html is Mac-only, but I know that on
  Linux, UpdateNonFastScrollableRegion fails to bail out early in some
  cases where on Mac it does bail out early because layer.element_id()
  == scroll_element_id; in these cases, on Linux, layer.element_id() is
  0 while scroll_element_id is not zero.)

* Third, this change also makes virtual/overlay-scrollbar/ and
  virtual/non-overlay-scrollbar/ never expire, because they test
  something that varies based on OS and settings rather than a feature
  being rolled out (e.g., virtual/overlay-scrollbar/ matches the default
  behavior on a Mac, whereas running outside that virtual suite does
  not), and renames the README.txt to README.md to satisfy
  https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/tools/blinkpy/web_tests/lint_test_expectations.py;l=345-348;drc=fdd1781f121a555a8f4b771b970147e1a7ec4876

Fixed: 1414142
Change-Id: Ic26cfb933948bca55e4042ed360ed07692d14a0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4237636
Commit-Queue: David Baron <dbaron@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1121965}

--

wpt-commits: 0b8c8ceda78d3134ada3da1fc3d203988b962ee8
wpt-pr: 38989
2023-04-12 11:21:25 +00:00

26 lines
447 B
HTML

<!DOCTYPE HTML>
<html>
<title>CSS Test Reference: differences in pointer-events shouldn't cause overlay scrollbars to appear</title>
<link rel="author" title="L. David Baron" href="https://dbaron.org/">
<link rel="author" title="Google" href="http://www.google.com/">
<style>
#scroll {
width: 200px;
height: 200px;
overflow: auto;
}
#big {
width: 500px;
height: 500px;
}
</style>
<div id="scroll">
<div id="big">
</div>
</div>