Skip to content

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

Merged
jdm merged 2 commits intoservo:mainfrom
yezhizhen:early-return
Sep 27, 2025
Merged

webdriver: Wait animation frame callbacks before taking (element) screenshot#39539
jdm merged 2 commits intoservo:mainfrom
yezhizhen:early-return

Conversation

@yezhizhen
Copy link
Copy Markdown
Member

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 <[email protected]>
Signed-off-by: Euclid Ye <[email protected]>
@yezhizhen yezhizhen requested review from jdm and xiaochengh September 27, 2025 12:46
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Sep 27, 2025
if let Err(e) = response_sender.send(Err(())) {
error!("Sending reply to create png failed {e:?}");
}
return;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to add this in #39499. We should early return if bounding rectangle has area 0.

Copy link
Copy Markdown
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Sep 27, 2025
@jdm jdm enabled auto-merge September 27, 2025 13:04
@jdm jdm added this pull request to the merge queue Sep 27, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Sep 27, 2025
Merged via the queue into servo:main with commit 6aa8230 Sep 27, 2025
28 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Sep 27, 2025
@yezhizhen yezhizhen deleted the early-return branch September 27, 2025 14:27
@yezhizhen yezhizhen restored the early-return branch September 27, 2025 14:27
@yezhizhen yezhizhen deleted the early-return branch September 27, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Intermittent PASS in /webdriver/tests/classic/take_element_screenshot/scroll_into_view.py

3 participants