-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: http://svn.webkit.org/repository/webkit/trunk@130592 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/css3/masking/clip-path-reference-expected.html b/LayoutTests/css3/masking/clip-path-reference-expected.html
new file mode 100644
index 0000000..3dbdb5d
--- /dev/null
+++ b/LayoutTests/css3/masking/clip-path-reference-expected.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<style>
+#d {
+    width: 180px;
+    height: 180px;
+    border: 1px solid black;
+}
+#clip {
+    width: 32px;
+    height: 32px;
+    margin: 74px;
+    background-color: green;
+}
+</style>
+</head>
+<body>
+<svg height="0"></svg>
+<div id="d"><div id="clip"></div></div>
+</body>
+</html>
\ No newline at end of file