Skip to content

Text width cache returns incorrect widths when kerned and unkerned versions of a font are used repeatedly - #77426

Draft
weinig wants to merge 1 commit into
WebKit:mainfrom
weinig:eng/font-cascade-cache-key-kerning
Draft

weinig wants to merge 1 commit into
WebKit:mainfrom
weinig:eng/font-cascade-cache-key-kerning

Conversation

@weinig

@weinig weinig commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

565fe4e

Text width cache returns incorrect widths when kerned and unkerned versions of a font are used repeatedly
https://bugs.webkit.org/show_bug.cgi?id=327981

Reviewed by NOBODY (OOPS!).

Add kerning to FontCascadeCacheKey so each kerning setting gets its own
FontCascadeFonts.

Test: fast/text/font-kerning-width-cache.html

* LayoutTests/fast/text/font-kerning-width-cache-expected.txt: Added.
* LayoutTests/fast/text/font-kerning-width-cache.html: Added.
* Source/WebCore/platform/graphics/FontCascadeCache.cpp:
(WebCore::makeFontCascadeCacheKey):
* Source/WebCore/platform/graphics/FontCascadeCache.h:
(WebCore::add):

565fe4e

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 loading 🧪 api-mac ✅ 🧪 api-wpe
loading 🧪 ios-wk2-wpt ⏳ 🧪 api-mac-debug
⏳ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk3-gcc
✅ 🛠 ios-safer-cpp loading 🧪 mac-AS-debug-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-wk2-stress ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ⏳ 🧪 mac-intel-wk2 ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🛠 mac-safer-cpp ✅ 🛠 playstation
✅ 🛠 tv ✅ 🧪 mac-site-isolation
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

…rsions of a font are used repeatedly

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

Reviewed by NOBODY (OOPS!).

Add kerning to FontCascadeCacheKey so each kerning setting gets its own
FontCascadeFonts.

Test: fast/text/font-kerning-width-cache.html

* LayoutTests/fast/text/font-kerning-width-cache-expected.txt: Added.
* LayoutTests/fast/text/font-kerning-width-cache.html: Added.
* Source/WebCore/platform/graphics/FontCascadeCache.cpp:
(WebCore::makeFontCascadeCacheKey):
* Source/WebCore/platform/graphics/FontCascadeCache.h:
(WebCore::add):
@weinig weinig self-assigned this Oct 18, 2026
@weinig weinig added the Text For bugs in text layout and rendering, including international text support. label Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Text For bugs in text layout and rendering, including international text support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants