[Cocoa] When accessibility bold is enabled, font-family:system-ui is supposed to be bold
Created attachment 454551 [details] Patch
<rdar://problem/88249241>
I ran the same command the bots ran (except with a debug build instead of a release build) and it reported: => Results: 100/100 tests passed (100.0%) 🤔
Hang on, the test didn't fail on iOS (which is the one platform with accessibility bold). I think I know what's happening.
Oh, USE(NON_VARIABLE_SYSTEM_FONT) is enabled on Big Sur. That explains it.
Created attachment 455557 [details] Patch
Created attachment 455561 [details] Patch
Created attachment 455613 [details] Patch
Committed r291846 (248858@main): <https://commits.webkit.org/248858@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 455613 [details].
Looks like this was reverted in bug 239323.
Patch was reverted - reopening.
After some internal deliberations, we think the right way to handle this is to do it in a way that is similar to the previous shipping way (when that worked) and not like accessibility font sizing. Accessibility font sizing makes applyValueFontSize() aware of the accessibility font sizes. However, we want to implement accessibility bold at a lower level (rather than applyValueFontWeight) because: 1. It's compatible with shipping behavior. getComputedStyle() reports a font weight of 400 when accessibility font sizes are enabled, so it would be nice if we could preserve that behavior 2. Accessibility bold needs to happen for all system fonts, even ones triggered by "font-family: system-ui". If we did this at the style resolution level, this would mean one property (font-family) would have an affect on another property (font-weight). We _do_ have precedent for this (where "font-family: monospace" affects the font-size property) but this precedent is generally considered a mistake and a wart on the web platform. 3. Accessibility bold is supposed to bolden just the characters/glyphs from the system font, not all characters/glyphs in the element. If the content said "font-family: someFont, system-ui" then if we did this at the CSS level, then either A) the whole element would get bold, even the glyphs coming from someFont, or B) none of the element would get bold, even the glyphs coming from the system font. Because of that logic, we're going to handle this inside preparePlatformFont() rather than in applyValueFontFamily.
Pull request: https://github.com/WebKit/WebKit/pull/1823
*** Bug 239364 has been marked as a duplicate of this bug. ***
*** Bug 239365 has been marked as a duplicate of this bug. ***
*** Bug 239367 has been marked as a duplicate of this bug. ***
*** Bug 239368 has been marked as a duplicate of this bug. ***
*** Bug 239369 has been marked as a duplicate of this bug. ***
*** Bug 239371 has been marked as a duplicate of this bug. ***
*** Bug 239373 has been marked as a duplicate of this bug. ***
*** Bug 239374 has been marked as a duplicate of this bug. ***
Committed 251883@main (3e3f9ab0f79b): <https://commits.webkit.org/251883@main> Reviewed commits have been landed. Closing PR #1823 and removing active labels.