Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: acc0cf0ddb65b83a6b4ea2a715e13e7678b83a41
https://github.com/WebKit/WebKit/commit/acc0cf0ddb65b83a6b4ea2a715e13e7678b83a41
Author: Vitor Roriz <[email protected]>
Date: 2026-03-17 (Tue, 17 Mar 2026)
Changed paths:
M Source/WebCore/platform/graphics/WidthIterator.cpp
Log Message:
-----------
WidthIterator::advanceInternal: Stop consuming the first character twice
https://bugs.webkit.org/show_bug.cgi?id=274483
rdar://128492167
Reviewed by Sammy Gill.
The pre-loop block consumed the first character to initialize font range
state, then the loop consumed it again to process it. This wasted an
expensive glyphDataForCharacter() call. The only reason for that it is
because we detect font changes for deciding when to commit to a glyph buffer.
However, it is easy to identify a font change coming from initialization.
Therefore we can remove the pre-loop block and add an early return in
commitCurrentFontRange() for empty ranges so the first-iteration
font transition is a safe no-op.
* Source/WebCore/platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::commitCurrentFontRange):
(WebCore::WidthIterator::advanceInternal):
Canonical link: https://commits.webkit.org/309437@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications