Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ef2bac73ff9346238a2821c222980d38f9aaad97
      
https://github.com/WebKit/WebKit/commit/ef2bac73ff9346238a2821c222980d38f9aaad97
  Author: Karl Dubost <[email protected]>
  Date:   2026-06-30 (Tue, 30 Jun 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/text/reftests/textpath-combining-marks-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/text/reftests/textpath-combining-marks-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/text/reftests/textpath-combining-marks.html
    M Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp

  Log Message:
  -----------
  Combining marks on SVG <textPath> render as dotted circles
https://bugs.webkit.org/show_bug.cgi?id=266832
rdar://120284006

Reviewed by Elika Etemad.

SVG text on a path (and any per-character-positioned text) was laid out one
Unicode code point at a time: SVGTextLayoutEngine opened a fresh
single-code-point fragment for every code point whenever a per-character
condition fired (text on a path, an explicit rotate, vertical text, …),
and SVGTextBoxPainter then shaped each fragment's substring in isolation. A lone
combining mark shaped on its own (e.g. U+0301, or the Devanagari virama U+094D)
makes the font emit a dotted circle.

SVG 2 section 11 addresses the text-positioning attributes (x/y/dx/dy/rotate)
per Unicode code point, but it also defines a "typographic character"

    a UAX #29 grapheme cluster such as a base letter plus its
    combining marks, or a Devanagari syllable

as an indivisible unit whose internal glyph arrangement is "not user
controllable". So code points are addressed, but typographic characters
are positioned and shaped. WebKit placed code points.

Compute grapheme-cluster boundaries over the renderer text with an ICU
character-break iterator, keyed by the same code-unit offset the layout loop
walks, and only let a cluster-start code point open a new fragment. A
continuation code point (a combining mark, a Devanagari continuation, the
second regional indicator of a flag) now joins the current fragment, so the
painter hands base + marks to the shaper together. This is font-independent, so
it groups base + mark even when the font has no composed glyph -- precisely the
dotted-circle case. Per-code-point metrics, character-data lookups, and the
getNumberOfChars / query contract are unchanged; the fragment simply spans
multiple metrics entries, which recordTextFragment already sums.

Matches Gecko and Blink, which both treat the typographic character as the
positioning unit. For pure ASCII / precomposed Latin-1 text every code point is
a grapheme boundary, so behavior is unchanged there.

Tests: 
imported/w3c/web-platform-tests/svg/text/reftests/textpath-combining-marks-ref.html
       
imported/w3c/web-platform-tests/svg/text/reftests/textpath-combining-marks.html

* 
LayoutTests/imported/w3c/web-platform-tests/svg/text/reftests/textpath-combining-marks-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/text/reftests/textpath-combining-marks-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/text/reftests/textpath-combining-marks.html:
 Added.
* Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath):

Canonical link: https://commits.webkit.org/316144@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to