Bug 553416: Make nsSVGClipPathFrame notify children when its transform attribute is animated. r=longsonr

--HG--
rename : layout/reftests/svg/smil/lime.svg => layout/reftests/svg/smil/transform/lime.svg
This commit is contained in:
Daniel Holbert 2010-03-24 09:54:48 -07:00
Родитель c5f8387c1e
Коммит 926e2cd979
5 изменённых файлов: 70 добавлений и 2 удалений

Просмотреть файл

@ -0,0 +1,8 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
-->
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<title>Testcase reference file for generic pass condition</title>
<rect width="100%" height="100%" fill="lime"/>
</svg>

После

Ширина:  |  Высота:  |  Размер: 297 B

Просмотреть файл

@ -1,6 +1,8 @@
# Tests related to SVG Animation (using SMIL), focusing on the animateTransform
# element.
== additive-1.svg additive-1-ref.svg
== paced-1.svg paced-1-ref.svg
== rotate-angle-1.svg rotate-angle-ref.svg
== rotate-angle-2.svg rotate-angle-ref.svg
== rotate-angle-3.svg rotate-angle-ref.svg
@ -8,5 +10,4 @@
== rotate-angle-5.svg rotate-angle-ref.svg
== scale-1.svg scale-1-ref.svg
== skew-1.svg skew-1-ref.svg
== paced-1.svg paced-1-ref.svg
== additive-1.svg additive-1-ref.svg
== translate-clipPath-1.svg lime.svg

Просмотреть файл

@ -0,0 +1,39 @@
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
class="reftest-wait">
<script xlink:href="../smil-util.js" type="text/javascript"/>
<script>
function doTest() {
setTimeAndSnapshot(1, false);
}
window.addEventListener("MozReftestInvalidate", doTest, false);
</script>
<defs>
<clipPath id="clip">
<rect x="0" y="0" width="50" height="100%"/>
<animateTransform attributeName="transform" type="translate" dur="1s"
from="0 0" to="-50 0" fill="freeze"/>
</clipPath>
</defs>
<!-- Test 1: Lime background covered by clipped red block.
After the animation, the clipping path doesn't intersecting the red
block at all, so no red is shown. -->
<rect x="0" width="50" height="100%" fill="lime" />
<rect x="0" width="50" height="100%" fill="red"
style="clip-path: url(#clip);"/>
<!-- Test 2: Puprle background covered by clipped lime block.
Initially, the clipping path is to the right of the lime, so the purple
background shows through. But after the animation, the clipping path
exactly matches the dimensions of the lime block, which lets it
completly cover all the purple. -->
<g transform="translate(100, 0)">
<rect x="-50" y="0" width="50" height="100%" fill="purple"/>
<rect x="-50" y="0" width="50" height="100%" fill="lime"
style="clip-path: url(#clip);"/>
</g>
<!-- Not a test: Paint the rest of the viewport, to match lime.svg -->
<rect x="100" height="100%" width="100%" fill="lime"/>
</svg>

После

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Просмотреть файл

@ -275,6 +275,21 @@ nsSVGClipPathFrame::IsValid()
return PR_TRUE;
}
NS_IMETHODIMP
nsSVGClipPathFrame::AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType)
{
if (aNameSpaceID == kNameSpaceID_None &&
aAttribute == nsGkAtoms::transform) {
nsSVGUtils::NotifyChildrenOfSVGChange(this,
nsISVGChildFrame::TRANSFORM_CHANGED);
}
return nsSVGClipPathFrameBase::AttributeChanged(aNameSpaceID,
aAttribute, aModType);
}
#ifdef DEBUG
NS_IMETHODIMP
nsSVGClipPathFrame::Init(nsIContent* aContent,

Просмотреть файл

@ -71,6 +71,11 @@ public:
PRBool IsValid();
// nsIFrame interface:
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType);
#ifdef DEBUG
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,