Title: [295538] trunk
Revision
295538
Author
mattwood...@apple.com
Date
2022-06-14 14:46:28 -0700 (Tue, 14 Jun 2022)

Log Message

Treat the composite operator for the bottom mask layer as source-over.
https://bugs.webkit.org/show_bug.cgi?id=241541

Reviewed by Tim Nguyen.

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* Source/WebCore/rendering/style/FillLayer.h:
(WebCore::FillLayer::compositeForPainting const):

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

Modified Paths

Diff

Modified: trunk/LayoutTests/TestExpectations (295537 => 295538)


--- trunk/LayoutTests/TestExpectations	2022-06-14 21:36:55 UTC (rev 295537)
+++ trunk/LayoutTests/TestExpectations	2022-06-14 21:46:28 UTC (rev 295538)
@@ -2216,8 +2216,6 @@
 
 imported/w3c/web-platform-tests/css/css-masking/mask-image/mask-clip-1.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-masking/mask-image/mask-clip-2.html [ ImageOnlyFailure ]
-imported/w3c/web-platform-tests/css/css-masking/mask-image/mask-composite-1a.html [ ImageOnlyFailure ]
-imported/w3c/web-platform-tests/css/css-masking/mask-image/mask-composite-1b.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-masking/mask-image/mask-composite-1c.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-masking/mask-image/mask-composite-2c.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-masking/mask-image/mask-image-1c.html [ ImageOnlyFailure ]
@@ -2231,7 +2229,6 @@
 imported/w3c/web-platform-tests/css/css-masking/mask-image/mask-origin-2.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-masking/mask-image/mask-origin-3.html [ ImageOnlyFailure ]
 
-
 # A support file for a test
 imported/w3c/web-platform-tests/css/css-masking/clip-path/svg-clipPath.svg [ Skip ]
 

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (295537 => 295538)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2022-06-14 21:36:55 UTC (rev 295537)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2022-06-14 21:46:28 UTC (rev 295538)
@@ -975,7 +975,7 @@
                 downcast<BitmapImage>(*image).updateFromSettings(settings());
 
             ImagePaintingOptions options = {
-                op == CompositeOperator::SourceOver ? bgLayer.composite() : op,
+                op == CompositeOperator::SourceOver ? bgLayer.compositeForPainting() : op,
                 bgLayer.blendMode(),
                 decodingModeForImageDraw(*image, paintInfo),
                 ImageOrientation::FromImage,

Modified: trunk/Source/WebCore/rendering/style/FillLayer.h (295537 => 295538)


--- trunk/Source/WebCore/rendering/style/FillLayer.h	2022-06-14 21:36:55 UTC (rev 295537)
+++ trunk/Source/WebCore/rendering/style/FillLayer.h	2022-06-14 21:46:28 UTC (rev 295538)
@@ -87,6 +87,15 @@
     FillSize size() const { return FillSize(static_cast<FillSizeType>(m_sizeType), m_sizeLength); }
     MaskMode maskMode() const { return static_cast<MaskMode>(m_maskMode); }
 
+    // https://drafts.fxtf.org/css-masking/#the-mask-composite
+    // If there is no further mask layer, the compositing operator must be ignored.
+    CompositeOperator compositeForPainting() const
+    {
+        if (type() == FillLayerType::Mask && !next())
+            return CompositeOperator::SourceOver;
+        return composite();
+    }
+
     const FillLayer* next() const { return m_next.get(); }
     FillLayer* next() { return m_next.get(); }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to