RESOLVED FIXED319846
Consistently use Ref instead of RefPtr for non-null GlyphBuffer::fontAt() results
https://bugs.webkit.org/show_bug.cgi?id=319846
Summary Consistently use Ref instead of RefPtr for non-null GlyphBuffer::fontAt() res...
David Kilzer (:ddkilzer)
Reported 2026-07-20 14:14:23 PDT
`GlyphBuffer::fontAt()` returns a reference obtained by dereferencing a `SingleThreadWeakPtr<const Font>`, whose `operator*` does a `RELEASE_ASSERT()` that the font is live, so `fontAt()` never returns nullptr. `FontCascade::drawGlyphBuffer()` nonetheless stores that result in a nullable `RefPtr<const Font>`, which overstates the nullability of a value that is never nullptr. The debug-only `WebCore::operator<<(TextStream&, const GlyphBuffer&)` function additionally keeps the bare `const Font&` from `fontAt()` in a local across a call to the non-trivial `boundsForGlyph()`, borrowing from a weak pointer instead of holding an owning reference on the stack.
Attachments
Radar WebKit Bug Importer
Comment 1 2026-07-20 14:14:34 PDT
David Kilzer (:ddkilzer)
Comment 2 2026-07-20 16:26:24 PDT
EWS
Comment 3 2026-07-20 18:56:09 PDT
Committed 317589@main (1fd2cd726bd5): <https://commits.webkit.org/317589@main> Reviewed commits have been landed. Closing PR #69816 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.