Bug 652991 - Part 6. Reftest for clip-path.
MozReview-Commit-ID: 9ozNCH7nOsY
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -432,8 +432,9 @@ pref(layout.css.mix-blend-mode.enabled,t
#skip-if(Android) pref(layout.css.mix-blend-mode.enabled,true) == blend-saturation.svg blend-saturation-ref.svg
#skip-if(Android) pref(layout.css.mix-blend-mode.enabled,true) == blend-screen.svg blend-screen-ref.svg
#skip-if(Android) pref(layout.css.mix-blend-mode.enabled,true) == blend-soft-light.svg blend-soft-light-ref.svg
skip-if(Android) pref(layout.css.mix-blend-mode.enabled,true) == blend-difference-stacking.html blend-difference-stacking-ref.html
# test case for Fragment URLs
# https://drafts.csswg.org/css-values/#local-urls
== use-localRef-marker-01.svg use-localRef-marker-01-ref.svg
+== use-localRef-clipPath-01.svg use-localRef-clipPath-01-ref.svg
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/use-localRef-clipPath-01-ref.svg
@@ -0,0 +1,17 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <title>Reference for clipPath linked to local-ref URL</title>
+ <defs>
+ <clipPath id="clip1">
+ <circle cx="50" cy="50" r="50"/>
+ </clipPath>
+ <clipPath id="clip2">
+ <circle cx="50" cy="150" r="50"/>
+ </clipPath>
+ <clipPath id="clip3">
+ <circle cx="50" cy="250" r="50"/>
+ </clipPath>
+ </defs>
+ <rect x="0" y="0" width="100" height="100" fill="blue" clip-path="url(#clip1)"/>
+ <rect x="0" y="100" width="100" height="100" fill="blue" clip-path="url(#clip2)"/>
+ <rect x="0" y="200" width="100" height="100" fill="blue" clip-path="url(#clip3)"/>
+</svg>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/use-localRef-clipPath-01.svg
@@ -0,0 +1,23 @@
+<?xml-stylesheet href="use-localRef.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <title>Testcase for clipPath linked to local-ref URL</title>
+ <defs>
+ <clipPath id="circleClip1">
+ <circle cx="50" cy="50" r="0"/>
+ </clipPath>
+ <clipPath id="circleClip2">
+ <circle cx="50" cy="150" r="50"/>
+ </clipPath>
+ <clipPath id="circleClip3">
+ <circle cx="50" cy="250" r="50"/>
+ </clipPath>
+ </defs>
+ <style>
+ #cp3 {
+ clip-path: url(#circleClip3);
+ }
+ </style>
+ <use xlink:href="use-localRef-clipPath-resource.svg#cp1"/>
+ <use xlink:href="use-localRef-clipPath-resource.svg#cp2" clip-path="url(#circleClip2)"/>
+ <use xlink:href="use-localRef-clipPath-resource.svg#cp3"/>
+</svg>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/use-localRef-clipPath-resource.svg
@@ -0,0 +1,16 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs>
+ <clipPath id="circleClip1">
+ <circle cx="50" cy="50" r="50"/>
+ </clipPath>
+ <clipPath id="circleClip2">
+ <circle cx="50" cy="150" r="0"/>
+ </clipPath>
+ <clipPath id="circleClip3">
+ <circle cx="50" cy="250" r="0"/>
+ </clipPath>
+ </defs>
+ <rect id="cp1" x="0" y="0" width="100" height="100" fill="blue" clip-path="url(#circleClip1)"/>
+ <rect id="cp2" x="0" y="100" width="100" height="100" fill="blue"/>
+ <rect id="cp3" x="0" y="200" width="100" height="100" fill="blue"/>
+</svg>
\ No newline at end of file
--- a/layout/svg/nsSVGEffects.cpp
+++ b/layout/svg/nsSVGEffects.cpp
@@ -908,16 +908,16 @@ ResolveFragmentOrURL(nsIFrame* aFrame, c
already_AddRefed<nsIURI>
nsSVGEffects::GetMarkerURI(nsIFrame* aFrame,
FragmentOrURL nsStyleSVG::* aMarker)
{
return ResolveFragmentOrURL(aFrame, &(aFrame->StyleSVG()->*aMarker));
}
already_AddRefed<nsIURI>
-nsSVGEffects::GetClipPathURI(nsIFrame *aFrame)
+nsSVGEffects::GetClipPathURI(nsIFrame* aFrame)
{
const nsStyleSVGReset* svgResetStyle = aFrame->StyleSVGReset();
- MOZ_ASSERT(svgResetStyle->mClipPath.GetType() == NS_STYLE_CLIP_PATH_URL);
+ MOZ_ASSERT(svgResetStyle->mClipPath.GetType() == StyleClipPathType::URL);
FragmentOrURL* url = svgResetStyle->mClipPath.GetURL();
return ResolveFragmentOrURL(aFrame, url);
}