Auto merge of #29666 - mrobinson:try-to-fix-hit-test-flakiness, r=<try>

Fix flakiness in hit testing

We need to make sure that hit testing from script reflects the latest display list we have sent from the compositor.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2023-04-26 13:36:00 +02:00 committed by GitHub
commit ff2222ecd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 21 additions and 89 deletions

View file

@ -669,6 +669,18 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
flags, flags,
sender, sender,
)) => { )) => {
// When a display list is sent to WebRender, it starts scene building in a
// separate thread and then that display list is available for hit testing.
// Without flushing scene building, any hit test we do might be done against
// a previous scene, if the last one we sent hasn't finished building.
//
// TODO(mrobinson): Flushing all scene building is a big hammer here, because
// we might only be interested in a single pipeline. The only other option
// would be to listen to the TransactionNotifier for previous per-pipeline
// transactions, but that isn't easily compatible with the event loop wakeup
// mechanism from libserver.
self.webrender_api.flush_scene_builder();
let result = self.hit_test_at_point_with_flags_and_pipeline(point, flags, pipeline); let result = self.hit_test_at_point_with_flags_and_pipeline(point, flags, pipeline);
let _ = sender.send(result); let _ = sender.send(result);
}, },

View file

@ -1,3 +0,0 @@
[hit-test-floats-003.html]
[Miss float below something else]
expected: FAIL

View file

@ -1,3 +0,0 @@
[hit-test-floats-004.html]
[Miss float below something else]
expected: FAIL

View file

@ -1,3 +0,0 @@
[hit-test-floats-005.html]
[Miss clipped float]
expected: FAIL

View file

@ -1,3 +0,0 @@
[block-in-inline-hittest-001.html]
[block-in-inline-hittest-001]
expected: FAIL

View file

@ -1,6 +1,3 @@
[block-in-inline-hittest-002.html] [block-in-inline-hittest-002.html]
[elementsFromPoint] [elementsFromPoint]
expected: FAIL expected: FAIL
[elementFromPoint]
expected: FAIL

View file

@ -1,6 +1,3 @@
[block-in-inline-hittest-relpos-zindex.html] [block-in-inline-hittest-relpos-zindex.html]
[position: relative; z-index: -1;] [position: relative; z-index: -1;]
expected: FAIL expected: FAIL
[block-in-inline-hittest-relpos-zindex]
expected: FAIL

View file

@ -1,3 +0,0 @@
[hit-test-anonymous-block.html]
[Hit test beside line of text inside anonymous block]
expected: FAIL

View file

@ -1,3 +0,0 @@
[CaretPosition-001.html]
[Element at (400, 100)]
expected: FAIL

View file

@ -1,3 +0,0 @@
[elementFromPoint-001.html]
[CSSOM View - 5 - extensions to the Document interface]
expected: FAIL

View file

@ -1,3 +0,0 @@
[elementFromPoint-002.html]
[Checking whether dynamic changes to visibility interact correctly with\n table anonymous boxes]
expected: FAIL

View file

@ -1,4 +0,0 @@
[elementFromPoint-003.html]
[Checking whether dynamic changes to visibility interact correctly with\n table anonymous boxes]
expected: FAIL

View file

@ -1,3 +0,0 @@
[elementFromPoint-dynamic-anon-box.html]
[Link should be clickable after hiding a scrollbox with an anonymous table inside]
expected: FAIL

View file

@ -1,3 +0,0 @@
[elementFromPoint-visibility-hidden-resizer.html]
[elementFromPoint on resizer area of an element with visibility:hidden]
expected: FAIL

View file

@ -13,9 +13,3 @@
[test some point of the element: bottom right corner] [test some point of the element: bottom right corner]
expected: FAIL expected: FAIL
[test the top of layer]
expected: FAIL
[test some point of the element: top left corner]
expected: FAIL

View file

@ -1,4 +0,0 @@
[elementsFromPoint-inline-htb-ltr.html]
[elementsFromPoint should return all elements under a point]
expected: FAIL

View file

@ -0,0 +1,3 @@
[scroll-behavior-smooth-navigation.html]
[Instant scrolling while doing history navigation.]
expected: FAIL

View file

@ -5,9 +5,6 @@
[clientWidth/clientHeight on the HTML body element in quirks mode] [clientWidth/clientHeight on the HTML body element in quirks mode]
expected: FAIL expected: FAIL
[scrollBy() on the root element in non-quirks mode]
expected: FAIL
[scrollLeft/scrollRight of the content in quirks mode] [scrollLeft/scrollRight of the content in quirks mode]
expected: FAIL expected: FAIL
@ -26,12 +23,6 @@
[scrollLeft/scrollRight of the content in non-quirks mode] [scrollLeft/scrollRight of the content in non-quirks mode]
expected: FAIL expected: FAIL
[scroll() on the root element in non-quirks mode]
expected: FAIL
[scrollLeft/scrollTop on the root element in non-quirks mode]
expected: FAIL
[scrollWidth/scrollHeight on the HTML body element in quirks mode] [scrollWidth/scrollHeight on the HTML body element in quirks mode]
expected: FAIL expected: FAIL
@ -43,12 +34,3 @@
[scrollLeft/scrollTop on the HTML body element in non-quirks mode] [scrollLeft/scrollTop on the HTML body element in non-quirks mode]
expected: FAIL expected: FAIL
[scroll() on the HTML body element in quirks mode]
expected: FAIL
[scrollBy() on the HTML body element in quirks mode]
expected: FAIL
[scrollLeft/scrollTop on the HTML body element in quirks mode]
expected: FAIL

View file

@ -1,3 +0,0 @@
[hit-test-floats-001.html]
[hit-test-floats-001]
expected: FAIL

View file

@ -1,3 +0,0 @@
[hit-test-floats-003.html]
[Miss float below something else]
expected: FAIL

View file

@ -1,3 +0,0 @@
[block-in-inline-hittest-float-001.html]
[block-in-inline-hittest-float-001]
expected: FAIL

View file

@ -1,3 +0,0 @@
[elementFromPoint-dynamic-anon-box.html]
[Link should be clickable after hiding a scrollbox with an anonymous table inside]
expected: FAIL

View file

@ -1,3 +0,0 @@
[elementFromPoint-ellipsis-in-inline-box.html]
[elementFromPoint-ellipsis-in-inline-box]
expected: FAIL

View file

@ -22,3 +22,9 @@
[<li>Image Inside 1</li>] [<li>Image Inside 1</li>]
expected: FAIL expected: FAIL
[<li>Inside 3</li>]
expected: FAIL
[<li>Image Inside 2</li>]
expected: FAIL

View file

@ -17,6 +17,3 @@
[test some point of the element: bottom right corner] [test some point of the element: bottom right corner]
expected: FAIL expected: FAIL
[test the top of layer]
expected: FAIL

View file

@ -1,3 +0,0 @@
[elementsFromPoint-iframes.html]
[elementsFromPoint on inner documents]
expected: FAIL