Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e949c6fb5f901a9fcbc9a7af89434e6ce23ea578
      
https://github.com/WebKit/WebKit/commit/e949c6fb5f901a9fcbc9a7af89434e6ce23ea578
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-10-05 (Mon, 05 Oct 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-shapes/shape-outside/shape-image/gradients/shape-outside-linear-gradient-last-column-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-shapes/shape-outside/shape-image/gradients/shape-outside-linear-gradient-last-column.html
    M Source/WebCore/rendering/shapes/LayoutShape.cpp

  Log Message:
  -----------
  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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to