mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
layout: Add a layout hit test and use it for document.elementsFromPoint
(#38463)
In #18933, hit testing was moved from layout to WebRender. This presents some issues. For instance, the DOM can change at the same time that hit test is happening. This can mean that hit test returns references to defunct DOM nodes, introducing memory safety issues. Currently, Servo will try to ensure that the epochs used for testing and those recorded in the DOM match, but this is not very reliable and has led to code that retries failed hit tests. This change reintroduces (8 years later) a layout hit tester and turns it on for `document.elementFromPoint` and `document.elementsFromPoint`. The idea is that this hit tester will gradually replace the majority of the WebRender hit testing happening in the renderer. Testing: This shouldn't really change the behavior hit testing, but it seems to improve one WPT test. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: kongbai1996 <1782765876@qq.com>
This commit is contained in:
parent
3e856cbf11
commit
11844ca5af
11 changed files with 539 additions and 113 deletions
|
@ -1,3 +0,0 @@
|
|||
[transform-scale-hittest.html]
|
||||
[Hit test intersecting scaled box]
|
||||
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue