Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 68d3bd351bbf4df2d7ac0dd477d4093f5410eb5c
https://github.com/WebKit/WebKit/commit/68d3bd351bbf4df2d7ac0dd477d4093f5410eb5c
Author: Karl Dubost <[email protected]>
Date: 2026-08-20 (Thu, 20 Aug 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/svg/styling/presentation-attributes-irrelevant-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/svg/styling/presentation-attributes-relevant-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/svg/styling/presentation-attributes-unknown-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/svg/styling/text-overflow-presentation-attribute-foreignobject-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/svg/styling/text-overflow-presentation-attribute-foreignobject-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/svg/styling/text-overflow-presentation-attribute-foreignobject.html
M Source/WebCore/svg/SVGElement.cpp
M Source/WebCore/svg/svgattrs.in
Log Message:
-----------
text-overflow should be supported as an SVG presentation attribute
https://bugs.webkit.org/show_bug.cgi?id=313374
rdar://176146717
Reviewed by Nikolas Zimmermann.
SVG 2 lists text-overflow among the presentation attributes that apply to any
element in the SVG namespace, so <text text-overflow="ellipsis"> in markup
should
set the CSS property, the way fill and text-anchor already do. WebKit drops the
attribute before it reaches style: cssPropertyIdForSVGAttributeName() has no
case
for it, and svgattrs.in does not carry the name at all.
Fix by adding both. The visible effect is narrow but real. foreignObject takes
overflow
hidden from the SVG UA stylesheet and lays out its children with CSS, so
<foreignObject text-overflow="ellipsis"> ellipsizes an overflowing line where
the
attribute used to be inert, with no style sheet involved. On SVG text nothing
renders
differently, because SVG 2 gives text-overflow an effect only where the text
element has
a wrapping area, and neither inline-size nor shape-inside is implemented in any
engine.
white-space, the other attribute named in this bug, is left for bug 293213: the
same treatment there would fight the existing xml:space presentational hint, and
which one won would depend on the order the two attributes appear in.
Add a reftest for the foreignObject case, since the existing upstream coverage
only
reads getComputedStyle and would not notice whether the value reaches the
paint. The
test sets the attribute and the reference sets the same value in CSS, so the
two differ
only in how the property arrives. Before the fix the test renders a hard cut
and the
reference an ellipsis; after it they match.
*
LayoutTests/imported/w3c/web-platform-tests/svg/styling/presentation-attributes-irrelevant-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/svg/styling/presentation-attributes-relevant-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/svg/styling/presentation-attributes-unknown-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/svg/styling/text-overflow-presentation-attribute-foreignobject-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/svg/styling/text-overflow-presentation-attribute-foreignobject-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/svg/styling/text-overflow-presentation-attribute-foreignobject.html:
Added.
* Source/WebCore/svg/SVGElement.cpp:
(WebCore::SVGElement::cssPropertyIdForSVGAttributeName const):
* Source/WebCore/svg/svgattrs.in:
Canonical link: https://commits.webkit.org/319563@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications