Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4a04a6e57b9fec788b0b26fbfd601125906108c9
https://github.com/WebKit/WebKit/commit/4a04a6e57b9fec788b0b26fbfd601125906108c9
Author: Gerald Squelart <[email protected]>
Date: 2026-07-15 (Wed, 15 Jul 2026)
Changed paths:
A LayoutTests/fast/canvas/fillText-maxWidth-edge-clip-expected.html
A LayoutTests/fast/canvas/fillText-maxWidth-edge-clip.html
M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
Log Message:
-----------
Canvas drawTextUnchecked does't always draw when using maxWidth
https://bugs.webkit.org/show_bug.cgi?id=319455
rdar://179479689
Reviewed by Mike Wyrzykowski.
When a `maxWidth` is provided, and is smaller than the actual text width,
the text is shrunk by translating and scaling the context.
However the computed `textRect` is not changed accordingly, so its
intersection with the updated context clip is now incorrect, leading to
some texts not being drawn at all.
The fix here is never to optimize out `maxWidth`-shortened texts.
* LayoutTests/fast/canvas/fillText-maxWidth-edge-clip-expected.html: Added.
* LayoutTests/fast/canvas/fillText-maxWidth-edge-clip.html: Added.
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawTextUnchecked):
Canonical link: https://commits.webkit.org/317260@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications