SvgTextLayoutAttributesBuilder walked the text per UTF-16
code point and gave each one its own value from the
x/y/dx/dy/rotate
lists. A combining mark therefore took a list value of its own, was shaped as
a separate segment and drawn away from the letter it belongs to: with
x="10 60" on a + U+0301, the accent lands at
x=60.
Per the SVG text layout algorithm the lists are indexed by
addressable characters, but repositioning applies to
typographic characters. A code point that extends the previous
typographic character is its "middle": it still consumes a list value, but
x/y are dropped and dx/dy
are accumulated into the next typographic character. The fix implements that,
behind the default-on SvgTextPositioningGraphemeClusters kill
switch.
The first version of this fix simply let a combining mark consume nothing
from the lists. That renders case 1 correctly, but it shifts every later
value by one: in case 2 "b" would land on the mark's value (x=60) instead of
its own (x=110). The spec is explicit that the arrays stay indexed by
addressable characters and only the application is per typographic
character, so the landed version consumes the value and throws the
x/y part away, while dx/dy
accumulate.
A second WPT reftest,
text-positioning-list-combining-marks-indexing.html, pins
exactly that: it is red on upstream and red on the first version of
the fix.
svg/text + external/wpt/svg/text: 328 tests
as expected.SvgTextLayoutAttributesBuilderTest and
*SvgText* unit tests pass.