Repository navigation
fix(wda): elements inside a WebView keep their screen coordinates - #139
Merged
Merged
Conversation
The widget heuristic in parse_tree treats a node at (0,0) as the start of relative coordinates and adds its parent's position to everything below. Inside a WKWebView there is a node that reports (0,0) at the WebView's own size, while the web elements under it use screen coordinates. With the WebView below a navigation bar (an app's in-app browser, y=100) every element came out 100 pt too low, and tapping by text hit the next row. Safari's WebView starts at y=0, so it never showed there. A WebView and everything inside it are now left out of the heuristic. Regression case Derrors#146; unit test web_contents_keep_screen_coordinates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cosinec
force-pushed
the
fix/webview-widget-offset
branch
from
November 17, 2026 06:09
f9c9d0b to
d247a7a
Compare
This was referenced Nov 17, 2026
Derrors
added a commit
to cosinec/iphone-control
that referenced
this pull request
Nov 17, 2026
Resolve the conflict in docs/dev/regression-cases.md: keep Derrors#146 (from Derrors#139) and this branch's Derrors#147, in order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Derrors
added a commit
to cosinec/iphone-control
that referenced
this pull request
Nov 17, 2026
Resolve the conflicts with Derrors#139 and Derrors#141: keep both sides (TapSequence next to Tap's new count, both constants, both client methods and their tests, CHANGELOG lines, regression rows Derrors#146-Derrors#148 in order). iphone_tap now carries count: a step with count under one_gesture is an error instead of being tapped once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Derrors
added a commit
to cosinec/iphone-control
that referenced
this pull request
Nov 17, 2026
Resolve the conflicts with Derrors#139, Derrors#141 and Derrors#143 by keeping both sides: drag_steps next to tap_sequence_body, the exports of both, the protocol helpers, the MCP tests, CHANGELOG lines and regression rows Derrors#146-Derrors#149 in order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Derrors
added a commit
that referenced
this pull request
Nov 18, 2026
Version 0.2.8 in Cargo.toml and Cargo.lock (this workspace's crates only), and the changelogs' Unreleased section dated. Each entry now ends with its pull request and says what the user sees, as CONTRIBUTING asks; #139's in-app browser fix gets the entry it was missing. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
parse_treetreats a node at (0,0) that has its parent's size, under a parent not at (0,0), as the start of a widget's relative coordinates, and adds the parent's position to everything below it. Inside a WKWebView there is a node exactly like that: it reports (0,0) at the WebView's own size. The web elements under it, though, report screen coordinates. So when the WebView sits below a navigation bar (an app's in-app browser, WebView at y=100), every element inside came out 100 pt too low, andiphone_tap_elementtapped the row underneath. Safari's WebView starts at y=0, which is why it never showed there.A WebView and everything inside it are now left out of the widget heuristic (
Open.in_web). Widgets outside web content are unchanged.Tests
1. Unit tests
cargo test --workspace --all-features --locked,cargo clippy --workspace --all-targets --all-features --locked -- -D warningsandcargo fmt --check(per package) pass (Rust 1.99.1, macOS)elements::tests::web_contents_keep_screen_coordinates(tree shape taken from the real page: NavigationBar, WebView at y=100, inner node at (0,0) with the WebView's size, text at y=375). It fails on main with (59,488) and passes with the fix at (59,388)#[ignore]tests of the changed area run by hand: none apply2. Real-device regression
tests/device/run.pydefault steps pass on this branch (exit code 0): 14 calls, 0 failed, 10.7 siphone_list_elementswith a filter on two headings, theniphone_tap_elementon a heading and on a link; compared each position with the screenshotrun.py output
3. Regression cases (docs/dev/regression-cases.md)
4. Real-device proof of the fix or feature
Steps and results (before / after)
Same in-app browser page, same scroll position. On the screenshot the first heading's text is centred at about (59,388) and the second at about (59,595). Page texts are replaced with placeholders.
Checklist
🤖 Generated with Claude Code