shape-outside image drops an above-threshold run that starts in the last column
https://bugs.webkit.org/show_bug.cgi?id=326241 rdar://189116534 Reviewed by Simon Fraser. This patch aligns WebKit with Gecko / Firefox and Blink / Chromium. LayoutShape::createRasterShapeImpl() scans each row of the shape image and builds intervals from runs of pixels whose alpha is above the threshold. A run was only emitted from the else-if branch, which also handled the last column. When the run started on the last column, the first branch opened it and the else-if never ran, so the loop ended without emitting the run. As a result, a 1px wide shape image had an empty shape, and a single above-threshold pixel in the last column was ignored, in both horizontal and vertical writing modes. Fix this by emitting any run that is still open after the row loop ends, and remove the last-column special case from the else-if. Test: imported/w3c/web-platform-tests/css/css-shapes/shape-outside/shape-image/gradients/shape-outside-linear-gradient-last-column.html * LayoutTests/imported/w3c/web-platform-tests/css/css-shapes/shape-outside/shape-image/gradients/shape-outside-linear-gradient-last-column-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-shapes/shape-outside/shape-image/gradients/shape-outside-linear-gradient-last-column.html: Added. * Source/WebCore/rendering/shapes/LayoutShape.cpp: (WebCore::LayoutShape::createRasterShapeImpl): Canonical link: https://commits.webkit.org/322756@main
A
Ahmad Saleem committed
e949c6fb5f901a9fcbc9a7af89434e6ce23ea578
Parent: b463838
Committed by Ahmad Saleem <ahmad.saleem792@gmail.com>
on 10/5/2026, 7:33:04 PM