Repository navigation
fix(wasm): Size the invisible text input to the content area (backport #24556) - #24579
Conversation
|
Cherry-pick of bdbb268 has failed: Cherry-pick of c7e93ab has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
(cherry picked from commit bdbb268)
(cherry picked from commit fbf57fd)
(cherry picked from commit c7e93ab)
(cherry picked from commit 2776b41)
These tests were written before master gained a per-host placement policy for the shared invisible <input />. Rebasing them on top of it left them asserting tracking geometry unconditionally, which iOS hosts (input parked off-screen, size and position ignored) and any session where accessibility has detached the input would both fail. Reuse the probe helpers master already has instead of a second copy, and skip where there is deliberately nothing to measure — both policies are pinned by When_Focused_In_Browser_Then_Hidden_Input_Placement_Matches_Host. (cherry picked from commit de751c5)
(cherry picked from commit 9f89af3)
5d1ee92 to
acf386e
Compare
|
Rebuilt this backport on top of the current Why it was conflicting: the original cherry-pick of
What changed: the six original commits were re-cherry-picked ( - if (_view.Core?.ContentElement is not { } contentElement)
+ if (_view.TextBox?.ContentElement is not { } contentElement)(in both - var x = _view.Core?.FlowDirection is FlowDirection.RightToLeft
+ var x = _view.TextBox?.FlowDirection is FlowDirection.RightToLeft
Validation: |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24579/wasm-skia-net9/index.html |
|
The build 235158 did not find any UI Test snapshots differences. |
|
|
GitHub Issue: Tracked internally.
PR Type:
🐞 Bugfix
What changed? 🚀
The invisible
<input />the WASM head keeps in the DOM for text entry was sized and positioned fromTextBoxView.DisplayBlock. The DisplayBlock shrink-wraps the text, so the element tracked the text rather than the field.This was latent for a long time, because the TS wrote a unitless value:
Once the unit was added, the sizing took effect and the element started growing by a character's width on every keystroke. Browser password managers bind to that
<input />(it carriestype="password"andautocomplete="password") and anchor their affordances to its bounds — so the badge sat at the left edge of an empty PasswordBox and marched right as the user typed.UpdateSizeandUpdatePositionnow track the ContentElement minus its padding, which is whatOverlayTextBoxViewExtensionalready does on the other Skia targets. Moving the position to the same anchor keeps the element on its field when long text scrolls horizontally orTextAlignmentshifts the DisplayBlock.Adding the CSS unit was correct and is left as-is — it only exposed this.
Verification
Measured the real
#uno-inputbounds in Chrome against SamplesApp's search TextBox, typing 10 characters. Identical builds, only this change differing:The one-time 216 → 184 step after the first character is the DeleteButton appearing on the focused non-empty TextBox, which genuinely narrows the ContentElement. It happens once, not per character.
The added runtime test was confirmed to fail without the fix (
expected value <182> and actual value <1>) and pass with it.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
This is an automatic backport of pull request #24556 done by [Mergify](https://mergify.com).