Bug 238982

Summary: Resolve logical viewport units properly in font-size
Product: WebKit Reporter: Emilio Cobos Álvarez (:emilio) <emilio>
Component: CSSAssignee: Tim Nguyen (:ntim) <ntim>
Status: RESOLVED FIXED    
Severity: Normal CC: koivisto, mmaxfield, ntim, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Emilio Cobos Álvarez (:emilio) 2022-04-07 21:47:54 PDT
Now that we have writing-mode relative units relative to the element style (both for both container-queries and viewport) it's not enough to have two groups of properties (high-priority / others), since font-size depends on writing-mode.

https://bug1763750.bmoattachments.org/attachment.cgi?id=9271418 is an example of a test-case that Firefox gets wrong once we implement these in https://bugzilla.mozilla.org/show_bug.cgi?id=1610815 (and I'll fix soon after that lands).

I guess WebKit's behavior hasn't been updated to depend on the writing-mode of the element itself and it seems relative to the root style: https://webkit-search.igalia.com/webkit/rev/3bf802d5a84565f2dc7e50dacf561e366bf1c147/Source/WebCore/css/CSSPrimitiveValue.cpp#888, but once you do, you'd need to handle writing-mode-dependent properties explicitly in the cascade before font-size.
Comment 1 Myles C. Maxfield 2022-04-08 15:20:26 PDT
So the vi unit is dependent on writing mode, and font-size can depend on vi units, and the em unit depends on font-size, and other properties can depend on em units...
Comment 2 Emilio Cobos Álvarez (:emilio) 2022-04-10 03:48:17 PDT
Yes, but the font-relative units on font-size resolve against the parent style, so I _think_ there's no real cycle per spec (yet...)
Comment 3 Radar WebKit Bug Importer 2022-04-14 21:48:15 PDT
<rdar://problem/91795163>
Comment 4 Tim Nguyen (:ntim) 2022-08-03 09:35:55 PDT
Pull request: https://github.com/WebKit/WebKit/pull/2980
Comment 5 EWS 2022-08-03 14:37:41 PDT
Committed 253087@main (5cd7506926c2): <https://commits.webkit.org/253087@main>

Reviewed commits have been landed. Closing PR #2980 and removing active labels.