Bug 218812

Summary: Font::platformBoundsForGlyph() should provide a boundingRect pointer to CTFontGetBoundingRectsForGlyphs()
Product: WebKit Reporter: Julian Gonzalez <julian_a_gonzalez>
Component: TextAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, koivisto, mmaxfield, rniwa, simon.fraser, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Julian Gonzalez 2020-11-11 11:02:22 PST
Pass a pointer to a stack-allocated boundingRect to CTFontGetBoundingRectsForGlyphs() in Font::platformBoundsForGlyph().

Also take a look at Font::isProbablyOnlyUsedToRenderIcons(), as it has the same issue.

<rdar://problem/70738704>
Comment 1 Julian Gonzalez 2020-11-11 11:30:04 PST
Created attachment 413843 [details]
Patch
Comment 2 EWS 2020-11-15 00:56:45 PST
Committed r269823: <https://trac.webkit.org/changeset/269823>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 413843 [details].
Comment 3 Darin Adler 2020-11-15 15:52:39 PST
Comment on attachment 413843 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        Provide a zero CGRect boundingRect pointer in two places where the count argument
> +        to CTFontGetBoundingRectsForGlyphs() is already 1.

The code below provides an *uninitialized* CGRect, not a zero CGRect. Do we need a zero CGRect?
Comment 4 Julian Gonzalez 2020-11-18 10:59:06 PST
Good catch, it is just a plain struct. I will add code to zero this.