[Webkit-unassigned] [Bug 204276] Implement the 'ic' unit from CSS Values 4

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 24 16:33:54 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=204276

--- Comment #28 from Kiet Ho <tho22 at apple.com> ---
Comment on attachment 439128
  --> https://bugs.webkit.org/attachment.cgi?id=439128
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=439128&action=review

>>>>> Source/WebCore/platform/graphics/FontMetrics.h:173
>>>>> +    std::optional<float> m_ideogramWidth;
>>>> 
>>>> Why is this an optional? Why not have platformGlyphInit() implement the fallback behavior, rather than computeUnzoomedNonCalcLengthDouble() implement the fallback behavior?
>>> 
>>> I just feel like Font should truthfully indicate whether the ideogram width is available or not, so its users can make the correct decision. Right now computeUnzoomedNonCalcLengthDouble() falls back to 1em, but maybe in the future some other code might want to use m_ideogramWidth for something else?
>> 
>> That doesn't make any sense to me. The spec dictates a particular fallback behavior. There is one client, which implements the fallback behavior. Storing an optional stores an unnecessary extra 4 bytes per font.
>> 
>> If there were multiple clients who wanted different behavior here, that would make sense. But there isn't, so better to save those 4 bytes.
> 
> I agree, I'll fix it as you said.

I don't think it's possible to implement the fallback behavior inside Font/FontMetrics, because the fallback metric (1em) comes from FontCascadeDescription.m_specifiedSize, which depends on whatever font size being specified in CSS. This is not available when the Font is initialized.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210924/cea31e7b/attachment.htm>


More information about the webkit-unassigned mailing list