Skip to content

webdriver: Elegantly handle "element screenshot" when bounding box has area zero#39499

Merged
jdm merged 1 commit intoservo:mainfrom
yezhizhen:fix-screenshot-synchronization
Sep 27, 2025
Merged

webdriver: Elegantly handle "element screenshot" when bounding box has area zero#39499
jdm merged 1 commit intoservo:mainfrom
yezhizhen:fix-screenshot-synchronization

Conversation

@yezhizhen
Copy link
Copy Markdown
Member

@yezhizhen yezhizhen commented Sep 26, 2025

It is possible that the bounding rectangle of an element has area 0. This PR avoids panic in this case.

It is worth to mention that the panic itself won't kill the entire program for interaction, but only the webdriver thread.

Testing: Manually tested on the case of #39495

@yezhizhen yezhizhen requested review from jdm and xiaochengh September 26, 2025 06:29
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Sep 26, 2025
)))
},
Err(error) => Err(WebDriverError::new(error, "Element not found")),
Err(error) => Err(WebDriverError::new(error, "")),
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.

It is possible that element is found but "stale".

Signed-off-by: Euclid Ye <[email protected]>
@yezhizhen yezhizhen force-pushed the fix-screenshot-synchronization branch from 853f91f to 81e742c Compare September 26, 2025 06:54
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Sep 27, 2025
@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 2e8fac9 Sep 27, 2025
25 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 fix-screenshot-synchronization branch September 27, 2025 04:46
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.

3 participants