8000 [WebDriver] Reuse "Find Elements" handler in "Find element" by yezhizhen · Pull Request #37737 · servo/servo · GitHub
[go: up one dir, main page]

Skip to content

Conversation

yezhizhen
Copy link
Member
@yezhizhen yezhizhen commented Jun 27, 2025

All "Find Element ..." in spec has exactly same step has "Find Elements ...", except they extract the first element if there is any. We now reuse the handler instead of running numerous repetitive steps, same as what we did for "Find Element from Shadow Root" in #37578.

This reduces binary size by 98KB for Release profile in Windows and improves maintainability.

Testing: ./mach test-wpt -r .\tests\wpt\tests\webdriver\tests\classic\find_element* --product servodriver

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
@yezhizhen yezhizhen requested a review from gterzian as a code owner June 27, 2025 05:06
@yezhizhen yezhizhen requested review from jdm, xiaochengh and gterzian and removed request for gterzian June 27, 2025 05:08
@yezhizhen yezhizhen changed the title Reuse "Find Elements" handler in "Find element" [WebDriver] Reuse "Find Elements" handler in "Find element" Jun 27, 2025
@yezhizhen yezhizhen requested a review from wusyong June 27, 2025 05:18
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
@yezhizhen yezhizhen requested a review from wusyong June 27, 2025 06:43
Copy link
Member
@wusyong wusyong left a comment

Choose a reason for hiding this comment

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

LGTM. Don't forget to fix the lint.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
@yezhizhen yezhizhen requested a review from wusyong June 27, 2025 07:57
@wusyong wusyong added this pull request to the merge queue Jun 27, 2025
Merged via the queue into servo:main with commit 0329f33 Jun 27, 2025
21 checks passed
@yezhizhen yezhizhen deleted the chore-merge-find branch June 27, 2025 09:47
github-merge-queue bot pushed a commit that referenced this pull request Jul 22, 2025
`WebDriverCommandMsg::TakeScreenshot` was the last thing blocking us
from removing constellation access in webdriver server. Now we can
happily remove it.

Surprisingly, this reduces binary size by 185KB for release profile in
Windows. #37737 removes a net total of 300 lines, but only reduced 98KB.

Testing: No regression after testing.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
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.

2 participants
0