Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 653fcf96d991c6b4eaef1758852ba59876e4b5d6
      
https://github.com/WebKit/WebKit/commit/653fcf96d991c6b4eaef1758852ba59876e4b5d6
  Author: Brent Fulgham <[email protected]>
  Date:   2026-10-14 (Wed, 14 Oct 2026)

  Changed paths:
    A 
LayoutTests/fast/repaint/combining-mark-ink-overflow-repaint-after-preceding-link-change-expected.html
    A 
LayoutTests/fast/repaint/combining-mark-ink-overflow-repaint-after-preceding-link-change.html
    A 
LayoutTests/fast/text/combining-mark-origin-line-box-contain-glyphs-expected.txt
    A LayoutTests/fast/text/combining-mark-origin-line-box-contain-glyphs.html
    A 
LayoutTests/fast/text/combining-mark-origin-line-box-contain-initial-letter-expected.txt
    A 
LayoutTests/fast/text/combining-mark-origin-line-box-contain-initial-letter.html
    A LayoutTests/imported/w3c/web-platform-tests/fonts/mark-origin-y-test.ttf
    A 
LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.actualBoundingBox.combining-mark-offset-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.actualBoundingBox.combining-mark-offset.html
    A 
LayoutTests/imported/w3c/web-platform-tests/html/canvas/tools/generate-mark-origin-y-font.py
    M Source/WebCore/platform/graphics/ComplexTextController.cpp

  Log Message:
  -----------
  Include shaped glyph origins in complex text glyph bounds
https://bugs.webkit.org/show_bug.cgi?id=326688
rdar://184235153

Reviewed by Vitor Roriz.

Combining marks have a zero base advance and shaping moves them through
the per-glyph origin. Paint applies that origin in
ComplexTextController::advance, but glyph bounds measurement only used
the pen position. Stacked marks were therefore measured as if they sat
on the baseline, the text box reported too little ink overflow, and the
marks were not repainted after a preceding link changed.

Therefore subtract the origin's y from each glyph's bounds in
adjustGlyphsAndAdvances and enclosingGlyphBoundsForTextRun. These bounds
also feed canvas measureText's actualBoundingBoxAscent/Descent and the
line box height for -webkit-line-box-contain: glyphs and initial-letter,
so those now include the shaped mark offsets too. The origin's x is
still not applied (FIXME). The new tests cover each of those consumers
using a generated font whose combining marks sit above and below the
baseline through a GPOS anchor, since no system font guarantees a mark
with a vertical offset.

Tests: 
fast/repaint/combining-mark-ink-overflow-repaint-after-preceding-link-change.html
       fast/text/combining-mark-origin-line-box-contain-glyphs.html
       fast/text/combining-mark-origin-line-box-contain-initial-letter.html
       
imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.actualBoundingBox.combining-mark-offset.html

* 
LayoutTests/fast/repaint/combining-mark-ink-overflow-repaint-after-preceding-link-change-expected.html:
 Added.
* 
LayoutTests/fast/repaint/combining-mark-ink-overflow-repaint-after-preceding-link-change.html:
 Added.
* 
LayoutTests/fast/text/combining-mark-origin-line-box-contain-glyphs-expected.txt:
 Added.
* LayoutTests/fast/text/combining-mark-origin-line-box-contain-glyphs.html: 
Added.
* 
LayoutTests/fast/text/combining-mark-origin-line-box-contain-initial-letter-expected.txt:
 Added.
* 
LayoutTests/fast/text/combining-mark-origin-line-box-contain-initial-letter.html:
 Added.
* LayoutTests/imported/w3c/web-platform-tests/fonts/mark-origin-y-test.ttf: 
Added.
* 
LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.actualBoundingBox.combining-mark-offset-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.actualBoundingBox.combining-mark-offset.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/html/canvas/tools/generate-mark-origin-y-font.py:
 Added.
* Source/WebCore/platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::enclosingGlyphBoundsForTextRun):
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):

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



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

Reply via email to