-webkit-clip-path should parse IRIs
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 7 Oct 2012 01:35:26 +0000 (01:35 +0000)
committerkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 7 Oct 2012 01:35:26 +0000 (01:35 +0000)
commitd265ea258fd98d0871517fea4e69c8ed5047fe35
treeef83e95da6b3261d8784b823552dd1c60598c52f
parent07baedbbed4c4a53ecc5ca90b6f84ad2f28b50c2
-webkit-clip-path should parse IRIs
https://bugs.webkit.org/show_bug.cgi?id=96381

Patch by Raul Hudea <rhudea@adobe.com> on 2012-10-06
Reviewed by Andreas Kling.

Source/WebCore:

Implemented the clipping via referencing a SVG clipPath. Currently it works only if the clipPath is defined
before using it on an HTML element. The forward reference issue is tracked via https://bugs.webkit.org/show_bug.cgi?id=90405.

Tests: css3/masking/clip-path-reference-userSpaceOnUse.html
       css3/masking/clip-path-reference.html
       fast/masking/parsing-clip-path-iri.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Add handling for SVG clipPath references.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Add handling for SVG clipPath references.
* css/StyleBuilder.cpp:
(WebCore::ApplyPropertyClipPath::applyValue): Add handling for SVG references.
* rendering/ClipPathOperation.h:
(ReferenceClipPathOperation): Added a new class corresponding to SVG referenced clipPath.
(WebCore::ReferenceClipPathOperation::create):
(WebCore::ReferenceClipPathOperation::url):
(WebCore::ReferenceClipPathOperation::fragment):
(WebCore::ReferenceClipPathOperation::operator==):
(WebCore::ReferenceClipPathOperation::ReferenceClipPathOperation):
(WebCore):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents): Add handling for ReferenceClipPathOperation.
* rendering/svg/RenderSVGResourceClipper.h:
(RenderSVGResourceClipper): Made applyClippingToContext public as it needs to be called directly for HTML elements.

LayoutTests:

Tests for SVG referenced clipPath with both types of clipPathUnits: "userSpaceOnUse" and "objectBoundingBox".

* css3/masking/clip-path-reference-expected.html: Added.
* css3/masking/clip-path-reference-userSpaceOnUse-expected.html: Added.
* css3/masking/clip-path-reference-userSpaceOnUse.html: Added.
* css3/masking/clip-path-reference.html: Added.
* fast/masking/parsing-clip-path-iri-expected.txt: Added.
* fast/masking/parsing-clip-path-iri.html: Added.
* platform/chromium/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130592 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/masking/clip-path-reference-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/clip-path-reference-userSpaceOnUse-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/clip-path-reference-userSpaceOnUse.html [new file with mode: 0644]
LayoutTests/css3/masking/clip-path-reference.html [new file with mode: 0644]
LayoutTests/css3/masking/resources/clip.svg [new file with mode: 0644]
LayoutTests/fast/masking/parsing-clip-path-iri-expected.txt [new file with mode: 0644]
LayoutTests/fast/masking/parsing-clip-path-iri.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/StyleBuilder.cpp
Source/WebCore/rendering/ClipPathOperation.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/svg/RenderSVGResourceClipper.h