Page MenuHomePhabricator

Bug 1962602 - Give gfxFontGroup::GetMetricsForCSSUnits flags to control whether it should load extra font resources to measure the ZERO or WATER IDEOGRAPH characters. r=#style
ClosedPublic

Authored by jfkthame on Apr 25 2025, 5:03 PM.
Referenced Files
Unknown Object (File)
Oct 13 2025, 9:18 AM
Unknown Object (File)
Oct 13 2025, 12:18 AM
Unknown Object (File)
Jun 25 2025, 10:56 AM
Unknown Object (File)
Jun 23 2025, 12:17 AM
Unknown Object (File)
May 23 2025, 11:50 PM
Unknown Object (File)
May 4 2025, 10:30 PM
Subscribers

Details

Summary

This makes the style system pass flags down to GetMetricsForCSSUnits to specify
whether it needs the 'ch' or 'ic' units, which may trigger downloading additional
font resources.

There should be no change in user-visible behavior, except by observing (e.g. in
the devtools network panel) what resources end up being fetched in an example
like the reporter's.

Diff Detail

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
emilio added inline comments.
layout/style/GeckoBindings.cpp
1306

Same here.

1312

I don't think you need the explicit bool() if it's in a conditional fwiw.

servo/components/style/values/computed/font.rs
806

Maybe just pass the flags directly? Or is that not possible for some reason?

servo/components/style/values/computed/mod.rs
367

just mut flags: QueryFontMetricsFlags then remove the let mut flags = flags; below.

jfkthame added inline comments.
layout/style/GeckoBindings.cpp
1306

The compiler insists on this one, actually.

servo/components/style/values/computed/font.rs
806

Yeah, will do. (Originally I started just adding individual bools everywhere, and this was left-over from that.)

jfkthame marked an inline comment as done.
This revision is now accepted and ready to land.Apr 26 2025, 4:19 PM