[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)
commit6deb8495198e7232e6bb16342f671b82a124f9a8
tree392e53230d66b89429629b44d9c8d50a699d0786
parent5aca25ea8e28a868f530be9ee1ea2564cfc01e24
[css-masking] Update clip-path box mapping to unified box
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