Title: [250778] trunk
Revision
250778
Author
commit-qu...@webkit.org
Date
2019-10-07 11:35:00 -0700 (Mon, 07 Oct 2019)

Log Message

clip-path: <geometry-box> mapping incorrect
https://bugs.webkit.org/show_bug.cgi?id=202075

Patch by Dirk Schulze <k...@webkit.org> on 2019-10-07
Reviewed by Simon Fraser.

For HTML elements:
- stroke-box, view-box consistently compute to border-box
- fill-box computes to content-box

Source/WebCore:

Tests: css3/masking/clip-path-border-radius-fill-box-001.html
       css3/masking/clip-path-border-radius-stroke-box-000.html
       css3/masking/clip-path-border-radius-view-box-000.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint):
* rendering/shapes/BoxShape.cpp:
(WebCore::computeRoundedRectForBoxShape):

LayoutTests:

* css3/masking/clip-path-border-radius-fill-box-001-expected.html: Added.
* css3/masking/clip-path-border-radius-fill-box-001.html: Added.
* css3/masking/clip-path-border-radius-stroke-box-000-expected.html: Added.
* css3/masking/clip-path-border-radius-stroke-box-000.html: Added.
* css3/masking/clip-path-border-radius-view-box-000-expected.html: Added.
* css3/masking/clip-path-border-radius-view-box-000.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (250777 => 250778)


--- trunk/LayoutTests/ChangeLog	2019-10-07 18:21:29 UTC (rev 250777)
+++ trunk/LayoutTests/ChangeLog	2019-10-07 18:35:00 UTC (rev 250778)
@@ -1,3 +1,21 @@
+2019-10-07  Dirk Schulze  <k...@webkit.org>
+
+        clip-path: <geometry-box> mapping incorrect
+        https://bugs.webkit.org/show_bug.cgi?id=202075
+
+        Reviewed by Simon Fraser.
+
+        For HTML elements:
+        - stroke-box, view-box consistently compute to border-box
+        - fill-box computes to content-box
+
+        * css3/masking/clip-path-border-radius-fill-box-001-expected.html: Added.
+        * css3/masking/clip-path-border-radius-fill-box-001.html: Added.
+        * css3/masking/clip-path-border-radius-stroke-box-000-expected.html: Added.
+        * css3/masking/clip-path-border-radius-stroke-box-000.html: Added.
+        * css3/masking/clip-path-border-radius-view-box-000-expected.html: Added.
+        * css3/masking/clip-path-border-radius-view-box-000.html: Added.
+
 2019-10-07  Chris Lord  <cl...@igalia.com>
 
         Import OffscreenCanvas Web Platform Tests

Added: trunk/LayoutTests/css3/masking/clip-path-border-radius-fill-box-001-expected.html (0 => 250778)


--- trunk/LayoutTests/css3/masking/clip-path-border-radius-fill-box-001-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/masking/clip-path-border-radius-fill-box-001-expected.html	2019-10-07 18:35:00 UTC (rev 250778)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<style>
+    .clip {
+        width: 100px;
+        height: 100px;
+        padding: 20px;
+        border: 20px solid rgba(0, 0, 0, 0);
+        border-radius: 70px;
+        margin: 20px;
+        background-color: blue;
+        -webkit-clip-path: inset(40px round 30px);
+    }
+</style>
+<body>
+    <div class="clip"></div>
+</body>

Added: trunk/LayoutTests/css3/masking/clip-path-border-radius-fill-box-001.html (0 => 250778)


--- trunk/LayoutTests/css3/masking/clip-path-border-radius-fill-box-001.html	                        (rev 0)
+++ trunk/LayoutTests/css3/masking/clip-path-border-radius-fill-box-001.html	2019-10-07 18:35:00 UTC (rev 250778)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<style>
+    .clip {
+        width: 100px;
+        height: 100px;
+        padding: 20px;
+        border: 20px solid rgba(0, 0, 0, 0);
+        border-radius: 70px;
+        margin: 20px;
+        background-color: blue;
+        -webkit-clip-path: fill-box;
+    }
+</style>
+<body>
+    <div class="clip"></div>
+</body>

Added: trunk/LayoutTests/css3/masking/clip-path-border-radius-stroke-box-000-expected.html (0 => 250778)


--- trunk/LayoutTests/css3/masking/clip-path-border-radius-stroke-box-000-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/masking/clip-path-border-radius-stroke-box-000-expected.html	2019-10-07 18:35:00 UTC (rev 250778)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<style>
+    .clip {
+        width: 100px;
+        height: 100px;
+        padding: 20px;
+        border: 20px solid rgba(0, 0, 0, 0);
+        border-radius: 30px;
+        margin: 20px;
+        background-color: blue;
+        -webkit-clip-path: inset(0px round 30px);
+    }
+</style>
+<body>
+    <div class="clip"></div>
+</body>

Added: trunk/LayoutTests/css3/masking/clip-path-border-radius-stroke-box-000.html (0 => 250778)


--- trunk/LayoutTests/css3/masking/clip-path-border-radius-stroke-box-000.html	                        (rev 0)
+++ trunk/LayoutTests/css3/masking/clip-path-border-radius-stroke-box-000.html	2019-10-07 18:35:00 UTC (rev 250778)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<style>
+    .clip {
+        width: 100px;
+        height: 100px;
+        padding: 20px;
+        border: 20px solid rgba(0, 0, 0, 0);
+        border-radius: 30px;
+        margin: 20px;
+        background-color: blue;
+        -webkit-clip-path: stroke-box;
+    }
+</style>
+<body>
+    <div class="clip"></div>
+</body>

Added: trunk/LayoutTests/css3/masking/clip-path-border-radius-view-box-000-expected.html (0 => 250778)


--- trunk/LayoutTests/css3/masking/clip-path-border-radius-view-box-000-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/masking/clip-path-border-radius-view-box-000-expected.html	2019-10-07 18:35:00 UTC (rev 250778)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<style>
+    .clip {
+        width: 100px;
+        height: 100px;
+        padding: 20px;
+        border: 20px solid rgba(0, 0, 0, 0);
+        border-radius: 30px;
+        margin: 20px;
+        background-color: blue;
+        -webkit-clip-path: inset(0px round 30px);
+    }
+</style>
+<body>
+    <div class="clip"></div>
+</body>

Added: trunk/LayoutTests/css3/masking/clip-path-border-radius-view-box-000.html (0 => 250778)


--- trunk/LayoutTests/css3/masking/clip-path-border-radius-view-box-000.html	                        (rev 0)
+++ trunk/LayoutTests/css3/masking/clip-path-border-radius-view-box-000.html	2019-10-07 18:35:00 UTC (rev 250778)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<style>
+    .clip {
+        width: 100px;
+        height: 100px;
+        padding: 20px;
+        border: 20px solid rgba(0, 0, 0, 0);
+        border-radius: 30px;
+        margin: 20px;
+        background-color: blue;
+        -webkit-clip-path: view-box;
+    }
+</style>
+<body>
+    <div class="clip"></div>
+</body>

Modified: trunk/Source/WebCore/ChangeLog (250777 => 250778)


--- trunk/Source/WebCore/ChangeLog	2019-10-07 18:21:29 UTC (rev 250777)
+++ trunk/Source/WebCore/ChangeLog	2019-10-07 18:35:00 UTC (rev 250778)
@@ -1,3 +1,23 @@
+2019-10-07  Dirk Schulze  <k...@webkit.org>
+
+        clip-path: <geometry-box> mapping incorrect
+        https://bugs.webkit.org/show_bug.cgi?id=202075
+
+        Reviewed by Simon Fraser.
+
+        For HTML elements:
+        - stroke-box, view-box consistently compute to border-box
+        - fill-box computes to content-box
+
+        Tests: css3/masking/clip-path-border-radius-fill-box-001.html
+               css3/masking/clip-path-border-radius-stroke-box-000.html
+               css3/masking/clip-path-border-radius-view-box-000.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::nodeAtPoint):
+        * rendering/shapes/BoxShape.cpp:
+        (WebCore::computeRoundedRectForBoxShape):
+
 2019-10-07  Tim Horton  <timothy_hor...@apple.com>
 
         Fix the Windows build

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (250777 => 250778)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2019-10-07 18:21:29 UTC (rev 250777)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2019-10-07 18:35:00 UTC (rev 250778)
@@ -2013,19 +2013,17 @@
             case CSSBoxType::MarginBox:
                 referenceBoxRect = marginBoxRect();
                 break;
-            case CSSBoxType::BorderBox:
-                referenceBoxRect = borderBoxRect();
-                break;
             case CSSBoxType::PaddingBox:
                 referenceBoxRect = paddingBoxRect();
                 break;
+            case CSSBoxType::FillBox:
             case CSSBoxType::ContentBox:
                 referenceBoxRect = contentBoxRect();
                 break;
-            case CSSBoxType::BoxMissing:
-            case CSSBoxType::FillBox:
             case CSSBoxType::StrokeBox:
             case CSSBoxType::ViewBox:
+            case CSSBoxType::BorderBox:
+            case CSSBoxType::BoxMissing:
                 referenceBoxRect = borderBoxRect();
             }
             if (!clipPath.pathForReferenceRect(referenceBoxRect).contains(locationInContainer.point() - localOffset, clipPath.windRule()))

Modified: trunk/Source/WebCore/rendering/shapes/BoxShape.cpp (250777 => 250778)


--- trunk/Source/WebCore/rendering/shapes/BoxShape.cpp	2019-10-07 18:21:29 UTC (rev 250777)
+++ trunk/Source/WebCore/rendering/shapes/BoxShape.cpp	2019-10-07 18:35:00 UTC (rev 250778)
@@ -77,13 +77,14 @@
     }
     case CSSBoxType::PaddingBox:
         return style.getRoundedInnerBorderFor(renderer.borderBoxRect());
+    // fill-box compute to content-box for HTML elements.
+    case CSSBoxType::FillBox:
     case CSSBoxType::ContentBox:
         return style.getRoundedInnerBorderFor(renderer.borderBoxRect(),
             renderer.paddingTop() + renderer.borderTop(), renderer.paddingBottom() + renderer.borderBottom(),
             renderer.paddingLeft() + renderer.borderLeft(), renderer.paddingRight() + renderer.borderRight());
-    // fill, stroke, view-box compute to border-box for HTML elements.
+    // stroke-box, view-box compute to border-box for HTML elements.
     case CSSBoxType::BorderBox:
-    case CSSBoxType::FillBox:
     case CSSBoxType::StrokeBox:
     case CSSBoxType::ViewBox:
     case CSSBoxType::BoxMissing:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to