DescriptionRework compositor touch hit testing
Previously compositor thread hit-testing was done by sending a list of absolute rects to the compositor on layout (see www.chromium.org/developers/design-documents/compositor-hit-testing for details). This is broken whenever the position of an element can change without causing layout (scrolling, transforms, etc.), and results in touch event handlers not getting invoked when they should. To fix this we need to track the hit-test rects on a layer-by-layer basis, and this CL is the first big step in that direction.
I started with the per-layer approach LeviW@ first tried here: https://bugs.webkit.org/show_bug.cgi?id=103914, it was rejected from WebKit because it was too different from what iOS was doing, but is a perfectly reasonable approach for Blink. I modified this original patch in a number of ways, including:
- tracking rects per enclosing RenderLayer (instead of the enclosing composited layer), and then later projecting those rects onto the appropriate composited layer.
- breaking up the rect accumulation into multiple methods to eliminate code duplication and simplify some things
- disabling the mechanism when touch events aren't supported (doesn't affect devtools touch emulation) or when the page isn't composited
- fixing a bunch of bugs (see new tests below)
- short circuiting some common cases to make them faster
- accumulate LayoutRects instead of just IntRects
- exposing the per-layer details to the tests
This doesn't yet handle scrolling (or changing the transform) of non-composited layers, but that was already broken so this shouldn't make it any worse (and now handles the case when the layers are composited). I'll work on this case in a follow-on CL - this CL is big enough already.
This change reworks the testing infrastructure to make it possible to test bugs with when hit test rect update happens. Rather than freshly compute the hit test rects whenever the test asks for them, we instead register Internals to be notified by ScrollingCoordinator whenever the rects change. This allows us to verify that the rects are getting updated when they should, and also that we aren't getting unexpected updates.
This change also adds several additional test cases, including:
- touch handlers inside of scrolled divs (composited and non-composited)
- clipping behavior
- 2d (non-composited) transforms
- svg
- that changing style causes the rects to be updated
- global handlers on the html and body elements
- additional iframe test cases, including non-composited transforms of iframes
Also in order to make validating the test results easier, I've put a 'visualize' mode into the tests which will overlay the actual rects on top of the elements being tested. See http://goo.gl/ObBry for the current results (when running in content-shell interactively, which disables the use of the Ahem font to make the text readable).
BUG=248522
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=154611
Patch Set 1 #Patch Set 2 : Clean up a few things, fix continuations and SVG #Patch Set 3 : Fix iframes and add some polish #Patch Set 4 : Retry borked upload #Patch Set 5 : Add dummy expectations for other platforms #Patch Set 6 : Various fixes and test additions #
Total comments: 3
Patch Set 7 : Tweak comments based on CR from leviw #Patch Set 8 : Tweak comment again #Patch Set 9 : Support non-composited transforms #Patch Set 10 : A few more tweaks #Patch Set 11 : Small simplificaiton in document traversal logic #Patch Set 12 : Tweak comment and remove unnecessary include #Patch Set 13 : Fix 0-height body case #Patch Set 14 : Fix 0-height body case #Patch Set 15 : Fix lifetime issue with Internals::m_currentTouchEventRects #
Total comments: 16
Patch Set 16 : Leviw CR feedback and license header updates #
Total comments: 1
Patch Set 17 : CR feedback - accumulate LayoutRects instead of IntRects, disable when page isn't composited. Also… #Messages
Total messages: 25 (0 generated)
|