[css-masking] Update clip-path box mapping to unified box
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jun 2018 07:37:28 +0000 (07:37 +0000)
committerkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jun 2018 07:37:28 +0000 (07:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185797

Reviewed by Simon Fraser.

Source/WebCore:

The box mapping for fill-box, stroke-box, view-box on HTML elements
and content-box, padding-box, margin-box, border-box for SVG elements
was aligned with the transform-box CSS property.

Furthermore, the keywords fill changed to fill-box and stroke changed
to stroke-box.

https://drafts.fxtf.org/css-masking-1/#typedef-geometry-box

Update the -webkit-clip-path property.

Tests: svg/clip-path/clip-path-shape-border-box-expected.svg
       svg/clip-path/clip-path-shape-border-box.svg
       svg/clip-path/clip-path-shape-content-box-expected.svg
       svg/clip-path/clip-path-shape-content-box.svg
       svg/clip-path/clip-path-shape-margin-box-expected.svg
       svg/clip-path/clip-path-shape-margin-box.svg
       svg/clip-path/clip-path-shape-padding-box-expected.svg
       svg/clip-path/clip-path-shape-padding-box.svg

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator CSSBoxType const):
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertClipPath):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShapeOrBox):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint):
* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):
* rendering/shapes/BoxShape.cpp:
(WebCore::computeRoundedRectForBoxShape):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::setReferenceBoxLogicalSize):
(WebCore::ShapeOutsideInfo::logicalTopOffset const):
(WebCore::ShapeOutsideInfo::logicalLeftOffset const):
* rendering/style/RenderStyleConstants.h:
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):

LayoutTests:

Update existing tests and add new tests to check the slightly different behavior.

* fast/masking/parsing-clip-path-shape-expected.txt:
* fast/masking/parsing-clip-path-shape.html:
* svg/clip-path/clip-path-shape-border-box-expected.svg: Added.
* svg/clip-path/clip-path-shape-border-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-stroke.svg.
* svg/clip-path/clip-path-shape-content-box-expected.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
* svg/clip-path/clip-path-shape-content-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
* svg/clip-path/clip-path-shape-fill.svg:
* svg/clip-path/clip-path-shape-margin-box-expected.svg: Added.
* svg/clip-path/clip-path-shape-margin-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-stroke.svg.
* svg/clip-path/clip-path-shape-padding-box-expected.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
* svg/clip-path/clip-path-shape-padding-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
* svg/clip-path/clip-path-shape-stroke.svg:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233302 268f45cc-cd09-0410-ab3c-d52691b4dbfc

24 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt
LayoutTests/fast/masking/parsing-clip-path-shape.html
LayoutTests/svg/clip-path/clip-path-shape-border-box-expected.svg [new file with mode: 0644]
LayoutTests/svg/clip-path/clip-path-shape-border-box.svg [new file with mode: 0644]
LayoutTests/svg/clip-path/clip-path-shape-content-box-expected.svg [new file with mode: 0644]
LayoutTests/svg/clip-path/clip-path-shape-content-box.svg [new file with mode: 0644]
LayoutTests/svg/clip-path/clip-path-shape-fill.svg
LayoutTests/svg/clip-path/clip-path-shape-margin-box-expected.svg [new file with mode: 0644]
LayoutTests/svg/clip-path/clip-path-shape-margin-box.svg [new file with mode: 0644]
LayoutTests/svg/clip-path/clip-path-shape-padding-box-expected.svg [new file with mode: 0644]
LayoutTests/svg/clip-path/clip-path-shape-padding-box.svg [new file with mode: 0644]
LayoutTests/svg/clip-path/clip-path-shape-stroke.svg
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/shapes/BoxShape.cpp
Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/svg/SVGRenderingContext.cpp

index 08d9f07..0d1eff4 100644 (file)
@@ -1,3 +1,25 @@
+2018-06-28  Dirk Schulze  <krit@webkit.org>
+
+        [css-masking] Update clip-path box mapping to unified box
+        https://bugs.webkit.org/show_bug.cgi?id=185797
+
+        Reviewed by Simon Fraser.
+
+        Update existing tests and add new tests to check the slightly different behavior.
+
+        * fast/masking/parsing-clip-path-shape-expected.txt:
+        * fast/masking/parsing-clip-path-shape.html:
+        * svg/clip-path/clip-path-shape-border-box-expected.svg: Added.
+        * svg/clip-path/clip-path-shape-border-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-stroke.svg.
+        * svg/clip-path/clip-path-shape-content-box-expected.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
+        * svg/clip-path/clip-path-shape-content-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
+        * svg/clip-path/clip-path-shape-fill.svg:
+        * svg/clip-path/clip-path-shape-margin-box-expected.svg: Added.
+        * svg/clip-path/clip-path-shape-margin-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-stroke.svg.
+        * svg/clip-path/clip-path-shape-padding-box-expected.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
+        * svg/clip-path/clip-path-shape-padding-box.svg: Copied from LayoutTests/svg/clip-path/clip-path-shape-fill.svg.
+        * svg/clip-path/clip-path-shape-stroke.svg:
+
 2018-06-27  Ryan Haddad  <ryanhaddad@apple.com>
 
         Mark imported/blink/storage/indexeddb/blob-delete-objectstore-db.html as flaky.
index b844985..26ea336 100644 (file)
@@ -28,8 +28,8 @@ PASS innerStyle("-webkit-clip-path", "content-box") is "content-box"
 PASS innerStyle("-webkit-clip-path", "padding-box") is "padding-box"
 PASS innerStyle("-webkit-clip-path", "border-box") is "border-box"
 PASS innerStyle("-webkit-clip-path", "margin-box") is "margin-box"
-PASS innerStyle("-webkit-clip-path", "fill") is "fill"
-PASS innerStyle("-webkit-clip-path", "stroke") is "stroke"
+PASS innerStyle("-webkit-clip-path", "fill-box") is "fill-box"
+PASS innerStyle("-webkit-clip-path", "stroke-box") is "stroke-box"
 PASS innerStyle("-webkit-clip-path", "view-box") is "view-box"
 PASS innerStyle("-webkit-clip-path", "circle(50% at 50% 50%) content-box") is "circle(50% at 50% 50%) content-box"
 PASS innerStyle("-webkit-clip-path", "circle(50% at 50% 50%) padding-box") is "circle(50% at 50% 50%) padding-box"
@@ -40,14 +40,14 @@ PASS computedStyle("-webkit-clip-path", "content-box") is "content-box"
 PASS computedStyle("-webkit-clip-path", "padding-box") is "padding-box"
 PASS computedStyle("-webkit-clip-path", "border-box") is "border-box"
 PASS computedStyle("-webkit-clip-path", "margin-box") is "margin-box"
-PASS computedStyle("-webkit-clip-path", "fill") is "fill"
-PASS computedStyle("-webkit-clip-path", "stroke") is "stroke"
+PASS computedStyle("-webkit-clip-path", "fill-box") is "fill-box"
+PASS computedStyle("-webkit-clip-path", "stroke-box") is "stroke-box"
 PASS computedStyle("-webkit-clip-path", "view-box") is "view-box"
 PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) content-box") is "circle(50% at 50% 50%) content-box"
 PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) padding-box") is "circle(50% at 50% 50%) padding-box"
 PASS computedStyle("-webkit-clip-path", "margin-box circle(50% at 50% 50%)") is "circle(50% at 50% 50%) margin-box"
 PASS computedStyle("-webkit-clip-path", "border-box circle(50% at 50% 50%)") is "circle(50% at 50% 50%) border-box"
-PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) fill") is "circle(50% at 50% 50%) fill"
+PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) fill-box") is "circle(50% at 50% 50%) fill-box"
 PASS innerStyle("-webkit-clip-path", "circle(1 at 1px 1px)") is ""
 PASS computedStyle("-webkit-clip-path", "circle(1 at 1px 1px)") is "none"
 PASS innerStyle("-webkit-clip-path", "circle(px at 1px 1px)") is ""
@@ -66,14 +66,14 @@ PASS innerStyle("-webkit-clip-path", "ellipse(-1em 1em at 1em 1em)") is ""
 PASS computedStyle("-webkit-clip-path", "ellipse(-1em 1em at 1em 1em)") is "none"
 PASS innerStyle("-webkit-clip-path", "ellipse(1em -1em at 1em 1em)") is ""
 PASS computedStyle("-webkit-clip-path", "ellipse(1em -1em at 1em 1em)") is "none"
-PASS innerStyle("-webkit-clip-path", "fill circle(50% at 50% 50%) content-box") is ""
-PASS computedStyle("-webkit-clip-path", "fill circle(50% at 50% 50%) content-box") is "none"
+PASS innerStyle("-webkit-clip-path", "fill-box circle(50% at 50% 50%) content-box") is ""
+PASS computedStyle("-webkit-clip-path", "fill-box circle(50% at 50% 50%) content-box") is "none"
 PASS innerStyle("-webkit-clip-path", "margin-box padding-box") is ""
 PASS computedStyle("-webkit-clip-path", "margin-box padding-box") is "none"
 PASS innerStyle("-webkit-clip-path", "padding-box border-box circle(50% at 50% 50%)") is ""
 PASS computedStyle("-webkit-clip-path", "padding-box border-box circle(50% at 50% 50%)") is "none"
-PASS innerStyle("-webkit-clip-path", "circle(50% at 50% 50%) content-box stroke") is ""
-PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) content-box stroke") is "none"
+PASS innerStyle("-webkit-clip-path", "circle(50% at 50% 50%) content-box stroke-box") is ""
+PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) content-box stroke-box") is "none"
 PASS innerStyle("-webkit-clip-path", "content-box margin-box padding-box") is ""
 PASS computedStyle("-webkit-clip-path", "content-box margin-box padding-box") is "none"
 PASS innerStyle("-webkit-clip-path", "none content-box") is ""
index 632d1b5..67021aa 100644 (file)
@@ -77,8 +77,8 @@ testInner("-webkit-clip-path", "content-box", "content-box");
 testInner("-webkit-clip-path", "padding-box", "padding-box");
 testInner("-webkit-clip-path", "border-box", "border-box");
 testInner("-webkit-clip-path", "margin-box", "margin-box");
-testInner("-webkit-clip-path", "fill", "fill");
-testInner("-webkit-clip-path", "stroke", "stroke");
+testInner("-webkit-clip-path", "fill-box", "fill-box");
+testInner("-webkit-clip-path", "stroke-box", "stroke-box");
 testInner("-webkit-clip-path", "view-box", "view-box");
 testInner("-webkit-clip-path", "circle(50% at 50% 50%) content-box", "circle(50% at 50% 50%) content-box");
 testInner("-webkit-clip-path", "circle(50% at 50% 50%) padding-box", "circle(50% at 50% 50%) padding-box");
@@ -90,14 +90,14 @@ testComputed("-webkit-clip-path", "content-box", "content-box");
 testComputed("-webkit-clip-path", "padding-box", "padding-box");
 testComputed("-webkit-clip-path", "border-box", "border-box");
 testComputed("-webkit-clip-path", "margin-box", "margin-box");
-testComputed("-webkit-clip-path", "fill", "fill");
-testComputed("-webkit-clip-path", "stroke", "stroke");
+testComputed("-webkit-clip-path", "fill-box", "fill-box");
+testComputed("-webkit-clip-path", "stroke-box", "stroke-box");
 testComputed("-webkit-clip-path", "view-box", "view-box");
 testComputed("-webkit-clip-path", "circle(50% at 50% 50%) content-box", "circle(50% at 50% 50%) content-box");
 testComputed("-webkit-clip-path", "circle(50% at 50% 50%) padding-box", "circle(50% at 50% 50%) padding-box");
 testComputed("-webkit-clip-path", "margin-box circle(50% at 50% 50%)", "circle(50% at 50% 50%) margin-box");
 testComputed("-webkit-clip-path", "border-box circle(50% at 50% 50%)", "circle(50% at 50% 50%) border-box");
-testComputed("-webkit-clip-path", "circle(50% at 50% 50%) fill", "circle(50% at 50% 50%) fill");
+testComputed("-webkit-clip-path", "circle(50% at 50% 50%) fill-box", "circle(50% at 50% 50%) fill-box");
 
 // reject non-lengths
 negativeTest("-webkit-clip-path", "circle(1 at 1px 1px)");
@@ -113,10 +113,10 @@ negativeTest("-webkit-clip-path", "ellipse(-1em 1em at 1em 1em)");
 negativeTest("-webkit-clip-path", "ellipse(1em -1em at 1em 1em)");
 
 // reject multiple <box> values
-negativeTest("-webkit-clip-path", "fill circle(50% at 50% 50%) content-box");
+negativeTest("-webkit-clip-path", "fill-box circle(50% at 50% 50%) content-box");
 negativeTest("-webkit-clip-path", "margin-box padding-box");
 negativeTest("-webkit-clip-path", "padding-box border-box circle(50% at 50% 50%)");
-negativeTest("-webkit-clip-path", "circle(50% at 50% 50%) content-box stroke");
+negativeTest("-webkit-clip-path", "circle(50% at 50% 50%) content-box stroke-box");
 negativeTest("-webkit-clip-path", "content-box margin-box padding-box");
 negativeTest("-webkit-clip-path", "none content-box");
 negativeTest("-webkit-clip-path", "url(#test) padding-box");
diff --git a/LayoutTests/svg/clip-path/clip-path-shape-border-box-expected.svg b/LayoutTests/svg/clip-path/clip-path-shape-border-box-expected.svg
new file mode 100644 (file)
index 0000000..61ce121
--- /dev/null
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip">
+  <circle cx="100" cy="100" r="100"/>
+</clipPath>
+<rect x="10" y="10" width="180" height="180" fill="green" stroke="green" stroke-width="20" clip-path="url(#clip)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-shape-border-box.svg b/LayoutTests/svg/clip-path/clip-path-shape-border-box.svg
new file mode 100644 (file)
index 0000000..98483ff
--- /dev/null
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400">
+<rect x="10" y="10" width="180" height="180" fill="green" stroke="green" stroke-width="20" style="-webkit-clip-path: circle() border-box;"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-shape-content-box-expected.svg b/LayoutTests/svg/clip-path/clip-path-shape-content-box-expected.svg
new file mode 100644 (file)
index 0000000..d8781dd
--- /dev/null
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green" stroke="green" stroke-width="10" style="-webkit-clip-path: circle();"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-shape-content-box.svg b/LayoutTests/svg/clip-path/clip-path-shape-content-box.svg
new file mode 100644 (file)
index 0000000..3974237
--- /dev/null
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green" stroke="green" stroke-width="10" style="-webkit-clip-path: circle() content-box;"/>
+</svg>
\ No newline at end of file
index e709dcd..eeff05f 100644 (file)
@@ -1,3 +1,3 @@
 <svg xmlns="http://www.w3.org/2000/svg">
-<rect width="200" height="200" fill="green" stroke="green" stroke-width="10" style="-webkit-clip-path: circle() fill;"/>
+<rect width="200" height="200" fill="green" stroke="green" stroke-width="10" style="-webkit-clip-path: circle() fill-box;"/>
 </svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-shape-margin-box-expected.svg b/LayoutTests/svg/clip-path/clip-path-shape-margin-box-expected.svg
new file mode 100644 (file)
index 0000000..61ce121
--- /dev/null
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip">
+  <circle cx="100" cy="100" r="100"/>
+</clipPath>
+<rect x="10" y="10" width="180" height="180" fill="green" stroke="green" stroke-width="20" clip-path="url(#clip)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-shape-margin-box.svg b/LayoutTests/svg/clip-path/clip-path-shape-margin-box.svg
new file mode 100644 (file)
index 0000000..b285d90
--- /dev/null
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400">
+<rect x="10" y="10" width="180" height="180" fill="green" stroke="green" stroke-width="20" style="-webkit-clip-path: circle() margin-box;"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-shape-padding-box-expected.svg b/LayoutTests/svg/clip-path/clip-path-shape-padding-box-expected.svg
new file mode 100644 (file)
index 0000000..d8781dd
--- /dev/null
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green" stroke="green" stroke-width="10" style="-webkit-clip-path: circle();"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-shape-padding-box.svg b/LayoutTests/svg/clip-path/clip-path-shape-padding-box.svg
new file mode 100644 (file)
index 0000000..caa1718
--- /dev/null
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green" stroke="green" stroke-width="10" style="-webkit-clip-path: circle() padding-box;"/>
+</svg>
\ No newline at end of file
index 7dbb9f7..f4eeada 100644 (file)
@@ -1,3 +1,3 @@
 <svg xmlns="http://www.w3.org/2000/svg" width="400" height="400">
-<rect x="10" y="10" width="180" height="180" fill="green" stroke="green" stroke-width="20" style="-webkit-clip-path: circle() stroke;"/>
+<rect x="10" y="10" width="180" height="180" fill="green" stroke="green" stroke-width="20" style="-webkit-clip-path: circle() stroke-box;"/>
 </svg>
\ No newline at end of file
index 4a6bfa5..8df6c9c 100644 (file)
@@ -1,3 +1,52 @@
+2018-06-28  Dirk Schulze  <krit@webkit.org>
+
+        [css-masking] Update clip-path box mapping to unified box
+        https://bugs.webkit.org/show_bug.cgi?id=185797
+
+        Reviewed by Simon Fraser.
+
+        The box mapping for fill-box, stroke-box, view-box on HTML elements
+        and content-box, padding-box, margin-box, border-box for SVG elements
+        was aligned with the transform-box CSS property.
+
+        Furthermore, the keywords fill changed to fill-box and stroke changed
+        to stroke-box.
+
+        https://drafts.fxtf.org/css-masking-1/#typedef-geometry-box
+
+        Update the -webkit-clip-path property.
+
+        Tests: svg/clip-path/clip-path-shape-border-box-expected.svg
+               svg/clip-path/clip-path-shape-border-box.svg
+               svg/clip-path/clip-path-shape-content-box-expected.svg
+               svg/clip-path/clip-path-shape-content-box.svg
+               svg/clip-path/clip-path-shape-margin-box-expected.svg
+               svg/clip-path/clip-path-shape-margin-box.svg
+               svg/clip-path/clip-path-shape-padding-box-expected.svg
+               svg/clip-path/clip-path-shape-padding-box.svg
+
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator CSSBoxType const):
+        * css/CSSValueKeywords.in:
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertClipPath):
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeBasicShapeOrBox):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::nodeAtPoint):
+        * rendering/RenderLayer.cpp:
+        (WebCore::computeReferenceBox):
+        * rendering/shapes/BoxShape.cpp:
+        (WebCore::computeRoundedRectForBoxShape):
+        * rendering/shapes/ShapeOutsideInfo.cpp:
+        (WebCore::ShapeOutsideInfo::setReferenceBoxLogicalSize):
+        (WebCore::ShapeOutsideInfo::logicalTopOffset const):
+        (WebCore::ShapeOutsideInfo::logicalLeftOffset const):
+        * rendering/style/RenderStyleConstants.h:
+        * rendering/svg/SVGRenderingContext.cpp:
+        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
+
 2018-06-27  Timothy Hatcher  <timothy@apple.com>
 
         Don't expose new semantic -apple-system color keywords on iOS.
index 3688fad..54b4e56 100644 (file)
@@ -4918,11 +4918,11 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CSSBoxType cssBox)
     case CSSBoxType::ContentBox:
         m_value.valueID = CSSValueContentBox;
         break;
-    case CSSBoxType::Fill:
-        m_value.valueID = CSSValueFill;
+    case CSSBoxType::FillBox:
+        m_value.valueID = CSSValueFillBox;
         break;
-    case CSSBoxType::Stroke:
-        m_value.valueID = CSSValueStroke;
+    case CSSBoxType::StrokeBox:
+        m_value.valueID = CSSValueStrokeBox;
         break;
     case CSSBoxType::ViewBox:
         m_value.valueID = CSSValueViewBox;
@@ -4946,10 +4946,10 @@ template<> inline CSSPrimitiveValue::operator CSSBoxType() const
     case CSSValueContentBox:
         return CSSBoxType::ContentBox;
     // The following are used in an SVG context.
-    case CSSValueFill:
-        return CSSBoxType::Fill;
-    case CSSValueStroke:
-        return CSSBoxType::Stroke;
+    case CSSValueFillBox:
+        return CSSBoxType::FillBox;
+    case CSSValueStrokeBox:
+        return CSSBoxType::StrokeBox;
     case CSSValueViewBox:
         return CSSBoxType::ViewBox;
     default:
index 01bdbae..03b5ffa 100644 (file)
@@ -888,6 +888,7 @@ verso
 margin-box
 
 // clip-path
+stroke-box
 view-box
 
 //
index 6667047..2450c55 100644 (file)
@@ -545,8 +545,8 @@ inline RefPtr<ClipPathOperation> StyleBuilderConverter::convertClipPath(StyleRes
                 || primitiveValue.valueID() == CSSValueBorderBox
                 || primitiveValue.valueID() == CSSValuePaddingBox
                 || primitiveValue.valueID() == CSSValueMarginBox
-                || primitiveValue.valueID() == CSSValueFill
-                || primitiveValue.valueID() == CSSValueStroke
+                || primitiveValue.valueID() == CSSValueFillBox
+                || primitiveValue.valueID() == CSSValueStrokeBox
                 || primitiveValue.valueID() == CSSValueViewBox);
             ASSERT(referenceBox == CSSBoxType::BoxMissing);
             referenceBox = primitiveValue;
index 3d1cdd2..e566964 100644 (file)
@@ -2619,7 +2619,7 @@ static RefPtr<CSSValue> consumeBasicShapeOrBox(CSSParserTokenRange& range, const
             componentValue = consumeBasicShape(range, context);
             shapeFound = true;
         } else if (range.peek().type() == IdentToken && !boxFound) {
-            componentValue = consumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, CSSValueMarginBox, CSSValueFill, CSSValueStroke, CSSValueViewBox>(range);
+            componentValue = consumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, CSSValueMarginBox, CSSValueFillBox, CSSValueStrokeBox, CSSValueViewBox>(range);
             boxFound = true;
         }
         if (!componentValue)
index 62c56cf..ef92840 100644 (file)
@@ -1998,8 +1998,8 @@ bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
                 referenceBoxRect = contentBoxRect();
                 break;
             case CSSBoxType::BoxMissing:
-            case CSSBoxType::Fill:
-            case CSSBoxType::Stroke:
+            case CSSBoxType::FillBox:
+            case CSSBoxType::StrokeBox:
             case CSSBoxType::ViewBox:
                 referenceBoxRect = borderBoxRect();
             }
index 4a55ce6..f4fd4ef 100644 (file)
@@ -4094,6 +4094,7 @@ static inline LayoutRect computeReferenceBox(const RenderObject& renderer, const
     const auto& box = downcast<RenderBox>(renderer);
     switch (boxType) {
     case CSSBoxType::ContentBox:
+    case CSSBoxType::FillBox:
         referenceBox = box.contentBoxRect();
         referenceBox.move(offsetFromRoot);
         break;
@@ -4104,9 +4105,8 @@ static inline LayoutRect computeReferenceBox(const RenderObject& renderer, const
     // FIXME: Support margin-box. Use bounding client rect for now.
     // https://bugs.webkit.org/show_bug.cgi?id=127984
     case CSSBoxType::MarginBox:
-    // fill, stroke, view-box compute to border-box for HTML elements.
-    case CSSBoxType::Fill:
-    case CSSBoxType::Stroke:
+    // stroke-box, view-box compute to border-box for HTML elements.
+    case CSSBoxType::StrokeBox:
     case CSSBoxType::ViewBox:
     case CSSBoxType::BorderBox:
     case CSSBoxType::BoxMissing:
index b46bbfa..10cff87 100644 (file)
@@ -83,8 +83,8 @@ RoundedRect computeRoundedRectForBoxShape(CSSBoxType box, const RenderBox& rende
             renderer.paddingLeft() + renderer.borderLeft(), renderer.paddingRight() + renderer.borderRight());
     // fill, stroke, view-box compute to border-box for HTML elements.
     case CSSBoxType::BorderBox:
-    case CSSBoxType::Fill:
-    case CSSBoxType::Stroke:
+    case CSSBoxType::FillBox:
+    case CSSBoxType::StrokeBox:
     case CSSBoxType::ViewBox:
     case CSSBoxType::BoxMissing:
         return style.getRoundedBorderFor(renderer.borderBoxRect());
index 87437a7..2866d81 100644 (file)
@@ -104,8 +104,8 @@ void ShapeOutsideInfo::setReferenceBoxLogicalSize(LayoutSize newReferenceBoxLogi
         else
             newReferenceBoxLogicalSize.shrink(m_renderer.verticalBorderAndPaddingExtent(), m_renderer.horizontalBorderAndPaddingExtent());
         break;
-    case CSSBoxType::Fill:
-    case CSSBoxType::Stroke:
+    case CSSBoxType::FillBox:
+    case CSSBoxType::StrokeBox:
     case CSSBoxType::ViewBox:
     case CSSBoxType::BoxMissing:
         ASSERT_NOT_REACHED();
@@ -232,9 +232,9 @@ LayoutUnit ShapeOutsideInfo::logicalTopOffset() const
         return borderBeforeInWritingMode(m_renderer, m_renderer.containingBlock()->style().writingMode());
     case CSSBoxType::ContentBox:
         return borderAndPaddingBeforeInWritingMode(m_renderer, m_renderer.containingBlock()->style().writingMode());
-    case CSSBoxType::Fill:
+    case CSSBoxType::FillBox:
         break;
-    case CSSBoxType::Stroke:
+    case CSSBoxType::StrokeBox:
         break;
     case CSSBoxType::ViewBox:
         break;
@@ -288,9 +288,9 @@ LayoutUnit ShapeOutsideInfo::logicalLeftOffset() const
         return borderStartWithStyleForWritingMode(m_renderer, m_renderer.containingBlock()->style());
     case CSSBoxType::ContentBox:
         return borderAndPaddingStartWithStyleForWritingMode(m_renderer, m_renderer.containingBlock()->style());
-    case CSSBoxType::Fill:
+    case CSSBoxType::FillBox:
         break;
-    case CSSBoxType::Stroke:
+    case CSSBoxType::StrokeBox:
         break;
     case CSSBoxType::ViewBox:
         break;
index 9f0c413..dc99ba2 100644 (file)
@@ -1073,8 +1073,8 @@ enum class CSSBoxType {
     BorderBox,
     PaddingBox,
     ContentBox,
-    Fill,
-    Stroke,
+    FillBox,
+    StrokeBox,
     ViewBox
 };
 
index e34127b..7642489 100644 (file)
@@ -137,7 +137,9 @@ void SVGRenderingContext::prepareToRenderSVGContent(RenderElement& renderer, Pai
     if (is<ShapeClipPathOperation>(clipPathOperation)) {
         auto& clipPath = downcast<ShapeClipPathOperation>(*clipPathOperation);
         FloatRect referenceBox;
-        if (clipPath.referenceBox() == CSSBoxType::Stroke) {
+        if (clipPath.referenceBox() == CSSBoxType::StrokeBox || clipPath.referenceBox() == CSSBoxType::MarginBox
+            || clipPath.referenceBox() == CSSBoxType::BorderBox)
+        {
             // FIXME: strokeBoundingBox() takes dasharray into account but shouldn't.
             referenceBox = renderer.strokeBoundingBox();
         } else if (clipPath.referenceBox() == CSSBoxType::ViewBox && renderer.element()) {