Title: [288057] trunk
Revision
288057
Author
[email protected]
Date
2022-01-15 09:21:40 -0800 (Sat, 15 Jan 2022)

Log Message

[css-contain] Fix contain-size-replaced-002.html
https://bugs.webkit.org/show_bug.cgi?id=235175

Patch by Rob Buis <[email protected]> on 2022-01-15
Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

If the SVG root has zero content width and/or height, there is no point
in painting the children contents.

Test: imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html

* rendering/svg/LegacyRenderSVGRoot.cpp:
(WebCore::LegacyRenderSVGRoot::paintReplaced):

LayoutTests:

* TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (288056 => 288057)


--- trunk/LayoutTests/ChangeLog	2022-01-15 17:11:33 UTC (rev 288056)
+++ trunk/LayoutTests/ChangeLog	2022-01-15 17:21:40 UTC (rev 288057)
@@ -1,3 +1,12 @@
+2022-01-15  Rob Buis  <[email protected]>
+
+        [css-contain] Fix contain-size-replaced-002.html
+        https://bugs.webkit.org/show_bug.cgi?id=235175
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        * TestExpectations:
+
 2022-01-14  Antoine Quint  <[email protected]>
 
         Setting `content: normal` on a ::marker should make computed style return resolved values

Modified: trunk/LayoutTests/TestExpectations (288056 => 288057)


--- trunk/LayoutTests/TestExpectations	2022-01-15 17:11:33 UTC (rev 288056)
+++ trunk/LayoutTests/TestExpectations	2022-01-15 17:21:40 UTC (rev 288057)
@@ -4822,9 +4822,6 @@
 # Canvas doesn't get default aspect-ratio for width and height attributes.
 webkit.org/b/217529 imported/w3c/web-platform-tests/css/css-flexbox/canvas-contain-size.html [ ImageOnlyFailure ]
 
-# Content is painted on svg's padding area.
-webkit.org/b/425868 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html [ ImageOnlyFailure ]
-
 # Multicolumn does not paint the horizontal overflow area of a relative child.
 webkit.org/b/41796 imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-002.html [ ImageOnlyFailure ]
 

Modified: trunk/Source/WebCore/ChangeLog (288056 => 288057)


--- trunk/Source/WebCore/ChangeLog	2022-01-15 17:11:33 UTC (rev 288056)
+++ trunk/Source/WebCore/ChangeLog	2022-01-15 17:21:40 UTC (rev 288057)
@@ -1,3 +1,18 @@
+2022-01-15  Rob Buis  <[email protected]>
+
+        [css-contain] Fix contain-size-replaced-002.html
+        https://bugs.webkit.org/show_bug.cgi?id=235175
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        If the SVG root has zero content width and/or height, there is no point
+        in painting the children contents.
+
+        Test: imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html
+
+        * rendering/svg/LegacyRenderSVGRoot.cpp:
+        (WebCore::LegacyRenderSVGRoot::paintReplaced):
+
 2022-01-15  Tyler Wilcock  <[email protected]>
 
         AX: Remove AXAriaAttributeChanged notification because it's not used by anything

Modified: trunk/Source/WebCore/rendering/svg/LegacyRenderSVGRoot.cpp (288056 => 288057)


--- trunk/Source/WebCore/rendering/svg/LegacyRenderSVGRoot.cpp	2022-01-15 17:11:33 UTC (rev 288056)
+++ trunk/Source/WebCore/rendering/svg/LegacyRenderSVGRoot.cpp	2022-01-15 17:21:40 UTC (rev 288057)
@@ -224,7 +224,8 @@
 void LegacyRenderSVGRoot::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
     // An empty viewport disables rendering.
-    if (borderBoxRect().isEmpty())
+    bool clipViewport = shouldApplyViewportClip();
+    if (clipViewport && contentSize().isEmpty())
         return;
 
     // Don't paint, if the context explicitly disabled it.
@@ -269,7 +270,7 @@
     childPaintInfo.context().save();
 
     // Apply initial viewport clip
-    if (shouldApplyViewportClip())
+    if (clipViewport)
         childPaintInfo.context().clip(snappedIntRect(overflowClipRect(paintOffset)));
 
     // Convert from container offsets (html renderers) to a relative transform (svg renderers).
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to