Replace svg/clip-path pixel tests by reference tests
https://bugs.webkit.org/show_bug.cgi?id=129177
Reviewed by Dean Jackson.
New reference tests for SVG clip-path.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* svg/clip-path/clip-path-clip-expected.svg: Added.
* svg/clip-path/clip-path-clip-nested-twice-expected.svg: Added.
* svg/clip-path/clip-path-clip-nested-twice.svg: Added.
* svg/clip-path/clip-path-clip-rule-001-expected.svg: Added.
* svg/clip-path/clip-path-clip-rule-001.svg: Added.
* svg/clip-path/clip-path-clip-rule-002-expected.svg: Added.
* svg/clip-path/clip-path-clip-rule-002.svg: Added.
* svg/clip-path/clip-path-clip-rule-003-expected.svg: Added.
* svg/clip-path/clip-path-clip-rule-003.svg: Added.
* svg/clip-path/clip-path-clip-rule-004-expected.svg: Added.
* svg/clip-path/clip-path-clip-rule-004.svg: Added.
* svg/clip-path/clip-path-clip-rule-005-expected.svg: Added.
* svg/clip-path/clip-path-clip-rule-005.svg: Added.
* svg/clip-path/clip-path-clip-rule-006-expected.svg: Added.
* svg/clip-path/clip-path-clip-rule-006.svg: Added.
* svg/clip-path/clip-path-clip-rule-007-expected.svg: Added.
* svg/clip-path/clip-path-clip-rule-007.svg: Added.
* svg/clip-path/clip-path-clip-rule-008-expected.svg: Added.
* svg/clip-path/clip-path-clip-rule-008.svg: Added.
* svg/clip-path/clip-path-clip-rule-009-expected.svg: Added.
* svg/clip-path/clip-path-clip-rule-009.svg: Added.
* svg/clip-path/clip-path-clip-rule-010-expected.svg: Added.
* svg/clip-path/clip-path-clip-rule-010.svg: Added.
* svg/clip-path/clip-path-clip.svg: Added.
* svg/clip-path/clip-path-content-clip-001-expected.svg: Added.
* svg/clip-path/clip-path-content-clip-001.svg: Added.
* svg/clip-path/clip-path-content-clip-002-expected.svg: Added.
* svg/clip-path/clip-path-content-clip-002.svg: Added.
* svg/clip-path/clip-path-content-clip-003-expected.svg: Added.
* svg/clip-path/clip-path-content-clip-003.svg: Added.
* svg/clip-path/clip-path-content-invisible-expected.svg: Added.
* svg/clip-path/clip-path-content-invisible.svg: Added.
* svg/clip-path/clip-path-content-syling-expected.svg: Added.
* svg/clip-path/clip-path-content-syling.svg: Added.
* svg/clip-path/clip-path-content-use-001-expected.svg: Added.
* svg/clip-path/clip-path-content-use-001.svg: Added.
* svg/clip-path/clip-path-content-use-002-expected.svg: Added.
* svg/clip-path/clip-path-content-use-002.svg: Added.
* svg/clip-path/clip-path-content-use-003-expected.svg: Added.
* svg/clip-path/clip-path-content-use-003.svg: Added.
* svg/clip-path/clip-path-content-use-004-expected.svg: Added.
* svg/clip-path/clip-path-content-use-004.svg: Added.
* svg/clip-path/clip-path-content-use-005-expected.svg: Added.
* svg/clip-path/clip-path-content-use-005.svg: Added.
* svg/clip-path/clip-path-content-use-006-expected.svg: Added.
* svg/clip-path/clip-path-content-use-006.svg: Added.
* svg/clip-path/clip-path-css-transform-001-expected.svg: Added.
* svg/clip-path/clip-path-css-transform-001.svg: Added.
* svg/clip-path/clip-path-css-transform-002-expected.svg: Added.
* svg/clip-path/clip-path-css-transform-002.svg: Added.
* svg/clip-path/clip-path-invalid-expected.svg: Added.
* svg/clip-path/clip-path-invalid.svg: Added.
* svg/clip-path/clip-path-no-content-001-expected.svg: Added.
* svg/clip-path/clip-path-no-content-001.svg: Added.
* svg/clip-path/clip-path-no-content-002-expected.svg: Added.
* svg/clip-path/clip-path-no-content-002.svg: Added.
* svg/clip-path/clip-path-no-content-003-expected.svg: Added.
* svg/clip-path/clip-path-no-content-003.svg: Added.
* svg/clip-path/clip-path-objectboundingbox-001-expected.svg: Added.
* svg/clip-path/clip-path-objectboundingbox-001.svg: Added.
* svg/clip-path/clip-path-objectboundingbox-002-expected.svg: Added.
* svg/clip-path/clip-path-objectboundingbox-002.svg: Added.
* svg/clip-path/clip-path-objectboundingbox-003-expected.svg: Added.
* svg/clip-path/clip-path-objectboundingbox-003.svg: Added.
* svg/clip-path/clip-path-objectboundingbox-004-expected.svg: Added.
* svg/clip-path/clip-path-objectboundingbox-004.svg: Added.
* svg/clip-path/clip-path-on-g-001-expected.svg: Added.
* svg/clip-path/clip-path-on-g-001.svg: Added.
* svg/clip-path/clip-path-on-g-002-expected.svg: Added.
* svg/clip-path/clip-path-on-g-002.svg: Added.
* svg/clip-path/clip-path-on-g-003-expected.svg: Added.
* svg/clip-path/clip-path-on-g-003.svg: Added.
* svg/clip-path/clip-path-on-g-004-expected.svg: Added.
* svg/clip-path/clip-path-on-g-004.svg: Added.
* svg/clip-path/clip-path-on-g-005-expected.svg: Added.
* svg/clip-path/clip-path-on-g-005.svg: Added.
* svg/clip-path/clip-path-on-svg-001-expected.svg: Added.
* svg/clip-path/clip-path-on-svg-001.svg: Added.
* svg/clip-path/clip-path-on-svg-002-expected.svg: Added.
* svg/clip-path/clip-path-on-svg-002.svg: Added.
* svg/clip-path/clip-path-on-use-001-expected.svg: Added.
* svg/clip-path/clip-path-on-use-001.svg: Added.
* svg/clip-path/clip-path-on-use-002-expected.svg: Added.
* svg/clip-path/clip-path-on-use-002.svg: Added.
* svg/clip-path/clip-path-precision-001-expected.svg: Added.
* svg/clip-path/clip-path-precision-001.svg: Added.
* svg/clip-path/clip-path-text-001-expected.svg: Added.
* svg/clip-path/clip-path-text-001.svg: Added.
* svg/clip-path/clip-path-text-002-expected.svg: Added.
* svg/clip-path/clip-path-text-002.svg: Added.
* svg/clip-path/clip-path-text-003-expected.svg: Added.
* svg/clip-path/clip-path-text-003.svg: Added.
* svg/clip-path/clip-path-text-004-expected.svg: Added.
* svg/clip-path/clip-path-text-004.svg: Added.
* svg/clip-path/clip-path-text-005-expected.svg: Added.
* svg/clip-path/clip-path-text-005.svg: Added.
* svg/clip-path/clip-path-userspaceonuse-001-expected.svg: Added.
* svg/clip-path/clip-path-userspaceonuse-001.svg: Added.
* svg/clip-path/mask-nested-clip-path-001-expected.svg: Added.
* svg/clip-path/mask-nested-clip-path-001.svg: Added.
* svg/clip-path/mask-nested-clip-path-002-expected.svg: Added.
* svg/clip-path/mask-nested-clip-path-002.svg: Added.
* svg/clip-path/mask-nested-clip-path-003-expected.svg: Added.
* svg/clip-path/mask-nested-clip-path-003.svg: Added.
* svg/clip-path/mask-nested-clip-path-004-expected.svg: Added.
* svg/clip-path/mask-nested-clip-path-004.svg: Added.
* svg/clip-path/mask-nested-clip-path-005-expected.svg: Added.
* svg/clip-path/mask-nested-clip-path-005.svg: Added.
* svg/clip-path/mask-nested-clip-path-006-expected.svg: Added.
* svg/clip-path/mask-nested-clip-path-006.svg: Added.
* svg/clip-path/mask-nested-clip-path-007-expected.svg: Added.
* svg/clip-path/mask-nested-clip-path-007.svg: Added.
* svg/clip-path/mask-nested-clip-path-008-expected.svg: Added.
* svg/clip-path/mask-nested-clip-path-008.svg: Added.
* svg/clip-path/mask-nested-clip-path-009-expected.svg: Added.
* svg/clip-path/mask-nested-clip-path-009.svg: Added.
* svg/clip-path/mask-nested-clip-path-panning-001-expected.svg: Added.
* svg/clip-path/mask-nested-clip-path-panning-001.svg: Added.
* svg/clip-path/mask-nested-clip-path-panning-002-expected.svg: Added.
* svg/clip-path/mask-nested-clip-path-panning-002.svg: Added.
* svg/clip-path/mask-objectboundingbox-content-clip-expected.svg: Added.
* svg/clip-path/mask-objectboundingbox-content-clip-transform-expected.svg: Added.
* svg/clip-path/mask-objectboundingbox-content-clip-transform.svg: Added.
* svg/clip-path/mask-objectboundingbox-content-clip.svg: Added.
* svg/clip-path/mask-userspaceonuse-content-clip-expected.svg: Added.
* svg/clip-path/mask-userspaceonuse-content-clip-transform-expected.svg: Added.
* svg/clip-path/mask-userspaceonuse-content-clip-transform.svg: Added.
* svg/clip-path/mask-userspaceonuse-content-clip.svg: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164531 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-expected.svg b/LayoutTests/svg/clip-path/clip-path-clip-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-nested-twice-expected.svg b/LayoutTests/svg/clip-path/clip-path-clip-nested-twice-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-nested-twice-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-nested-twice.svg b/LayoutTests/svg/clip-path/clip-path-clip-nested-twice.svg
new file mode 100644
index 0000000..1a651ba
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-nested-twice.svg
@@ -0,0 +1,12 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip3">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<clipPath id="clip2" clip-path="url(#clip3)">
+ <circle cx="100" cy="100" r="75"/>
+</clipPath>
+<clipPath id="clip1" clip-path="url(#clip2)">
+ <circle cx="100" cy="100" r="100"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-001-expected.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-001-expected.svg
new file mode 100644
index 0000000..cb342e9
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-001-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<polygon points="0 0, 200 0, 200 200, 0 200, 0 50, 150 50, 150 150, 50 150, 50 50, 0 50" fill-rule="evenodd" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-001.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-001.svg
new file mode 100644
index 0000000..9e81149
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-001.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <polygon points="0 0, 200 0, 200 200, 0 200, 0 50, 150 50, 150 150, 50 150, 50 50, 0 50" clip-rule="evenodd" />
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-002-expected.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-002-expected.svg
new file mode 100644
index 0000000..bb76206
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-002-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<polygon points="0 0, 200 0, 200 200, 0 200, 0 50, 150 50, 150 150, 50 150, 50 50, 0 50" fill-rule="nonzero" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-002.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-002.svg
new file mode 100644
index 0000000..ed43851
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-002.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <polygon points="0 0, 200 0, 200 200, 0 200, 0 50, 150 50, 150 150, 50 150, 50 50, 0 50" clip-rule="nonzero" />
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-003-expected.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-003-expected.svg
new file mode 100644
index 0000000..b1cd52c
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-003-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<polygon points="25 25, 175 25, 175 175, 25 175, 25 50, 150 50, 150 150, 50 150, 50 50, 25 50" fill-rule="evenodd" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-003.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-003.svg
new file mode 100644
index 0000000..8ce8f8a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-003.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip2">
+ <rect x="25" y="25" width="150" height="150"/>
+</clipPath>
+<clipPath id="clip1" clip-path="url(#clip2)">
+ <polygon points="0 0, 200 0, 200 200, 0 200, 0 50, 150 50, 150 150, 50 150, 50 50, 0 50" clip-rule="evenodd" />
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-004-expected.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-004-expected.svg
new file mode 100644
index 0000000..213c7e1
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-004-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<polygon points="25 25, 175 25, 175 175, 25 175, 25 50, 150 50, 150 150, 50 150, 50 50, 25 50" fill-rule="nonzero" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-004.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-004.svg
new file mode 100644
index 0000000..c3bc754
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-004.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip2">
+ <rect x="25" y="25" width="150" height="150"/>
+</clipPath>
+<clipPath id="clip1" clip-path="url(#clip2)">
+ <polygon points="0 0, 200 0, 200 200, 0 200, 0 50, 150 50, 150 150, 50 150, 50 50, 0 50" clip-rule="nonzero" />
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-005-expected.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-005-expected.svg
new file mode 100644
index 0000000..fcd2042
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-005-expected.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<polygon points="0 0, 150 0, 150 150, 0 150, 0 25, 125 25, 125 125, 25 125, 25 25, 0 25" fill-rule="evenodd" fill="green"/>
+<polygon points="50 50, 200 50, 200 200, 50 200, 50 75, 175 75, 175 175, 75 175, 75 75, 50 75" fill-rule="nonzero" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-005.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-005.svg
new file mode 100644
index 0000000..8967576
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-005.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <polygon points="0 0, 150 0, 150 150, 0 150, 0 25, 125 25, 125 125, 25 125, 25 25, 0 25" clip-rule="evenodd"/>
+ <polygon points="50 50, 200 50, 200 200, 50 200, 50 75, 175 75, 175 175, 75 175, 75 75, 50 75" clip-rule="nonzero"/>
+</clipPath>
+<rect x="0" y="0" height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-006-expected.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-006-expected.svg
new file mode 100644
index 0000000..bb4a676
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-006-expected.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<polygon points="0 0, 150 0, 150 150, 0 150, 0 25, 125 25, 125 125, 25 125, 25 25, 0 25" fill-rule="nonzero" fill="green"/>
+<polygon points="50 50, 200 50, 200 200, 50 200, 50 75, 175 75, 175 175, 75 175, 75 75, 50 75" fill-rule="nonzero" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-006.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-006.svg
new file mode 100644
index 0000000..e81f921
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-006.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <polygon points="0 0, 150 0, 150 150, 0 150, 0 25, 125 25, 125 125, 25 125, 25 25, 0 25" clip-rule="nonzero"/>
+ <polygon points="50 50, 200 50, 200 200, 50 200, 50 75, 175 75, 175 175, 75 175, 75 75, 50 75" clip-rule="nonzero"/>
+</clipPath>
+<rect x="0" y="0" height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-007-expected.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-007-expected.svg
new file mode 100644
index 0000000..e32d881
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-007-expected.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<polygon points="0 0, 150 0, 150 150, 0 150, 0 25, 125 25, 125 125, 25 125, 25 25, 0 25" fill-rule="nonzero" fill="green"/>
+<polygon points="50 50, 200 50, 200 200, 50 200, 50 75, 175 75, 175 175, 75 175, 75 75, 50 75" fill-rule="evenodd" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-007.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-007.svg
new file mode 100644
index 0000000..40a8169
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-007.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <polygon points="0 0, 150 0, 150 150, 0 150, 0 25, 125 25, 125 125, 25 125, 25 25, 0 25" clip-rule="nonzero"/>
+ <polygon points="50 50, 200 50, 200 200, 50 200, 50 75, 175 75, 175 175, 75 175, 75 75, 50 75" clip-rule="evenodd"/>
+</clipPath>
+<rect x="0" y="0" height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-008-expected.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-008-expected.svg
new file mode 100644
index 0000000..1230b3e
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-008-expected.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<polygon points="0 0, 150 0, 150 150, 0 150, 0 25, 125 25, 125 125, 25 125, 25 25, 0 25" fill-rule="evenodd" fill="green"/>
+<polygon points="50 50, 200 50, 200 200, 50 200, 50 75, 175 75, 175 175, 75 175, 75 75, 50 75" fill-rule="evenodd" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-008.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-008.svg
new file mode 100644
index 0000000..5e52f85
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-008.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <polygon points="0 0, 150 0, 150 150, 0 150, 0 25, 125 25, 125 125, 25 125, 25 25, 0 25" clip-rule="evenodd"/>
+ <polygon points="50 50, 200 50, 200 200, 50 200, 50 75, 175 75, 175 175, 75 175, 75 75, 50 75" clip-rule="evenodd"/>
+</clipPath>
+<rect x="0" y="0" height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-009-expected.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-009-expected.svg
new file mode 100644
index 0000000..e6be75f
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-009-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<polygon points="0 0, 150 0, 150 150, 0 150, 0 25, 125 25, 125 125, 25 125, 25 25, 0 25" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-009.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-009.svg
new file mode 100644
index 0000000..8e09250
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-009.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <!-- fill-rule must not affect the winding rule for clipping -->
+ <polygon points="0 0, 150 0, 150 150, 0 150, 0 25, 125 25, 125 125, 25 125, 25 25, 0 25" fill-rule="evenodd"/>
+</clipPath>
+<rect x="0" y="0" height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-010-expected.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-010-expected.svg
new file mode 100644
index 0000000..9f854c3
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-010-expected.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<polygon points="0 0, 150 0, 150 150, 0 150, 0 25, 125 25, 125 125, 25 125, 25 25, 0 25" fill-rule="evenodd" fill="green"/>
+<polygon points="50 50, 200 50, 200 200, 50 200, 50 75, 175 75, 175 175, 75 175, 75 75, 50 75" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-clip-rule-010.svg b/LayoutTests/svg/clip-path/clip-path-clip-rule-010.svg
new file mode 100644
index 0000000..8569e3d
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip-rule-010.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clip-rule="evenodd">
+ <!-- Test inheritance and overriding of inheritance-->
+ <polygon points="0 0, 150 0, 150 150, 0 150, 0 25, 125 25, 125 125, 25 125, 25 25, 0 25"/>
+ <polygon points="50 50, 200 50, 200 200, 50 200, 50 75, 175 75, 175 175, 75 175, 75 75, 50 75" clip-rule="nonzero"/>
+</clipPath>
+<rect x="0" y="0" height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-clip.svg b/LayoutTests/svg/clip-path/clip-path-clip.svg
new file mode 100644
index 0000000..d04b1c9
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-clip.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip2">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<clipPath id="clip1" clip-path="url(#clip2)">
+ <circle cx="100" cy="100" r="100"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-clip-001-expected.svg b/LayoutTests/svg/clip-path/clip-path-content-clip-001-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-clip-001-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-clip-001.svg b/LayoutTests/svg/clip-path/clip-path-content-clip-001.svg
new file mode 100644
index 0000000..03d603e
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-clip-001.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip2">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<clipPath id="clip1">
+ <circle cx="100" cy="100" r="100" clip-path="url(#clip2)"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-clip-002-expected.svg b/LayoutTests/svg/clip-path/clip-path-content-clip-002-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-clip-002-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-clip-002.svg b/LayoutTests/svg/clip-path/clip-path-content-clip-002.svg
new file mode 100644
index 0000000..cacf360
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-clip-002.svg
@@ -0,0 +1,10 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip2">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<clipPath id="clip1">
+ <circle cx="100" cy="100" r="50"/>
+ <circle cx="100" cy="100" r="75" clip-path="url(#clip2)"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-clip-003-expected.svg b/LayoutTests/svg/clip-path/clip-path-content-clip-003-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-clip-003-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-clip-003.svg b/LayoutTests/svg/clip-path/clip-path-content-clip-003.svg
new file mode 100644
index 0000000..1e7e2ef
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-clip-003.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip2">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<clipPath id="clip3">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<clipPath id="clip1">
+ <circle cx="100" cy="100" r="75" clip-path="url(#clip2)"/>
+ <circle cx="100" cy="100" r="75" clip-path="url(#clip3)"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-invisible-expected.svg b/LayoutTests/svg/clip-path/clip-path-content-invisible-expected.svg
new file mode 100644
index 0000000..e0af766
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-invisible-expected.svg
@@ -0,0 +1,2 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-content-invisible.svg b/LayoutTests/svg/clip-path/clip-path-content-invisible.svg
new file mode 100644
index 0000000..441faeb
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-invisible.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <rect width="100" height="100" style="visibility: hidden;"/>
+</clipPath>
+<rect height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-content-syling-expected.svg b/LayoutTests/svg/clip-path/clip-path-content-syling-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-syling-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-syling.svg b/LayoutTests/svg/clip-path/clip-path-content-syling.svg
new file mode 100644
index 0000000..c376afb
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-syling.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clip-path="url(#clip1)">
+ <rect x="50" y="50" width="100" height="100" stroke="black" stroke-wdith="10" stroke-dasharray="10 10" fill="none"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-use-001-expected.svg b/LayoutTests/svg/clip-path/clip-path-content-use-001-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-use-001-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-use-001.svg b/LayoutTests/svg/clip-path/clip-path-content-use-001.svg
new file mode 100644
index 0000000..a38d1d2
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-use-001.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+ <rect id="circle" x="50" y="50" width="100" height="100"/>
+</defs>
+<clipPath id="clip1">
+ <use xlink:href="#circle"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-content-use-002-expected.svg b/LayoutTests/svg/clip-path/clip-path-content-use-002-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-use-002-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-use-002.svg b/LayoutTests/svg/clip-path/clip-path-content-use-002.svg
new file mode 100644
index 0000000..1c4088b
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-use-002.svg
@@ -0,0 +1,12 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+ <rect id="rect" x="50" y="50" width="150" height="150"/>
+</defs>
+<clipPath id="clip2">
+ <rect width="150" height="150"/>
+</clipPath>
+<clipPath id="clip1" clip-path="url(#clip2)">
+ <use xlink:href="#rect"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-use-003-expected.svg b/LayoutTests/svg/clip-path/clip-path-content-use-003-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-use-003-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-use-003.svg b/LayoutTests/svg/clip-path/clip-path-content-use-003.svg
new file mode 100644
index 0000000..db6706c
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-use-003.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+ <rect id="rect1" x="50" y="50" width="150" height="150"/>
+ <rect id="rect2" width="150" height="150"/>
+</defs>
+<clipPath id="clip2">
+ <use xlink:href="#rect2"/>
+</clipPath>
+<clipPath id="clip1" clip-path="url(#clip2)">
+ <use xlink:href="#rect1"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-use-004-expected.svg b/LayoutTests/svg/clip-path/clip-path-content-use-004-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-use-004-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-use-004.svg b/LayoutTests/svg/clip-path/clip-path-content-use-004.svg
new file mode 100644
index 0000000..c295477
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-use-004.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+ <rect id="rect" width="100" height="100"/>
+</defs>
+<clipPath id="clip1">
+ <use xlink:href="#rect" transform="translate(50, 50)"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-use-005-expected.svg b/LayoutTests/svg/clip-path/clip-path-content-use-005-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-use-005-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-use-005.svg b/LayoutTests/svg/clip-path/clip-path-content-use-005.svg
new file mode 100644
index 0000000..c8ad88d
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-use-005.svg
@@ -0,0 +1,12 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+ <rect id="rect" width="150" height="150"/>
+</defs>
+<clipPath id="clip2">
+ <use xlink:href="#rect"/>
+</clipPath>
+<clipPath id="clip1" clip-path="url(#clip2)">
+ <use xlink:href="#rect" transform="translate(50, 50)"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-use-006-expected.svg b/LayoutTests/svg/clip-path/clip-path-content-use-006-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-use-006-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-content-use-006.svg b/LayoutTests/svg/clip-path/clip-path-content-use-006.svg
new file mode 100644
index 0000000..7ca50e7
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-content-use-006.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+ <rect id="rect1" width="150" height="150"/>
+ <rect id="rect2" width="150" height="150"/>
+</defs>
+<clipPath id="clip2">
+ <use xlink:href="#rect1"/>
+</clipPath>
+<clipPath id="clip1" clip-path="url(#clip2)">
+ <use xlink:href="#rect2" transform="translate(50, 50)"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-css-transform-001-expected.svg b/LayoutTests/svg/clip-path/clip-path-css-transform-001-expected.svg
new file mode 100644
index 0000000..46b77b9
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-css-transform-001-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="20" y="20" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-css-transform-001.svg b/LayoutTests/svg/clip-path/clip-path-css-transform-001.svg
new file mode 100644
index 0000000..5e662e5
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-css-transform-001.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" style="
+ -webkit-transform: scale(10) translate(2px, 2px);
+ transform: scale(10) translate(2px, 2px);">
+ <rect width="10" height="10"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-css-transform-002-expected.svg b/LayoutTests/svg/clip-path/clip-path-css-transform-002-expected.svg
new file mode 100644
index 0000000..46b77b9
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-css-transform-002-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="20" y="20" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-css-transform-002.svg b/LayoutTests/svg/clip-path/clip-path-css-transform-002.svg
new file mode 100644
index 0000000..55189fe
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-css-transform-002.svg
@@ -0,0 +1,10 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" style="
+ -webkit-transform: scale(10) translate(2px, 2px);
+ transform: scale(10) translate(2px, 2px);">
+ <rect width="10" height="10"/>
+ <!-- Second rect may cause masking -->
+ <rect width="5" height="4"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-invalid-expected.svg b/LayoutTests/svg/clip-path/clip-path-invalid-expected.svg
new file mode 100644
index 0000000..e0af766
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-invalid-expected.svg
@@ -0,0 +1,2 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-invalid.svg b/LayoutTests/svg/clip-path/clip-path-invalid.svg
new file mode 100644
index 0000000..2c90382
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-invalid.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <!-- nothing should be visible, containers are not allowed in clipPath -->
+ <g>
+ <rect width="100" height="100"/>
+ </g>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-no-content-001-expected.svg b/LayoutTests/svg/clip-path/clip-path-no-content-001-expected.svg
new file mode 100644
index 0000000..cf02ed5
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-no-content-001-expected.svg
@@ -0,0 +1,2 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-no-content-001.svg b/LayoutTests/svg/clip-path/clip-path-no-content-001.svg
new file mode 100644
index 0000000..2e2ca6f
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-no-content-001.svg
@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-no-content-002-expected.svg b/LayoutTests/svg/clip-path/clip-path-no-content-002-expected.svg
new file mode 100644
index 0000000..cf02ed5
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-no-content-002-expected.svg
@@ -0,0 +1,2 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-no-content-002.svg b/LayoutTests/svg/clip-path/clip-path-no-content-002.svg
new file mode 100644
index 0000000..51dc86cd
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-no-content-002.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <circle cx="400" cy="400" r="100"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-no-content-003-expected.svg b/LayoutTests/svg/clip-path/clip-path-no-content-003-expected.svg
new file mode 100644
index 0000000..cf02ed5
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-no-content-003-expected.svg
@@ -0,0 +1,2 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-no-content-003.svg b/LayoutTests/svg/clip-path/clip-path-no-content-003.svg
new file mode 100644
index 0000000..49f0a96
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-no-content-003.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip2">
+ <circle cx="400" cy="400" r="100"/>
+</clipPath>
+<clipPath id="clip1" clip-path="url(#clip2)">
+ <rect width="200" height="200"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-objectboundingbox-001-expected.svg b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-001-expected.svg
new file mode 100644
index 0000000..7aa980b
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-001-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-objectboundingbox-001.svg b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-001.svg
new file mode 100644
index 0000000..8dd0190f
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-001.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.25" y="0.25" width="0.5" height="0.5"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-objectboundingbox-002-expected.svg b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-002-expected.svg
new file mode 100644
index 0000000..7aa980b
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-002-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-objectboundingbox-002.svg b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-002.svg
new file mode 100644
index 0000000..cf61af8
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-002.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.0625%" y="0.0625%" width="0.125%" height="0.125%"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-objectboundingbox-003-expected.svg b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-003-expected.svg
new file mode 100644
index 0000000..5df461a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-003-expected.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <circle cx="0.25" cy="0.25" r="0.25"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-objectboundingbox-003.svg b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-003.svg
new file mode 100644
index 0000000..514a030
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-003.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <circle cx="0.25" cy="0.25" r="0.25"/>
+</clipPath>
+<rect width="10" height="10" fill="green" transform="scale(20 20)" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-objectboundingbox-004-expected.svg b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-004-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-004-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-objectboundingbox-004.svg b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-004.svg
new file mode 100644
index 0000000..4c7dbd6
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-objectboundingbox-004.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip2">
+ <rect x="50" y="50" width="150" height="150"/>
+</clipPath>
+<clipPath id="clip1" clipPathUnits="objectBoundingBox" clip-path="url(#clip2)">
+ <rect width="0.75" height="0.75"/>
+</clipPath>
+<rect height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-g-001-expected.svg b/LayoutTests/svg/clip-path/clip-path-on-g-001-expected.svg
new file mode 100644
index 0000000..7aa980b
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-g-001-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-g-001.svg b/LayoutTests/svg/clip-path/clip-path-on-g-001.svg
new file mode 100644
index 0000000..fe9394b
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-g-001.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<g clip-path="url(#clip1)">
+ <rect width="200" height="200" fill="green"/>
+</g>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-g-002-expected.svg b/LayoutTests/svg/clip-path/clip-path-on-g-002-expected.svg
new file mode 100644
index 0000000..7aa980b
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-g-002-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-g-002.svg b/LayoutTests/svg/clip-path/clip-path-on-g-002.svg
new file mode 100644
index 0000000..7162ffe
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-g-002.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<g clip-path="url(#clip1)">
+ <rect width="200" height="200" fill="green" clip-path="url(clip1)"/>
+</g>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-g-003-expected.svg b/LayoutTests/svg/clip-path/clip-path-on-g-003-expected.svg
new file mode 100644
index 0000000..7aa980b
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-g-003-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-g-003.svg b/LayoutTests/svg/clip-path/clip-path-on-g-003.svg
new file mode 100644
index 0000000..320698a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-g-003.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<g>
+ <rect width="200" height="200" fill="green" clip-path="url(#clip1)"/>
+</g>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-g-004-expected.svg b/LayoutTests/svg/clip-path/clip-path-on-g-004-expected.svg
new file mode 100644
index 0000000..7aa980b
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-g-004-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-g-004.svg b/LayoutTests/svg/clip-path/clip-path-on-g-004.svg
new file mode 100644
index 0000000..d702c8f
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-g-004.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip2">
+ <rect width="150" height="150"/>
+</clipPath>
+<clipPath id="clip1">
+ <rect x="50" y="50" width="150" height="150"/>
+</clipPath>
+<g clip-path="url(#clip1)">
+ <rect width="200" height="200" fill="green" clip-path="url(#clip2)"/>
+</g>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-g-005-expected.svg b/LayoutTests/svg/clip-path/clip-path-on-g-005-expected.svg
new file mode 100644
index 0000000..7aa980b
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-g-005-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-g-005.svg b/LayoutTests/svg/clip-path/clip-path-on-g-005.svg
new file mode 100644
index 0000000..bcce017
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-g-005.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip2" clipPathUnits="objectBoundingBox">
+ <rect width="0.75" height="0.75"/>
+</clipPath>
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.25" y="0.25" width="0.75" height="0.75"/>
+</clipPath>
+<g clip-path="url(#clip1)">
+ <rect width="200" height="200" fill="green" clip-path="url(#clip2)"/>
+</g>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-svg-001-expected.svg b/LayoutTests/svg/clip-path/clip-path-on-svg-001-expected.svg
new file mode 100644
index 0000000..7aa980b
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-svg-001-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-svg-001.svg b/LayoutTests/svg/clip-path/clip-path-on-svg-001.svg
new file mode 100644
index 0000000..ee87a72
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-svg-001.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" clip-path="url(#clip1)">
+<clipPath id="clip1">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<rect width="200" height="200" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-svg-002-expected.svg b/LayoutTests/svg/clip-path/clip-path-on-svg-002-expected.svg
new file mode 100644
index 0000000..7aa980b
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-svg-002-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-svg-002.svg b/LayoutTests/svg/clip-path/clip-path-on-svg-002.svg
new file mode 100644
index 0000000..36a7c74
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-svg-002.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg" clip-path="url(#clip1)">
+<clipPath id="clip2">
+ <rect x="25" y="25" width="150" height="150"/>
+</clipPath>
+<clipPath id="clip1">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<rect width="200" height="200" fill="green" clip-path="url(#clip2)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-use-001-expected.svg b/LayoutTests/svg/clip-path/clip-path-on-use-001-expected.svg
new file mode 100644
index 0000000..cd2f6f0
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-use-001-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect id="rect" x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-use-001.svg b/LayoutTests/svg/clip-path/clip-path-on-use-001.svg
new file mode 100644
index 0000000..5412638
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-use-001.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+ <rect id="rect" width="200" height="200" fill="green"/>
+</defs>
+<clipPath id="clip1">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<use xlink:href="#rect" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-use-002-expected.svg b/LayoutTests/svg/clip-path/clip-path-on-use-002-expected.svg
new file mode 100644
index 0000000..cd2f6f0
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-use-002-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect id="rect" x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-on-use-002.svg b/LayoutTests/svg/clip-path/clip-path-on-use-002.svg
new file mode 100644
index 0000000..af4ac15
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-on-use-002.svg
@@ -0,0 +1,12 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+ <rect id="rect" width="200" height="200" fill="green" clip-path="url(#clip2)"/>
+</defs>
+<clipPath id="clip2">
+ <rect width="150" height="150"/>
+</clipPath>
+<clipPath id="clip1">
+ <rect x="50" y="50" width="150" height="150"/>
+</clipPath>
+<use xlink:href="#rect" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-precision-001-expected.svg b/LayoutTests/svg/clip-path/clip-path-precision-001-expected.svg
new file mode 100644
index 0000000..2390517
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-precision-001-expected.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+ <g id="paths">
+ <path d="M10 10 h20 v20 h-20 v-20 m1 1 v18 h18 v-18 h-18"/>
+ <rect x="19" y="19" width="2" height="2" />
+ <rect x="5.51" y="0.51" width="2" height="32.3" fill="white"/>
+ <rect x="35.4" y="0.51" width="2" height="32.3" fill="white"/>
+ </g>
+</defs>
+<use xlink:href="#paths" fill="green"/>
+<use xlink:href="#paths" fill="green" x="30"/>
+<use xlink:href="#paths" fill="green" x="60"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-precision-001.svg b/LayoutTests/svg/clip-path/clip-path-precision-001.svg
new file mode 100644
index 0000000..4df1446
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-precision-001.svg
@@ -0,0 +1,33 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<!-- This tests some filter placement oddities caused by rounding
+(https://bugs.webkit.org/show_bug.cgi?id=73643).
+When opened, the test should not show any red outlines around the boxes. -->
+<defs>
+ <g id="paths">
+ <path d="M10 10 h20 v20 h-20 v-20 m1 1 v18 h18 v-18 h-18"/>
+ <rect x="19" y="19" width="2" height="2" />
+ <rect x="5.51" y="0.51" width="2" height="32.3" fill="white"/>
+ <rect x="35.4" y="0.51" width="2" height="32.3" fill="white"/>
+ </g>
+</defs>
+<mask id="mask">
+<use xlink:href="#paths" fill="white" x="60" />
+</mask>
+
+<clipPath id="clipper">
+ <path d="M40 10 h20 v20 h-20 v-20 m1 1 v18 h18 v-18 h-18"/>
+ <rect x="49" y="19" width="2" height="2" />
+ <rect x="35.51" y="0.51" width="2" height="32.3" />
+ <rect x="65.4" y="0.51" width="2" height="32.3" />
+</clipPath>
+
+<use xlink:href="#paths" fill="green" />
+<g clip-path="url(#clipper)">
+ <rect fill="red" x="38" y="8" width="24" height="24" />
+ <use xlink:href="#paths" fill="green" x="30" />
+</g>
+<g mask="url(#mask)">
+ <rect fill="red" x="68" y="8" width="24" height="24" />
+ <use xlink:href="#paths" fill="green" x="60" />
+</g>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-text-001-expected.svg b/LayoutTests/svg/clip-path/clip-path-text-001-expected.svg
new file mode 100644
index 0000000..1cc89dc
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-text-001-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<text x="20" y="150" fill="green" style="font-size:60px; font-weight:bold;">CLIP</text>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-text-001.svg b/LayoutTests/svg/clip-path/clip-path-text-001.svg
new file mode 100644
index 0000000..730d598
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-text-001.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <text x="20" y="150" style="font-size:60px; font-weight:bold;">CLIP</text>
+</clipPath>
+<rect height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-text-002-expected.svg b/LayoutTests/svg/clip-path/clip-path-text-002-expected.svg
new file mode 100644
index 0000000..1cc89dc
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-text-002-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<text x="20" y="150" fill="green" style="font-size:60px; font-weight:bold;">CLIP</text>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-text-002.svg b/LayoutTests/svg/clip-path/clip-path-text-002.svg
new file mode 100644
index 0000000..998ab5b
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-text-002.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <text x="20" y="150" style="font-size:60px; font-weight:bold;" stroke="red" stroke-width="10">CLIP</text>
+</clipPath>
+<rect height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-text-003-expected.svg b/LayoutTests/svg/clip-path/clip-path-text-003-expected.svg
new file mode 100644
index 0000000..ed740b7
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-text-003-expected.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<text x="20" y="150" fill="green" style="font-size:60px; font-weight:bold;">CLIP</text>
+<polygon points="0 0, 200 0, 200 200, 0 200, 0 50, 150 50, 150 150, 50 150, 50 50, 0 50" fill-rule="evenodd" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-text-003.svg b/LayoutTests/svg/clip-path/clip-path-text-003.svg
new file mode 100644
index 0000000..f3ce142
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-text-003.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <text x="20" y="150" style="font-size:60px; font-weight:bold;" stroke="red" stroke-width="10">CLIP</text>
+ <polygon points="0 0, 200 0, 200 200, 0 200, 0 50, 150 50, 150 150, 50 150, 50 50, 0 50" clip-rule="evenodd" />
+</clipPath>
+<rect height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-text-004-expected.svg b/LayoutTests/svg/clip-path/clip-path-text-004-expected.svg
new file mode 100644
index 0000000..1cc89dc
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-text-004-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<text x="20" y="150" fill="green" style="font-size:60px; font-weight:bold;">CLIP</text>
+</svg>
diff --git a/LayoutTests/svg/clip-path/clip-path-text-004.svg b/LayoutTests/svg/clip-path/clip-path-text-004.svg
new file mode 100644
index 0000000..fab9155
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-text-004.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1">
+ <text x="20" y="150" style="font-size:60px; font-weight:bold;"><tspan stroke="red" fill="none">CLIP</tspan></text>
+</clipPath>
+<rect height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-text-005-expected.svg b/LayoutTests/svg/clip-path/clip-path-text-005-expected.svg
new file mode 100644
index 0000000..2ccba00
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-text-005-expected.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip2">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<text x="20" y="150" style="font-size:60px; font-weight:bold;" clip-path="url(#clip2)" fill="green">CLIP</text>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-text-005.svg b/LayoutTests/svg/clip-path/clip-path-text-005.svg
new file mode 100644
index 0000000..89c229a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-text-005.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip2">
+ <rect x="50" y="50" width="100" height="100"/>
+</clipPath>
+<clipPath id="clip1" clip-path="url(#clip2)">
+ <text x="20" y="150" style="font-size:60px; font-weight:bold;">CLIP</text>
+</clipPath>
+<rect height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-userspaceonuse-001-expected.svg b/LayoutTests/svg/clip-path/clip-path-userspaceonuse-001-expected.svg
new file mode 100644
index 0000000..18e295a
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-userspaceonuse-001-expected.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="50" y="50" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/clip-path-userspaceonuse-001.svg b/LayoutTests/svg/clip-path/clip-path-userspaceonuse-001.svg
new file mode 100644
index 0000000..17b3c15
--- /dev/null
+++ b/LayoutTests/svg/clip-path/clip-path-userspaceonuse-001.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip2" clipPathUnits="objectBoundingBox">
+ <rect width="0.75" height="0.75"/>
+</clipPath>
+<clipPath id="clip1" clip-path="url(#clip2)">
+ <rect x="50" y="50" width="150" height="150"/>
+</clipPath>
+<rect height="200" width="200" fill="green" clip-path="url(#clip1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-001-expected.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-001-expected.svg
new file mode 100644
index 0000000..2dc8448
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-001-expected.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green"/>
+<rect x="20" y="20" width="60" height="60" fill="white"/>
+<rect x="120" y="20" width="60" height="60" fill="white"/>
+<rect x="20" y="120" width="60" height="60" fill="white"/>
+<rect x="120" y="120" width="60" height="60" fill="white"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-001.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-001.svg
new file mode 100644
index 0000000..62cae9f
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-001.svg
@@ -0,0 +1,27 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip0" clipPathUnits="userSpaceOnUse">
+ <rect x="60" y="60" width="30" height="30"/>
+</clipPath>
+
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.1" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.1" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip2" clipPathUnits="userSpaceOnUse">
+ <rect x="60" y="10" width="30" height="30" transform="scale(0.01 0.01)"/>
+ <rect x="0" y="0" width="100" height="100" transform="scale(0.01 0.01)" clip-path="url(#clip0)"/>
+</clipPath>
+
+<clipPath id="clip" clipPathUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip1)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip2)"/>
+</clipPath>
+
+<mask id="mask1" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white"/>
+ <rect x="0" y="0" width="1" height="1" fill="black" clip-path="url(#clip)" />
+</mask>
+
+<rect width="200" height="200" fill="green" mask="url(#mask1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-002-expected.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-002-expected.svg
new file mode 100644
index 0000000..2dc8448
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-002-expected.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green"/>
+<rect x="20" y="20" width="60" height="60" fill="white"/>
+<rect x="120" y="20" width="60" height="60" fill="white"/>
+<rect x="20" y="120" width="60" height="60" fill="white"/>
+<rect x="120" y="120" width="60" height="60" fill="white"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-002.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-002.svg
new file mode 100644
index 0000000..1ad31f2
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-002.svg
@@ -0,0 +1,30 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.1" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.1" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip2" clipPathUnits="objectBoundingBox">
+ <rect x="0.6" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.6" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip" clipPathUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip1)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip2)"/>
+</clipPath>
+
+<mask id="mask1a" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white"/>
+ <rect x="0" y="0" width="1" height="1" fill="black" clip-path="url(#clip1)" />
+</mask>
+
+<mask id="mask1b" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white"/>
+ <rect x="0" y="0" width="1" height="1" fill="black" clip-path="url(#clip2)" />
+</mask>
+
+<g mask="url(#mask1a)">
+ <rect width="200" height="200" fill="green" mask="url(#mask1b)"/>
+</g>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-003-expected.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-003-expected.svg
new file mode 100644
index 0000000..2dc8448
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-003-expected.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green"/>
+<rect x="20" y="20" width="60" height="60" fill="white"/>
+<rect x="120" y="20" width="60" height="60" fill="white"/>
+<rect x="20" y="120" width="60" height="60" fill="white"/>
+<rect x="120" y="120" width="60" height="60" fill="white"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-003.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-003.svg
new file mode 100644
index 0000000..02929bf
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-003.svg
@@ -0,0 +1,38 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.1" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.1" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip2" clipPathUnits="objectBoundingBox">
+ <rect x="0.6" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.6" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip" clipPathUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip1)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip2)"/>
+</clipPath>
+
+<mask id="mask1a" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white"/>
+ <rect x="0" y="0" width="1" height="1" fill="black" clip-path="url(#clip1)" />
+</mask>
+
+<mask id="mask1b" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white"/>
+ <rect x="0" y="0" width="1" height="1" fill="black" clip-path="url(#clip2)" />
+</mask>
+
+<mask id="mask2" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white" mask="url(#mask1a)"/>
+</mask>
+
+<mask id="mask3" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white" mask="url(#mask1b)"/>
+</mask>
+
+<g mask="url(#mask3)">
+ <rect width="200" height="200" fill="green" mask="url(#mask2)"/>
+</g>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-004-expected.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-004-expected.svg
new file mode 100644
index 0000000..2dc8448
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-004-expected.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green"/>
+<rect x="20" y="20" width="60" height="60" fill="white"/>
+<rect x="120" y="20" width="60" height="60" fill="white"/>
+<rect x="20" y="120" width="60" height="60" fill="white"/>
+<rect x="120" y="120" width="60" height="60" fill="white"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-004.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-004.svg
new file mode 100644
index 0000000..4a535b8
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-004.svg
@@ -0,0 +1,23 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.1" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.1" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip2" clipPathUnits="objectBoundingBox">
+ <rect x="0.6" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.6" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip" clipPathUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip1)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip2)"/>
+</clipPath>
+
+<mask id="mask1" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white"/>
+ <rect x="0" y="0" width="1" height="1" fill="black" clip-path="url(#clip)" />
+</mask>
+
+<rect width="200" height="200" fill="green" mask="url(#mask1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-005-expected.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-005-expected.svg
new file mode 100644
index 0000000..caf5df4
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-005-expected.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="20" y="20" width="60" height="60" fill="green"/>
+<rect x="120" y="20" width="60" height="60" fill="green"/>
+<rect x="20" y="120" width="60" height="60" fill="green"/>
+<rect x="120" y="120" width="60" height="60" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-005.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-005.svg
new file mode 100644
index 0000000..0537af0
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-005.svg
@@ -0,0 +1,22 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.1" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.1" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip2" clipPathUnits="objectBoundingBox">
+ <rect x="0.6" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.6" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip" clipPathUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip1)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip2)"/>
+</clipPath>
+
+<mask id="mask2" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white" clip-path="url(#clip)" />
+</mask>
+
+<rect width="200" height="200" fill="green" mask="url(#mask2)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-006-expected.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-006-expected.svg
new file mode 100644
index 0000000..caf5df4
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-006-expected.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="20" y="20" width="60" height="60" fill="green"/>
+<rect x="120" y="20" width="60" height="60" fill="green"/>
+<rect x="20" y="120" width="60" height="60" fill="green"/>
+<rect x="120" y="120" width="60" height="60" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-006.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-006.svg
new file mode 100644
index 0000000..0aa1ad1
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-006.svg
@@ -0,0 +1,22 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.1" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.1" y="0.6" width="0.3" height="0.3"/>
+ <rect x="0.6" y="0.1" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip2" clipPathUnits="objectBoundingBox">
+ <rect x="0.6" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip" clipPathUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip1)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip2)"/>
+</clipPath>
+
+<mask id="mask2" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white" clip-path="url(#clip)" />
+</mask>
+
+<rect width="200" height="200" fill="green" mask="url(#mask2)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-007-expected.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-007-expected.svg
new file mode 100644
index 0000000..2dc8448
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-007-expected.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green"/>
+<rect x="20" y="20" width="60" height="60" fill="white"/>
+<rect x="120" y="20" width="60" height="60" fill="white"/>
+<rect x="20" y="120" width="60" height="60" fill="white"/>
+<rect x="120" y="120" width="60" height="60" fill="white"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-007.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-007.svg
new file mode 100644
index 0000000..36ed354
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-007.svg
@@ -0,0 +1,23 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.1" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.1" y="0.6" width="0.3" height="0.3"/>
+ <rect x="0.6" y="0.1" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip2" clipPathUnits="objectBoundingBox">
+ <rect x="0.6" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip" clipPathUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip1)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip2)"/>
+</clipPath>
+
+<mask id="mask1" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white"/>
+ <rect x="0" y="0" width="1" height="1" fill="black" clip-path="url(#clip)" />
+</mask>
+
+<rect width="200" height="200" fill="green" mask="url(#mask1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-008-expected.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-008-expected.svg
new file mode 100644
index 0000000..2dc8448
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-008-expected.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green"/>
+<rect x="20" y="20" width="60" height="60" fill="white"/>
+<rect x="120" y="20" width="60" height="60" fill="white"/>
+<rect x="20" y="120" width="60" height="60" fill="white"/>
+<rect x="120" y="120" width="60" height="60" fill="white"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-008.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-008.svg
new file mode 100644
index 0000000..844a07c
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-008.svg
@@ -0,0 +1,31 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.1" y="0.1" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip2" clipPathUnits="objectBoundingBox">
+ <rect x="0.1" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip3" clipPathUnits="objectBoundingBox">
+ <rect x="0.6" y="0.1" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip4" clipPathUnits="objectBoundingBox">
+ <rect x="0.6" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip" clipPathUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip1)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip2)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip3)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip4)"/>
+</clipPath>
+
+<mask id="mask1" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white"/>
+ <rect x="0" y="0" width="1" height="1" fill="black" clip-path="url(#clip)" />
+</mask>
+
+<rect width="200" height="200" fill="green" mask="url(#mask1)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-009-expected.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-009-expected.svg
new file mode 100644
index 0000000..caf5df4
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-009-expected.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect x="20" y="20" width="60" height="60" fill="green"/>
+<rect x="120" y="20" width="60" height="60" fill="green"/>
+<rect x="20" y="120" width="60" height="60" fill="green"/>
+<rect x="120" y="120" width="60" height="60" fill="green"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-009.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-009.svg
new file mode 100644
index 0000000..c993c10
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-009.svg
@@ -0,0 +1,30 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.1" y="0.1" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip2" clipPathUnits="objectBoundingBox">
+ <rect x="0.1" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip3" clipPathUnits="objectBoundingBox">
+ <rect x="0.6" y="0.1" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip4" clipPathUnits="objectBoundingBox">
+ <rect x="0.6" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip" clipPathUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip1)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip2)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip3)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip4)"/>
+</clipPath>
+
+<mask id="mask2" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white" clip-path="url(#clip)" />
+</mask>
+
+<rect width="200" height="200" fill="green" mask="url(#mask2)"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-panning-001-expected.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-panning-001-expected.svg
new file mode 100644
index 0000000..2dc8448
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-panning-001-expected.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green"/>
+<rect x="20" y="20" width="60" height="60" fill="white"/>
+<rect x="120" y="20" width="60" height="60" fill="white"/>
+<rect x="20" y="120" width="60" height="60" fill="white"/>
+<rect x="120" y="120" width="60" height="60" fill="white"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-panning-001.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-panning-001.svg
new file mode 100644
index 0000000..48f25ea
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-panning-001.svg
@@ -0,0 +1,34 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.1" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.1" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip2" clipPathUnits="objectBoundingBox">
+ <rect x="0.6" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.6" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip" clipPathUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip1)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip2)"/>
+</clipPath>
+
+<mask id="mask1a" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white"/>
+ <rect x="0" y="0" width="1" height="1" fill="black" clip-path="url(#clip1)" />
+</mask>
+
+<mask id="mask1b" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white"/>
+ <rect x="0" y="0" width="1" height="1" fill="black" clip-path="url(#clip2)" />
+</mask>
+
+<g mask="url(#mask1a)" transform="translate(75, 0)">
+ <rect width="200" height="200" fill="green" mask="url(#mask1b)"/>
+</g>
+<script>
+var translate = document.getElementsByTagName('svg')[0].currentTranslate;
+translate.x = -75;
+</script>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-panning-002-expected.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-panning-002-expected.svg
new file mode 100644
index 0000000..2dc8448
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-panning-002-expected.svg
@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green"/>
+<rect x="20" y="20" width="60" height="60" fill="white"/>
+<rect x="120" y="20" width="60" height="60" fill="white"/>
+<rect x="20" y="120" width="60" height="60" fill="white"/>
+<rect x="120" y="120" width="60" height="60" fill="white"/>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-nested-clip-path-panning-002.svg b/LayoutTests/svg/clip-path/mask-nested-clip-path-panning-002.svg
new file mode 100644
index 0000000..0abc554
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-nested-clip-path-panning-002.svg
@@ -0,0 +1,42 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip1" clipPathUnits="objectBoundingBox">
+ <rect x="0.1" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.1" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip2" clipPathUnits="objectBoundingBox">
+ <rect x="0.6" y="0.1" width="0.3" height="0.3"/>
+ <rect x="0.6" y="0.6" width="0.3" height="0.3"/>
+</clipPath>
+
+<clipPath id="clip" clipPathUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip1)"/>
+ <rect x="0" y="0" width="1" height="1" clip-path="url(#clip2)"/>
+</clipPath>
+
+<mask id="mask1a" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white"/>
+ <rect x="0" y="0" width="1" height="1" fill="black" clip-path="url(#clip1)" />
+</mask>
+
+<mask id="mask1b" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white"/>
+ <rect x="0" y="0" width="1" height="1" fill="black" clip-path="url(#clip2)" />
+</mask>
+
+<mask id="mask2" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white" mask="url(#mask1a)"/>
+</mask>
+
+<mask id="mask3" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0" y="0" width="1" height="1" fill="white" mask="url(#mask1b)"/>
+</mask>
+
+<g mask="url(#mask3)" transform="translate(75, 0)">
+ <rect width="200" height="200" fill="green" mask="url(#mask2)"/>
+</g>
+<script>
+var translate = document.getElementsByTagName('svg')[0].currentTranslate;
+translate.x = -75;
+</script>
+</svg>
diff --git a/LayoutTests/svg/clip-path/mask-objectboundingbox-content-clip-expected.svg b/LayoutTests/svg/clip-path/mask-objectboundingbox-content-clip-expected.svg
new file mode 100644
index 0000000..95da507
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-objectboundingbox-content-clip-expected.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<mask id="mask" x="0" y="0" width="1" height="1">
+ <circle cx="100" cy="100" r="50" fill="white"/>
+</mask>
+<rect x="0" y="0" height="200" width="200" fill="green" mask="url(#mask)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/mask-objectboundingbox-content-clip-transform-expected.svg b/LayoutTests/svg/clip-path/mask-objectboundingbox-content-clip-transform-expected.svg
new file mode 100644
index 0000000..f4085f1
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-objectboundingbox-content-clip-transform-expected.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<mask id="mask" x="0" y="0" width="1" height="1">
+ <circle cx="10000" cy="10000" r="5000" fill="white" transform="scale(0.01 0.01)"/>
+</mask>
+<rect x="0" y="0" height="200" width="200" fill="green" mask="url(#mask)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/mask-objectboundingbox-content-clip-transform.svg b/LayoutTests/svg/clip-path/mask-objectboundingbox-content-clip-transform.svg
new file mode 100644
index 0000000..3d874d1
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-objectboundingbox-content-clip-transform.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip">
+ <circle cx="50" cy="50" r="25" transform="scale(0.01 0.01)"/>
+</clipPath>
+<mask id="mask" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0.25" y="0.25" width="0.5" height="0.5" fill="white" clip-path="url(#clip)"/>
+</mask>
+<rect x="0" y="0" height="200" width="200" fill="green" mask="url(#mask)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/mask-objectboundingbox-content-clip.svg b/LayoutTests/svg/clip-path/mask-objectboundingbox-content-clip.svg
new file mode 100644
index 0000000..4864078
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-objectboundingbox-content-clip.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip">
+ <circle cx="0.5" cy="0.5" r="0.25"/>
+</clipPath>
+<mask id="mask" x="0" y="0" width="1" height="1" maskContentUnits="objectBoundingBox">
+ <rect x="0.25" y="0.25" width="0.5" height="0.5" fill="white" clip-path="url(#clip)"/>
+</mask>
+<rect x="0" y="0" height="200" width="200" fill="green" mask="url(#mask)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/mask-userspaceonuse-content-clip-expected.svg b/LayoutTests/svg/clip-path/mask-userspaceonuse-content-clip-expected.svg
new file mode 100644
index 0000000..95da507
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-userspaceonuse-content-clip-expected.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<mask id="mask" x="0" y="0" width="1" height="1">
+ <circle cx="100" cy="100" r="50" fill="white"/>
+</mask>
+<rect x="0" y="0" height="200" width="200" fill="green" mask="url(#mask)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/mask-userspaceonuse-content-clip-transform-expected.svg b/LayoutTests/svg/clip-path/mask-userspaceonuse-content-clip-transform-expected.svg
new file mode 100644
index 0000000..f4085f1
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-userspaceonuse-content-clip-transform-expected.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<mask id="mask" x="0" y="0" width="1" height="1">
+ <circle cx="10000" cy="10000" r="5000" fill="white" transform="scale(0.01 0.01)"/>
+</mask>
+<rect x="0" y="0" height="200" width="200" fill="green" mask="url(#mask)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/mask-userspaceonuse-content-clip-transform.svg b/LayoutTests/svg/clip-path/mask-userspaceonuse-content-clip-transform.svg
new file mode 100644
index 0000000..e4eb7a35
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-userspaceonuse-content-clip-transform.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip" clipPathUnits="userSpaceOnUse">
+ <circle cx="50" cy="50" r="25" transform="scale(0.01 0.01)"/>
+</clipPath>
+<mask id="mask" x="0" y="0" width="200" height="200" maskUnits="userSpaceOnUse" maskContentUnits="objectBoundingBox">
+ <rect x="0.25" y="0.25" width="0.5" height="0.5" fill="white" clip-path="url(#clip)"/>
+</mask>
+<rect x="0" y="0" height="200" width="200" fill="green" mask="url(#mask)"/>
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/clip-path/mask-userspaceonuse-content-clip.svg b/LayoutTests/svg/clip-path/mask-userspaceonuse-content-clip.svg
new file mode 100644
index 0000000..4f4574b
--- /dev/null
+++ b/LayoutTests/svg/clip-path/mask-userspaceonuse-content-clip.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<clipPath id="clip" clipPathUnits="userSpaceOnUse">
+ <circle cx="0.5" cy="0.5" r="0.25"/>
+</clipPath>
+<mask id="mask" x="0" y="0" width="200" height="200" maskUnits="userSpaceOnUse" maskContentUnits="objectBoundingBox">
+ <rect x="0.25" y="0.25" width="0.5" height="0.5" fill="white" clip-path="url(#clip)"/>
+</mask>
+<rect x="0" y="0" height="200" width="200" fill="green" mask="url(#mask)"/>
+</svg>
\ No newline at end of file