Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c64b47e336944e9e3b62964c2eb0ee90a74c23e4
      
https://github.com/WebKit/WebKit/commit/c64b47e336944e9e3b62964c2eb0ee90a74c23e4
  Author: Sam Weinig <[email protected]>
  Date:   2026-08-12 (Wed, 12 Aug 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/using-font-relative-units-in-font-properties-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/using-font-relative-units-in-font-properties.html
    M Source/WebCore/css/CSSToLengthConversionData.h
    M Source/WebCore/style/StyleBuilder.cpp
    M Source/WebCore/style/StyleBuilderCustom.h
    M Source/WebCore/style/StyleBuilderState.h
    M Source/WebCore/style/values/inline/StyleLineHeight.cpp
    M Source/WebCore/style/values/primitives/StyleLengthResolution.cpp

  Log Message:
  -----------
  font-* properties should use the metrics of the parent element's font for 
font-relative unit resolution
https://bugs.webkit.org/show_bug.cgi?id=320744

Reviewed by Antti Koivisto.

Updates length conversion to check for all `font-*` properties, not just 
`font-size`
when deciding which font metrics to use for font-relative units.

The spec is a bit unclear on which properties this should really cover with 
discussion
happening in https://github.com/w3c/csswg-drafts/issues/14306.

To allow length conversion to check for all the `font-*` properties, we now 
always
set the CSSPropertyID in CSSToLengthConversionData to the property that is 
currently
being applied via a new BuilderStatePropertyScope class. Due to always setting 
the
property, we can remove `copyForFontSize()` and `copyForLineHeight()`.

Test: 
imported/w3c/web-platform-tests/css/css-values/using-font-relative-units-in-font-properties.html
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/using-font-relative-units-in-font-properties-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/using-font-relative-units-in-font-properties.html:
 Added.
* Source/WebCore/css/CSSToLengthConversionData.h:
* Source/WebCore/style/StyleBuilder.cpp:
* Source/WebCore/style/StyleBuilderCustom.h:
* Source/WebCore/style/StyleBuilderState.h:
* Source/WebCore/style/values/inline/StyleLineHeight.cpp:
* Source/WebCore/style/values/primitives/StyleLengthResolution.cpp:

Canonical link: https://commits.webkit.org/319052@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to