Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bb5b3e0e809d3a5eec63d6016a1e89bfd027f9d4
https://github.com/WebKit/WebKit/commit/bb5b3e0e809d3a5eec63d6016a1e89bfd027f9d4
Author: Alan Baradlay <[email protected]>
Date: 2026-07-15 (Wed, 15 Jul 2026)
Changed paths:
M LayoutTests/TestExpectations
A
LayoutTests/css3/text-decoration/text-decoration-inset-auto-cjk-expected.html
A LayoutTests/css3/text-decoration/text-decoration-inset-auto-cjk.html
A
LayoutTests/css3/text-decoration/text-decoration-inset-box-decoration-break-expected-mismatch.html
A
LayoutTests/css3/text-decoration/text-decoration-inset-box-decoration-break.html
M
LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-inset-computed-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-inset-valid-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-008.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-auto-expected-mismatch.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-auto.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-bidi-seam-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-bidi-seam.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-line-through-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-line-through.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-marked-text-gap-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-marked-text-gap.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-negative-expected-mismatch.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-negative.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-not-inherited-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-not-inherited.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-one-value-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-one-value.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-overline-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-overline.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-trims-underline-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-trims-underline-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-trims-underline.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-zero-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-zero.html
M
LayoutTests/imported/w3c/web-platform-tests/html/rendering/widgets/shadow-dom-expected.txt
M
LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt
M LayoutTests/platform/ios/TestExpectations
M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
M Source/WebCore/Headers.cmake
M Source/WebCore/Sources.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/css/CSSProperties.json
M Source/WebCore/rendering/TextBoxPainter.cpp
M Source/WebCore/rendering/TextBoxPainter.h
M Source/WebCore/rendering/TextDecorationPainter.cpp
M Source/WebCore/rendering/TextDecorationPainter.h
M Source/WebCore/style/InlineTextBoxStyle.cpp
M Source/WebCore/style/PropertyAllowlist.cpp
M Source/WebCore/style/StyleDifference.cpp
M Source/WebCore/style/computed/StyleComputedStyleBase.h
M Source/WebCore/style/computed/data/StyleNonInheritedRareData.cpp
M Source/WebCore/style/computed/data/StyleNonInheritedRareData.h
A Source/WebCore/style/values/text-decoration/StyleTextDecorationInset.cpp
A Source/WebCore/style/values/text-decoration/StyleTextDecorationInset.h
Log Message:
-----------
[css-text-decor-4] Implement the text-decoration-inset property
https://bugs.webkit.org/show_bug.cgi?id=319178
<rdar://problem/182019037>
Reviewed by Antti Koivisto.
Add the CSS Text Decoration Level 4 'text-decoration-inset' property
(auto | <length>{1,2}), gated behind the cssTextDecorationInsetEnabled setting.
The property adjusts the start and end endpoints of the line decorations drawn
by
a decorating box (underline, overline, line-through). A positive <length> moves
an endpoint inward, trimming the decoration; a negative <length> moves it
outward,
extending it. A single value applies to both endpoints; two values are the start
and the end. 'auto' lets the UA choose an inset so that two adjacent identical
underlined elements do not appear to share a single continuous underline (e.g.
for Chinese, where underlining is a form of punctuation); it is distinct from 0.
1. It is stored as a new Style::TextDecorationInset value type (a
keyword-or-length-
pair) in NonInheritedRareData, parsed grammar-driven, and animated by computed
value.
2. The inset is applied at paint time in TextBoxPainter, which shifts the
decoration's inline origin and shrinks/grows its length (because
text-decoration-
inset and box-decoration-break are not inherited, a decoration that propagates
from an ancestor box down to the (root inline) box that paints it)
3. box-decoration-break is then honored via the inline box's closed edges: with
'slice' the start
inset only affects the first fragment's start edge and the end inset the last
fragment's end edge; with 'clone' both edges of every fragment are inset.
4. Endpoints are also gated on the marked-text piece that actually reaches the
box's
logical start/end, so a decoration split into several marked texts (selection,
document markers, highlights) stays continuous instead of being trimmed at the
interior boundaries.
5. Because a negative inset extends the decoration past the text
box, decoration ink overflow is expanded by the outward amount, and
StyleDifference
treats an inset change as affecting repaint and visual overflow so
dynamic/animated
changes invalidate correctly.
Horizontal and vertical writing modes (including sideways-rl/lr and orthogonal
blocks), in both inline directions, are supported, as is the
text-decoration-skip-
ink interaction (its skip gaps are measured against the underline's bounding
box,
which already tracks the inset-shifted origin, so they stay aligned to the
glyphs).
Across a bidi direction boundary the decoration is painted one segment per run;
the
component of the inset that shifts the decoration as a whole is applied to every
segment (so the seam between runs moves with it rather than being pinned),
while the
extend/trim overhang is applied only at the segment reaching the decoration's
visual
start/end.
* LayoutTests/TestExpectations: Un-skip the now-passing upstream WPT conformance
tests (text-decoration-inset-001..008, 010..013, 015..024, and
orthogonal-block-001); 009/014 (sub-pixel endpoint rounding) and the unrelated
025
(multicol) remain ImageOnlyFailure on follow-up bugs.
* LayoutTests/platform/ios/TestExpectations: Mark
text-decoration-inset-marked-text-gap
WontFix on iOS - it splits the decoration with a ::selection color, but iOS
draws
selection via UIKit and does not paint ::selection styling, so the reference
(which
uses a <span>) cannot match.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-inset-computed-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-inset-valid-expected.txt:
Rebaseline the upstream parsing tests, which still carried the
pre-implementation "not supported" baseline.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: Add
CSSTextDecorationInsetEnabled.
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj: Build
StyleTextDecorationInset.
* Source/WebCore/css/CSSProperties.json: Add the text-decoration-inset property.
* Source/WebCore/rendering/TextBoxPainter.cpp:
(WebCore::autoTextDecorationInset):
(WebCore::TextBoxPainter::insetAdjustedDecorationLocationAndWidth): Apply the
inset (and box-decoration-break) carried on the decoration styles to the
decoration
geometry, honoring box-decoration-break and marked-text sub-ranges.
(WebCore::TextBoxPainter::paintBackgroundDecorations):
(WebCore::TextBoxPainter::paintForegroundDecorations):
(WebCore::TextBoxPainter::insetAdjustedDecorationLocationAndWidth const):
* Source/WebCore/rendering/TextBoxPainter.h:
* Source/WebCore/rendering/TextDecorationPainter.cpp:
(WebCore::collectStylesForRenderer): Also resolve the non-inherited
text-decoration-inset and box-decoration-break from the box that introduces the
decoration, alongside its color/thickness/style.
(WebCore::TextDecorationPainter::Styles::operator==):
(WebCore::TextDecorationPainter::Styles::operator== const):
* Source/WebCore/rendering/TextDecorationPainter.h: Carry the resolved inset and
box-decoration-break on Styles.
* Source/WebCore/style/InlineTextBoxStyle.cpp:
(WebCore::computedInkOverflowForDecorations): Expand ink overflow for a negative
(outward) inset.
* Source/WebCore/style/PropertyAllowlist.cpp: Allow text-decoration-inset in the
(WebCore::Style::isValidHighlightStyleProperty):
(WebCore::Style::isValidCueStyleProperty):
(WebCore::Style::isValidCueSelectorStyleProperty):
highlight and cue property allowlists.
* Source/WebCore/style/StyleDifference.cpp:
(WebCore::...::changeAffectsVisualOverflow):
(WebCore::...::rareDataChangeRequiresRepaint): Repaint/recompute overflow when
the inset changes.
* Source/WebCore/style/computed/data/StyleNonInheritedRareData.cpp:
(WebCore::Style::NonInheritedRareData::NonInheritedRareData):
(WebCore::Style::NonInheritedRareData::operator== const):
(WebCore::Style::NonInheritedRareData::dumpDifferences const):
* Source/WebCore/style/computed/data/StyleNonInheritedRareData.h: Store the
inset.
* Source/WebCore/style/computed/StyleComputedStyleBase.h:
*
LayoutTests/imported/w3c/web-platform-tests/html/rendering/widgets/shadow-dom-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-008.html:
*
LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-auto-expected-mismatch.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-auto.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-line-through-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-line-through.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-marked-text-gap-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-marked-text-gap.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-negative-expected-mismatch.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-negative.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-not-inherited-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-not-inherited.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-one-value-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-one-value.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-overline-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-overline.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-trims-underline-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-trims-underline-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-trims-underline.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-zero-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-zero.html:
Added.
* Source/WebCore/style/values/text-decoration/StyleTextDecorationInset.cpp:
Added.
(WebCore::Style::TextDecorationInset::resolvedStart const):
(WebCore::Style::TextDecorationInset::resolvedEnd const):
(WebCore::Style::CSSValueConversion<TextDecorationInsetPair>::operator):
* Source/WebCore/style/values/text-decoration/StyleTextDecorationInset.h: Added.
(WTF::MarkableTraits<WebCore::Style::TextDecorationInsetPair>::isEmptyValue):
(WTF::MarkableTraits<WebCore::Style::TextDecorationInsetPair>::emptyValue):
(WebCore::Style::TextDecorationInset::TextDecorationInset):
(WebCore::Style::TextDecorationInset::isAuto const):
*
LayoutTests/css3/text-decoration/text-decoration-inset-auto-cjk-expected.html:
Added.
* LayoutTests/css3/text-decoration/text-decoration-inset-auto-cjk.html: Added.
*
LayoutTests/css3/text-decoration/text-decoration-inset-box-decoration-break-expected-mismatch.html:
Added.
*
LayoutTests/css3/text-decoration/text-decoration-inset-box-decoration-break.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-bidi-seam-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-inset-bidi-seam.html:
Added.
Canonical link: https://commits.webkit.org/317230@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications