Title: [292059] trunk
Revision
292059
Author
[email protected]
Date
2022-03-29 12:49:08 -0700 (Tue, 29 Mar 2022)

Log Message

drop-shadow filter doesn't work correctly in tiled backing layer
https://bugs.webkit.org/show_bug.cgi?id=236800
<rdar://problem/89382612>

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

* web-platform-tests/css/filter-effects/filters-drop-shadow-003-expected.html: Added.
* web-platform-tests/css/filter-effects/filters-drop-shadow-003.html: Added.

Source/WebCore:

If an element with drop-shadow filter wasn't placed in the
painting rect, the drop-shadow wasn't rendered correctly. This
issue tended to be observed in tiled backing layers becuase each
tile is painted separately. But, not necessary. If an element with
drop-shadow filter was placed in the outside of view, this issue
could arise.

Tests: css3/filters/drop-shadow-in-tiled-backing.html
       imported/w3c/web-platform-tests/css/filter-effects/filters-drop-shadow-003.html

* rendering/RenderLayerFilters.cpp:
(WebCore::RenderLayerFilters::beginFilterEffect): If the
drop-shadow is cast to the right direction, dirtyRect needs to be
extended to left direction to calculate targetBoundingBox.

LayoutTests:

* css3/filters/drop-shadow-in-tiled-backing-expected.html: Added.
* css3/filters/drop-shadow-in-tiled-backing.html: Added.
* platform/ios-wk2/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (292058 => 292059)


--- trunk/LayoutTests/ChangeLog	2022-03-29 19:46:38 UTC (rev 292058)
+++ trunk/LayoutTests/ChangeLog	2022-03-29 19:49:08 UTC (rev 292059)
@@ -1,3 +1,15 @@
+2022-03-29  Fujii Hironori  <[email protected]>
+
+        drop-shadow filter doesn't work correctly in tiled backing layer
+        https://bugs.webkit.org/show_bug.cgi?id=236800
+        <rdar://problem/89382612>
+
+        Reviewed by Simon Fraser.
+
+        * css3/filters/drop-shadow-in-tiled-backing-expected.html: Added.
+        * css3/filters/drop-shadow-in-tiled-backing.html: Added.
+        * platform/ios-wk2/TestExpectations:
+
 2022-03-29  Matteo Flores  <[email protected]>
 
         [ iOS Mac ] imported/w3c/web-platform-tests/fetch/metadata/download.https.sub.html is a flaky text failure

Added: trunk/LayoutTests/css3/filters/drop-shadow-in-tiled-backing-expected.html (0 => 292059)


--- trunk/LayoutTests/css3/filters/drop-shadow-in-tiled-backing-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/filters/drop-shadow-in-tiled-backing-expected.html	2022-03-29 19:49:08 UTC (rev 292059)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+    <style>
+        #container {
+            position: relative;
+            top: 412px;
+        }
+        #x {
+            background: green;
+            width: 100px;
+            height: 100px;
+        }
+        #y {
+            background: black;
+            width: 100px;
+            height: 100px;
+        }
+        body {
+            height: 3000px;
+        }
+    </style>
+    <body>
+        <div id=container>
+            You should see a green square box and a black square box.
+            <div id=x></div>
+            <div id=y></div>
+        </div>
+    </body>
+    <script>
+        scrollTo(0, 412);
+    </script>
+</html>

Added: trunk/LayoutTests/css3/filters/drop-shadow-in-tiled-backing.html (0 => 292059)


--- trunk/LayoutTests/css3/filters/drop-shadow-in-tiled-backing.html	                        (rev 0)
+++ trunk/LayoutTests/css3/filters/drop-shadow-in-tiled-backing.html	2022-03-29 19:49:08 UTC (rev 292059)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+    <style>
+        #container {
+            position: relative;
+            top: 412px;
+        }
+        #x {
+            background: green;
+            width: 100px;
+            height: 100px;
+            filter: drop-shadow(0 100px);
+        }
+        body {
+            height: 3000px;
+        }
+    </style>
+    <body>
+        <div id=container>
+            You should see a green square box and a black square box.
+            <div id=x></div>
+        </div>
+    </body>
+    <script>
+        scrollTo(0, 412);
+    </script>
+</html>

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (292058 => 292059)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-29 19:46:38 UTC (rev 292058)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-29 19:49:08 UTC (rev 292059)
@@ -1,3 +1,14 @@
+2022-03-29  Fujii Hironori  <[email protected]>
+
+        drop-shadow filter doesn't work correctly in tiled backing layer
+        https://bugs.webkit.org/show_bug.cgi?id=236800
+        <rdar://problem/89382612>
+
+        Reviewed by Simon Fraser.
+
+        * web-platform-tests/css/filter-effects/filters-drop-shadow-003-expected.html: Added.
+        * web-platform-tests/css/filter-effects/filters-drop-shadow-003.html: Added.
+
 2022-03-29  Antti Koivisto  <[email protected]>
 
         [CSS Container Queries] Support CSSOM

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filters-drop-shadow-003-expected.html (0 => 292059)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filters-drop-shadow-003-expected.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filters-drop-shadow-003-expected.html	2022-03-29 19:49:08 UTC (rev 292059)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<style>
+div {
+    width: 300px;
+    height: 300px;
+    background-color: green;
+}
+</style>
+You should see a green box.
+<div></div>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filters-drop-shadow-003.html (0 => 292059)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filters-drop-shadow-003.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/filter-effects/filters-drop-shadow-003.html	2022-03-29 19:49:08 UTC (rev 292059)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<title>CSS Filters: drop-shadow filter on element with clipped children</title>
+<link rel="author" title="Fujii Hironori" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<link rel="match" href=""
+<meta name="assert" content="Check that a drop-shadow of an element with drop-shadow filter placed in the outside of the view appears"/>
+<style>
+div {
+    width: 300px;
+    height: 300px;
+    top: -1000px;
+    left: -1000px;
+    background-color: red;
+    position: relative;
+    filter: drop-shadow(1000px 1000px 0 green);
+}
+</style>
+You should see a green box.
+<div></div>

Modified: trunk/LayoutTests/platform/ios-wk2/TestExpectations (292058 => 292059)


--- trunk/LayoutTests/platform/ios-wk2/TestExpectations	2022-03-29 19:46:38 UTC (rev 292058)
+++ trunk/LayoutTests/platform/ios-wk2/TestExpectations	2022-03-29 19:49:08 UTC (rev 292059)
@@ -2325,3 +2325,5 @@
 fast/text/accessibility-bold.html [ Pass ]
 
 webkit.org/b/233621 http/tests/webgpu [ Skip ]
+
+webkit.org/b/237849 imported/w3c/web-platform-tests/css/filter-effects/filters-drop-shadow-003.html [ ImageOnlyFailure ]

Modified: trunk/Source/WebCore/ChangeLog (292058 => 292059)


--- trunk/Source/WebCore/ChangeLog	2022-03-29 19:46:38 UTC (rev 292058)
+++ trunk/Source/WebCore/ChangeLog	2022-03-29 19:49:08 UTC (rev 292059)
@@ -1,3 +1,26 @@
+2022-03-29  Fujii Hironori  <[email protected]>
+
+        drop-shadow filter doesn't work correctly in tiled backing layer
+        https://bugs.webkit.org/show_bug.cgi?id=236800
+        <rdar://problem/89382612>
+
+        Reviewed by Simon Fraser.
+
+        If an element with drop-shadow filter wasn't placed in the
+        painting rect, the drop-shadow wasn't rendered correctly. This
+        issue tended to be observed in tiled backing layers becuase each
+        tile is painted separately. But, not necessary. If an element with
+        drop-shadow filter was placed in the outside of view, this issue
+        could arise.
+
+        Tests: css3/filters/drop-shadow-in-tiled-backing.html
+               imported/w3c/web-platform-tests/css/filter-effects/filters-drop-shadow-003.html
+
+        * rendering/RenderLayerFilters.cpp:
+        (WebCore::RenderLayerFilters::beginFilterEffect): If the
+        drop-shadow is cast to the right direction, dirtyRect needs to be
+        extended to left direction to calculate targetBoundingBox.
+
 2022-03-29  Chris Dumez  <[email protected]>
 
         Use "UTF-8"_s instead of PAL::UTF8Encoding().domName()

Modified: trunk/Source/WebCore/rendering/RenderLayerFilters.cpp (292058 => 292059)


--- trunk/Source/WebCore/rendering/RenderLayerFilters.cpp	2022-03-29 19:46:38 UTC (rev 292058)
+++ trunk/Source/WebCore/rendering/RenderLayerFilters.cpp	2022-03-29 19:49:08 UTC (rev 292059)
@@ -143,8 +143,14 @@
     if (!m_filter)
         return nullptr;
 
+    auto expandedDirtyRect = dirtyRect;
+    if (m_filter->hasFilterThatMovesPixels()) {
+        auto outsets = m_filter->outsets();
+        LayoutBoxExtent flippedOutsets { outsets.bottom(), outsets.left(), outsets.top(), outsets.right() };
+        expandedDirtyRect.expand(flippedOutsets);
+    }
     // Calculate targetBoundingBox since it will be used if the filter is created.
-    auto targetBoundingBox = intersection(filterBoxRect, dirtyRect);
+    auto targetBoundingBox = intersection(filterBoxRect, expandedDirtyRect);
     if (targetBoundingBox.isEmpty())
         return nullptr;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to