Commit c6fbcf8
authored
fix(direction): preserve explicit bidiVisual=false in resolveTableDirection (SD-3141) (#3283)
resolveTableDirection previously emitted visualDirection only for the
explicit-true case, conflating "no signal" with "explicit false."
Per ECMA-376 section 17.4.1 + 17.17.4, w:bidiVisual w:val="0" is an
explicit-false that can override a style-cascade true. Cascade-override
semantics match paragraph w:bidi, which resolveParagraphDirection
already handles symmetrically. The table resolver had a gap.
Add the missing else-if branch so an explicit false emits
visualDirection: 'ltr'. The helper getTableVisualDirection added in
SD-3138 (PR #3279) already returned 'ltr' for the legacy fallback path;
this aligns the resolver with the helper so Phase 1B (pm-adapter wiring
of tableDirectionContext) does not silently regress the explicit-false
case from 'ltr' to undefined.
Tests:
- rightToLeft: false -> visualDirection: 'ltr'
- bidiVisual: false -> visualDirection: 'ltr'
- empty input -> visualDirection: undefined
- rtl wins when mixed signals present
- 24 existing direction tests still pass.1 parent a81be59 commit c6fbcf8
2 files changed
Lines changed: 37 additions & 0 deletions
File tree
- packages/layout-engine/pm-adapter/src/direction
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
75 | 106 | | |
76 | 107 | | |
77 | 108 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
| 36 | + | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
0 commit comments