[webkit-changes] [WebKit/WebKit] 4f2634: Mix-blend-mode incorrectly blends with view base c...

mattwoodrow noreply at github.com
Tue Sep 19 20:22:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4f26343f6d0bd701a726e1967b7d65cd24f98d51
      https://github.com/WebKit/WebKit/commit/4f26343f6d0bd701a726e1967b7d65cd24f98d51
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2023-09-19 (Tue, 19 Sep 2023)

  Changed paths:
    R LayoutTests/css3/blending/blend-mode-body-child-expected.html
    R LayoutTests/css3/blending/blend-mode-body-child.html
    R LayoutTests/css3/blending/blend-mode-body-composited-child-expected.html
    R LayoutTests/css3/blending/blend-mode-body-composited-child.html
    R LayoutTests/imported/w3c/web-platform-tests/css/compositing/compositing_simple_div-expected.html
    R LayoutTests/imported/w3c/web-platform-tests/css/compositing/compositing_simple_div-ref.html
    R LayoutTests/imported/w3c/web-platform-tests/css/compositing/compositing_simple_div.html
    A LayoutTests/imported/w3c/web-platform-tests/css/compositing/mix-blend-mode/mix-blend-mode-root-element-group-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/compositing/mix-blend-mode/mix-blend-mode-root-element-group-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/compositing/mix-blend-mode/mix-blend-mode-root-element-group.html
    M LayoutTests/platform/glib/TestExpectations
    M LayoutTests/platform/mac-wk1/TestExpectations
    M LayoutTests/svg/css/mix-blend-mode-with-inline-svg.html
    M Source/WebCore/rendering/BackgroundPainter.cpp
    M Source/WebCore/rendering/RenderLayerInlines.h
    M Source/WebCore/rendering/RenderView.cpp
    M Source/WebCore/rendering/RenderView.h

  Log Message:
  -----------
  Mix-blend-mode incorrectly blends with view base color.
https://bugs.webkit.org/show_bug.cgi?id=261708
<rdar://problem/115688282>

Reviewed by Simon Fraser.

Mix-blend-mode on an element that blends into the 'Root Element Group' should have only the root element's background color, or transparent if none. We're including the opaque white base color of the RenderView too, which is incorrect.

This change changes BackgroundPainter so that we only draw the base color if it's ok to draw it as part of the root element background (if the root background isn't an isolated group).

It also changes RenderView to make sure we do paint the base color (for iframes, particularly) if the root element won't be painting it.

Removes some tests (including one WPT) that were explicitly trying to test the wrong thing (and failed on everything except WebKit).

* LayoutTests/css3/blending/blend-mode-body-child-expected.html: Removed.
* LayoutTests/css3/blending/blend-mode-body-child.html: Removed.
* LayoutTests/css3/blending/blend-mode-body-composited-child-expected.html: Removed.
* LayoutTests/css3/blending/blend-mode-body-composited-child.html: Removed.
* LayoutTests/imported/w3c/web-platform-tests/css/compositing/compositing_simple_div-expected.html: Removed.
* LayoutTests/imported/w3c/web-platform-tests/css/compositing/compositing_simple_div-ref.html: Removed.
* LayoutTests/imported/w3c/web-platform-tests/css/compositing/compositing_simple_div.html: Removed.
* LayoutTests/imported/w3c/web-platform-tests/css/compositing/mix-blend-mode/mix-blend-mode-root-element-group-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/compositing/mix-blend-mode/mix-blend-mode-root-element-group-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/compositing/mix-blend-mode/mix-blend-mode-root-element-group.html: Added.
* LayoutTests/svg/css/mix-blend-mode-with-inline-svg.html:
* Source/WebCore/rendering/BackgroundPainter.cpp:
(WebCore::BackgroundPainter::paintFillLayer):
* Source/WebCore/rendering/RenderLayerInlines.h:
(WebCore::RenderLayer::hasNonOpacityTransparency const):
* Source/WebCore/rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
(WebCore::RenderView::rootElementShouldPaintBaseBackground const):
* Source/WebCore/rendering/RenderView.h:

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




More information about the webkit-changes mailing list