[Cherry-pick] Introduce new CSS property for clip-path
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Aug 2012 22:29:48 +0000 (22:29 +0000)
committerGerrit Code Review <gerrit2@kim11>
Wed, 27 Mar 2013 06:14:12 +0000 (15:14 +0900)
commit10bd6bc3b6b702f544440b751c0e5b20e7f9f14c
tree3cffc1b2e799aac9630258e3043a3deeb216a854
parent0077f49ddb1204c76855639b6dd7ba6ba9fc287e
[Cherry-pick] Introduce new CSS property for clip-path

[Title] Introduce new CSS property for clip-path
[Issues] N/A
[Problem] N/A
[Solution] Cherry picked.
[Cherry-Picker] Sanghyup Lee <sh53.lee@samsung.com>

Introduce new CSS property for clip-path
https://bugs.webkit.org/show_bug.cgi?id=95474

Reviewed by Tim Horton.

Source/WebCore:

This path introduces the new, prefixed CSS property 'clip-path' from the
CSS Masking specification. In a first step the property just accepts
'none' and the the basic shapes from CSS Exclusion. Later it will also be
possible to reference SVG 'clipPath' elements - like Firefox already does.
To enable the parsing of the shapes, the exclusion compiler flags
around the shape parser were removed.

http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html

Test: fast/masking/parsing-clip-path-shape.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Return CSSValue for CSSPropertyWebkitClipPath.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Add CSSPropertyWebkitClipPath.
(WebCore::CSSParser::parseBasicShape): Modify parser function to accept CSSPropertyWebkitClipPath as well.
* css/CSSParser.h:
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSPropertyNames.in: Added property name -webkit-clip-path.
* css/StyleBuilder.cpp:
(ApplyPropertyClipPath): New property applier just for -webkit-clip-path.
(WebCore::ApplyPropertyClipPath::setValue):
(WebCore::ApplyPropertyClipPath::applyValue):
(WebCore::ApplyPropertyClipPath::createHandler):
(WebCore::StyleBuilder::StyleBuilder):
* rendering/style/RenderStyle.cpp: Repaint if there is a difference between two BasicShapes.
(WebCore::RenderStyle::diff):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
(WebCore::StyleRareNonInheritedData::reportMemoryUsage):
* rendering/style/StyleRareNonInheritedData.h: Add new member variable for clip shape.
(StyleRareNonInheritedData):

LayoutTests:

Test parsing behavior of basic shapes on new introduced '-webkit-clip-path' CSS property.

* fast/masking/parsing-clip-path-shape-expected.txt: Added.
* fast/masking/parsing-clip-path-shape.html: Added.

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

Conflicts:

LayoutTests/ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

Change-Id: I3c619eabf8c1b4e3243dd1b003d50fe0f7cff1ed
12 files changed:
LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt [new file with mode: 0644]
LayoutTests/fast/masking/parsing-clip-path-shape.html [new file with mode: 0644]
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/StyleBuilder.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h