Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: faf7938c4d49932e182784d482b938ff841b2f4a
      
https://github.com/WebKit/WebKit/commit/faf7938c4d49932e182784d482b938ff841b2f4a
  Author: Simon Fraser <[email protected]>
  Date:   2026-01-05 (Mon, 05 Jan 2026)

  Changed paths:
    A 
LayoutTests/fast/backgrounds/background-clip-border-area-and-blend-mode-expected.html
    A 
LayoutTests/fast/backgrounds/background-clip-border-area-and-blend-mode.html
    A 
LayoutTests/fast/backgrounds/background-clip-text-and-blend-mode-expected.html
    A LayoutTests/fast/backgrounds/background-clip-text-and-blend-mode.html
    M LayoutTests/fast/backgrounds/background-clip-text.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-clip-border-area-and-blend-mode-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-clip-border-area-and-blend-mode.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-clip-text-and-blend-mode-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-clip-text-and-blend-mode.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/reference/background-clip-border-area-and-blend-mode-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/reference/background-clip-text-and-blend-mode-ref.html
    M LayoutTests/platform/glib/TestExpectations
    M 
LayoutTests/platform/glib/fast/backgrounds/background-clip-text-expected.txt
    M 
LayoutTests/platform/ios/fast/backgrounds/background-clip-text-expected.txt
    M 
LayoutTests/platform/mac/fast/backgrounds/background-clip-text-expected.txt
    M LayoutTests/platform/wpe/TestExpectations
    M Source/WebCore/platform/graphics/Image.cpp
    M Source/WebCore/rendering/BackgroundPainter.cpp

  Log Message:
  -----------
  `background-blend-mode` not applied when a layer has `background-clip: text`
rdar://120901898
https://bugs.webkit.org/show_bug.cgi?id=267129

Reviewed by Alan Baradlay.

When `background-clip: text` is combined with `background-blend-mode`, we have 
to take
care to set the blend mode for the correct drawing operation. Currently it was 
set
for the paint of the background image. However, when combined with 
`background-clip: text`,
we need to set the blend mode when the transparency layer is composited, which 
means
setting it before we start the transparency layer used for clipping to text, 
with one
exception. The last layer (which composites over the background color) is 
special,
since that background color paint happens inside the transparency layer.

Tests initially failed on iOS, which revealed that the iOS-specific code path
(which we really need to test and remove) clobbered the blendMode, so fix that.

Added WPT for the combinations of background-blend-mode and background-clip: 
text/border-area.

The internal tests exercise specific code paths on iOS triggered by the image 
sizes, so
keep them in addition to the WPT.

Tests: fast/backgrounds/background-clip-border-area-and-blend-mode.html
       fast/backgrounds/background-clip-text-and-blend-mode.html
       
imported/w3c/web-platform-tests/css/css-backgrounds/background-clip-border-area-and-blend-mode.html
       
imported/w3c/web-platform-tests/css/css-backgrounds/background-clip-text-and-blend-mode.html
       
imported/w3c/web-platform-tests/css/css-backgrounds/reference/background-clip-border-area-and-blend-mode-ref.html
       
imported/w3c/web-platform-tests/css/css-backgrounds/reference/background-clip-text-and-blend-mode-ref.html

* 
LayoutTests/fast/backgrounds/background-clip-border-area-and-blend-mode-expected.html:
 Added.
* LayoutTests/fast/backgrounds/background-clip-border-area-and-blend-mode.html: 
Added.
* 
LayoutTests/fast/backgrounds/background-clip-text-and-blend-mode-expected.html: 
Added.
* LayoutTests/fast/backgrounds/background-clip-text-and-blend-mode.html: Added.
* LayoutTests/fast/backgrounds/background-clip-text.html:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-clip-border-area-and-blend-mode-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-clip-border-area-and-blend-mode.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-clip-text-and-blend-mode-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-clip-text-and-blend-mode.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/reference/background-clip-border-area-and-blend-mode-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/reference/background-clip-text-and-blend-mode-ref.html:
 Added.
* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/glib/fast/backgrounds/background-clip-text-expected.txt:
* LayoutTests/platform/ios/fast/backgrounds/background-clip-text-expected.txt:
* LayoutTests/platform/mac/fast/backgrounds/background-clip-text-expected.txt:
* LayoutTests/platform/wpe/TestExpectations:
* Source/WebCore/platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
* Source/WebCore/rendering/BackgroundPainter.cpp:
(WebCore::BackgroundPainter::paintFillLayerImpl const):

Canonical link: https://commits.webkit.org/305118@main



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

Reply via email to