webdriver: Wait animation frame callbacks before taking (element) screenshot (#39539)

According to spec, we should wait animation frame callbacks before
taking (element) screenshot. As "element screenshot" would automatically
scroll into view, this solves intermittency.

Testing: Manually tested on pages, and
`take_element_screenshot/scroll_into_view.py` passes stably now.
Fixes: #39306

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
Euclid Ye 2025-09-27 21:29:44 +08:00 committed by GitHub
parent 5f5f2abc0f
commit 6aa82309c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 4 deletions

View file

@ -1223,7 +1223,7 @@ impl IOCompositor {
}
/// Render the WebRender scene to the active `RenderingContext`. If successful, trigger
/// the next round of animations.
/// the next round of animations. Return false if unable to render.
pub fn render(&mut self) -> bool {
self.global
.borrow()