Repository navigation
Commit 32e7fff
authored
[web] Anchor flt-semantics-host at 0,0 to fix WebKit semantics offset (flutter#190486)
Fixes flutter#190483.
This is the part of the fix to flutter#129324.
**Problem**
On iOS every browser uses WebKit. `<flt-semantics-host>` is `position:
absolute` with no `left` or `top`, so it falls back to its CSS static
position. WebKit resolves that static position past the in-flow
`<flt-glass-pane>`, so the entire semantics layer is shifted roughly one
viewport off-screen. VoiceOver focus lands off-screen for every control,
text-field taps miss the `<input>`. Blink and Gecko resolve the same
static position to 0, so they are unaffected.
**Fix**
Set `left: 0; top: 0` in `StyleManager.styleSemanticsHost` so the host
is anchored at the view origin.
**Demo**
Measured on an iPhone at 430px width and devicePixelRatio 3, with
semantics enabled:
- Before, stock engine: https://flutter-demo-57-before.web.app reports 4
of 5 accessibility nodes off-screen, VoiceOver focus lands off-screen,
and picking a dropdown item blanks the screen.
- After, this fix: https://flutter-demo-57-after.web.app reports 0 of 5,
VoiceOver focus lands on each control, and the dropdown works. Please
note that there is a known issue that the webkit delays keyboard's pop
up when voice over is enabled.1 parent 6603e14 commit 32e7fff
2 files changed
Lines changed: 16 additions & 0 deletions
File tree
- engine/src/flutter/lib/web_ui
- lib/src/engine/view_embedder
- test/engine/view_embedder
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
55 | 65 | | |
56 | 66 | | |
57 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
| |||
0 commit comments