Open the following svg <svg xmlns="http://www.w3.org/2000/svg"> <line x1="0" y1="200" x2="100%" y2="200" style="stroke:rgb(255,0,0);stroke-width:1" /> <text x="20" y="200" dominant-baseline="central" font-size="50px"> foo<tspan>bar </tspan><tspan>baz</tspan> </text> </svg> Result: The first word "foo" is the only text which is rendered with alignment equal to "central". The rest of the text in the <tspan> tags is rendered with alignment equal to "alphabetic". The w3c specs http://www.w3.org/TR/SVG/text.html says about the value "auto" of the dominant-baseline, which is the default: "If this property occurs on a ‘tspan’, ‘tref’, ‘altGlyph’ or ‘textPath’ element, then the dominant-baseline and the baseline-table components remain the same as those of the parent text content element." So it is expected to have all the text in the <tspan> tags in the svg above to be rendered with the same alignment as the parent text content element's alignment.
Created attachment 242573 [details] result
Created attachment 242574 [details] expected
<rdar://problem/19144671>
dominant-baseline should be inherited in SVG 2, so this is an SVG 2 improvement, which would be welcome in webkit. It *is* inherited in the latest version of Chrome and Firefox. See https://www.fxsitecompat.dev/en-CA/docs/2019/dominant-baseline-is-now-inherited-from-its-parent-element/
https://src.chromium.org/viewvc/blink?view=revision&revision=199970 ^ This makes us pass following test case - https://jsfiddle.net/azLe745x/ but it regresses following: imported/w3c/web-platform-tests/svg/styling/presentation-attributes-irrelevant.html imported/w3c/web-platform-tests/svg/styling/presentation-attributes-relevant.html imported/w3c/web-platform-tests/svg/styling/presentation-attributes-unknown.html With following failing: dominant-baseline presentation attribute supported on a irrelevant element dominant-baseline presentation attribute supported on a relevant element dominant-baseline presentation attribute supported on an unknown SVG element
(In reply to Ahmad Saleem from comment #5) > https://src.chromium.org/viewvc/blink?view=revision&revision=199970 > > ^ This makes us pass following test case - https://jsfiddle.net/azLe745x/ > > but it regresses following: > > imported/w3c/web-platform-tests/svg/styling/presentation-attributes- > irrelevant.html > imported/w3c/web-platform-tests/svg/styling/presentation-attributes-relevant. > html > imported/w3c/web-platform-tests/svg/styling/presentation-attributes-unknown. > html > > With following failing: > > dominant-baseline presentation attribute supported on a irrelevant element > dominant-baseline presentation attribute supported on a relevant element > dominant-baseline presentation attribute supported on an unknown SVG element Running these tests directly from WPT on Minibrowser where I have Blink patch merged does not show them failing when I do merge. :-( I do have other SVG patches, which can mess with my internal build, so I think I can try doing draft PR. Any suggestion?
Committed 265525@main (0ed9d940afc3): <https://commits.webkit.org/265525@main> Reviewed commits have been landed. Closing PR #14833 and removing active labels.
*** Bug 249085 has been marked as a duplicate of this bug. ***
*** Bug 217564 has been marked as a duplicate of this bug. ***
Re-opened since this is blocked by bug 259335