RESOLVED FIXED Bug 195180
[css-values-4] Support font-relative lh and rlh unit
https://bugs.webkit.org/show_bug.cgi?id=195180
Summary [css-values-4] Support font-relative lh and rlh unit
Gérard Talbot (no longer involved)
Reported 2019-02-28 12:17:42 PST
CSS4 Values and Units, section 6.1.1 Font-relative lengths: the lh, rlh units https://www.w3.org/TR/css-values-4/#font-relative-lengths states " lh unit Equal to the computed value of the line-height property of the element on which it is used, converting normal to an absolute length by using only the metrics of the first available font. rlh unit Equal to the computed value of line-height property on the root element, converting normal to an absolute length as above. " Tests ----- http://w3c-test.org/css/css-values/lh-rlh-on-root-001.html http://w3c-test.org/css/css-values/lh-unit-001.html http://w3c-test.org/css/css-values/lh-unit-002.html Test results - - - - - - https://wpt.fyi/results/css/css-values?label=master So far, no browser pass these 3 tests. Correspondent Bugzilla Mozilla bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1310170
Attachments
Patch (42.57 KB, patch)
2020-04-04 15:14 PDT, Tyler Wilcock
no flags
Patch (42.74 KB, patch)
2020-04-04 15:42 PDT, Tyler Wilcock
no flags
Patch (45.63 KB, patch)
2020-04-04 20:29 PDT, Tyler Wilcock
no flags
Patch (45.62 KB, patch)
2020-04-04 21:44 PDT, Tyler Wilcock
no flags
Patch (45.64 KB, patch)
2020-04-04 23:00 PDT, Tyler Wilcock
no flags
Patch (45.66 KB, patch)
2020-04-06 22:03 PDT, Tyler Wilcock
no flags
Radar WebKit Bug Importer
Comment 1 2019-03-01 21:02:06 PST
Tyler Wilcock
Comment 2 2020-02-15 15:37:54 PST
Hi! Looks like there is a duplicate of this -- https://bugs.webkit.org/show_bug.cgi?id=204277.
Simon Fraser (smfr)
Comment 3 2020-02-17 10:34:22 PST
*** Bug 204277 has been marked as a duplicate of this bug. ***
Tyler Wilcock
Comment 4 2020-04-04 15:14:36 PDT
Tyler Wilcock
Comment 5 2020-04-04 15:18:09 PDT
Hello! This is my first patch -- hope I've done everything correct. I look forward to your review.
Tyler Wilcock
Comment 6 2020-04-04 15:42:46 PDT
Tyler Wilcock
Comment 7 2020-04-04 20:29:10 PDT
Tyler Wilcock
Comment 8 2020-04-04 21:44:26 PDT
Tyler Wilcock
Comment 9 2020-04-04 23:00:52 PDT
Tyler Wilcock
Comment 10 2020-04-05 10:12:12 PDT
Sorry for the churn — should be all set for review now.
Antti Koivisto
Comment 11 2020-04-06 10:41:13 PDT
Comment on attachment 395487 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395487&action=review Looks good! > Source/WebCore/css/CSSToLengthConversionData.h:44 > +enum class ComputingProperty { > + FontSize, > + LineHeight, > + OtherOrUnknown > +}; An alternative approach would be to use Optional<CSSPropertyID> instead of this (passing CSSPropertyFontSize/CSSPropertyLineHeight where appropriate). If you keep the enum it should move to CSSToLengthConversionData namespace. PropertyToCompute or just PropertyType might read better. > Source/WebCore/css/CSSToLengthConversionData.h:48 > + CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, const RenderStyle* parentStyle, const RenderView* renderView, float zoom, ComputingProperty computingProperty = ComputingProperty::OtherOrUnknown) 'computingProperty' is an awkward name for variables and fields too
Tyler Wilcock
Comment 12 2020-04-06 22:03:07 PDT
Tyler Wilcock
Comment 13 2020-04-06 23:14:19 PDT
Thanks for the suggestions, I've applied them in this new patch.
Antti Koivisto
Comment 14 2020-04-07 21:36:00 PDT
Thanks for the patch!
EWS
Comment 15 2020-04-07 21:45:50 PDT
Committed r259703: <https://trac.webkit.org/changeset/259703> All reviewed patches have been landed. Closing bug and clearing flags on attachment 395653 [details].
Simon Fraser (smfr)
Comment 16 2020-06-15 14:43:26 PDT
This was moved behind an off-by-default flag: https://bugs.webkit.org/show_bug.cgi?id=211356
Note You need to log in before you can comment on or make changes to this bug.