| Summary: | baseline-shift property does not allow inheritance of numerical values | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | fantasai.bugs, karlcow, ntim, sabouhallawa, webkit-bug-importer, zimmermann |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=269878 | ||
|
Description
Ahmad Saleem
2023-01-02 15:42:48 PST
Took updated copy of test and changed it into JSfiddle - https://jsfiddle.net/5oL8uzfs/show ^ Chrome Canary 113 passes all, while WebKit ToT (261835@main) fails two: >>> Inheritance of the baseline-shift property, baseline. >>> Inheritance of the baseline-shift property, 100%. ________________________ Just wanted to update. Thanks! Do we need to push this bit of 'BaselineShiftValue" to above "inherited" flags? https://searchfox.org/wubkat/source/Source/WebCore/rendering/style/SVGRenderStyle.cpp#171 Plus I think here - https://searchfox.org/wubkat/source/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp#56 baselineshift::Length: We are returning 'default' of '0' rather than percentage value? But at the same time, the length type of percentage is dealt here, if I am reading this bit correctly: https://searchfox.org/wubkat/source/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp#42 Confused... We kind of already have this: https://searchfox.org/wubkat/source/Source/WebCore/style/StyleBuilderCustom.h#1141 and did: auto baselineShift = svgParentStyle.baselineShift(); if (baselineShift == BaselineShift::Length) svgStyle.setBaselineShiftValue(forwardInheritedValue(svgParentStyle.baselineShiftValue())); _____ and it does not progress this testcase but when I look into WPT for 'baseline-shift' coverage, we are doing better than Blink. https://wpt.fyi/results/?label=master&label=experimental&aligned=&q=baseline-shift Now back to investigation board. :-) _____ @Karl & @Tim - any input would be welcome. :-) We are passing all WPT here: https://wpt.fyi/results/css?label=master&label=experimental&aligned=&q=baseline-shift The spec says https://drafts.csswg.org/css-inline/#propdef-baseline-shift > Percentages: refer to the used value of line-height > Computed value: the specified keyword or a computed <length-percentage> value The test case in the JS fiddle is data:text/html,<svg height="0" style="baseline-shift: 100%;"><text></text></svg> and window.getComputedStyle(document.getElementsByTagName('svg')[0]).baselineShift returns: 0px in Safari undefined in Firefox 100% in Chrome line-height value in that test case is: `normal` If I set the height to something different than 0. data:text/html,<svg height="10" style="baseline-shift: 100%;"><text></text></svg> 212.249863px in Safari undefined in Firefox 100% in Chrome To me, WebKit does the right thing as it returns the computed <length-percentage> value, defined in https://drafts.csswg.org/css-values-4/#typedef-length-percentage > <length-percentage> > Equivalent to [ <length> | <percentage> ], where the <percentage> will resolve to a <length>. But Elika will probably know better. Chrome Canary 121 passes all test: https://jsfiddle.net/tfn035qm/show and Safari Technology Preview 182 fails first and last test. |