Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9deb9f6ab200aa86890e211eac3aa3ec946bd7d0
https://github.com/WebKit/WebKit/commit/9deb9f6ab200aa86890e211eac3aa3ec946bd7d0
Author: Ahmad Saleem <[email protected]>
Date: 2026-08-31 (Mon, 31 Aug 2026)
Changed paths:
M LayoutTests/TestExpectations
M Source/WebCore/rendering/BackgroundPainter.cpp
Log Message:
-----------
Near-zero fixed background-size collapses image tile to nothing
https://bugs.webkit.org/show_bug.cgi?id=283474
rdar://problem/140387662
Reviewed by Simon Fraser.
A background-image tiled at a very small fixed background-size (e.g.
`background-size: 0.2px 0.2px`) painted nothing instead of filling the
box. calculateFillTileSize() clamped non-zero percent/calculated tile
sizes up to at least one device pixel so they would still produce
content, but the fixed-length branches had no such clamp. A ~0.2px tile
then rounded down to zero during device-pixel snapping in
pixelSnapBackgroundImageGeometryForPainting(), leaving a zero-size tile
that paints no image.
Apply the same minimum-device-pixel floor to the fixed-length width and
height branches that the percent/calculated branches already use. A
non-zero fixed background-size now always produces at least a
one-device-pixel tile, while an explicit zero still resolves to an empty
tile.
This fixes the gradient, png, and svg near-zero background-size WPT
tests; the color case was already passing since it uses background-color
rather than image tiling.
* LayoutTests/TestExpectations: Unskip now passing tests
* Source/WebCore/rendering/BackgroundPainter.cpp:
(WebCore::BackgroundPainter::calculateFillTileSize):
Canonical link: https://commits.webkit.org/320169@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications