summaryrefslogtreecommitdiffstats
path: root/layout/reftests/svg/smil/event
diff options
context:
space:
mode:
Diffstat (limited to 'layout/reftests/svg/smil/event')
-rw-r--r--layout/reftests/svg/smil/event/accesskey-entity-1.svg17
-rw-r--r--layout/reftests/svg/smil/event/accesskey-entity-2.svg15
-rw-r--r--layout/reftests/svg/smil/event/event-begin-1.svg16
-rw-r--r--layout/reftests/svg/smil/event/event-begin-load-1.svg14
-rw-r--r--layout/reftests/svg/smil/event/event-begin-offset-1.svg16
-rw-r--r--layout/reftests/svg/smil/event/event-begin-offset-2.svg16
-rw-r--r--layout/reftests/svg/smil/event/event-begin-timeevent-1.svg17
-rw-r--r--layout/reftests/svg/smil/event/event-begin-timeevent-2.svg18
-rw-r--r--layout/reftests/svg/smil/event/event-begin-timeevent-3.svg36
-rw-r--r--layout/reftests/svg/smil/event/event-bubble-1.svg18
-rw-r--r--layout/reftests/svg/smil/event/event-custom-1.svg26
-rw-r--r--layout/reftests/svg/smil/event/event-end-1.svg16
-rw-r--r--layout/reftests/svg/smil/event/event-end-2.svg18
-rw-r--r--layout/reftests/svg/smil/event/event-end-open-1.svg20
-rw-r--r--layout/reftests/svg/smil/event/event-end-trimmed-1.svg17
-rw-r--r--layout/reftests/svg/smil/event/event-preventDefault-1.svg16
-rw-r--r--layout/reftests/svg/smil/event/event-seek-1.svg20
-rw-r--r--layout/reftests/svg/smil/event/event-target-default-1.svg15
-rw-r--r--layout/reftests/svg/smil/event/event-target-default-2.svg14
-rw-r--r--layout/reftests/svg/smil/event/event-target-id-change-1.svg15
-rw-r--r--layout/reftests/svg/smil/event/event-target-id-change-2.svg16
-rw-r--r--layout/reftests/svg/smil/event/event-target-id-change-3.svg16
-rw-r--r--layout/reftests/svg/smil/event/event-target-non-svg-1.xhtml41
-rw-r--r--layout/reftests/svg/smil/event/event-target-surgery-1.svg17
-rw-r--r--layout/reftests/svg/smil/event/event-target-surgery-2.svg15
-rw-r--r--layout/reftests/svg/smil/event/event-target-surgery-3.svg32
-rw-r--r--layout/reftests/svg/smil/event/event-target-xlink-change-1.svg17
-rw-r--r--layout/reftests/svg/smil/event/event-target-xlink-change-2.svg18
-rw-r--r--layout/reftests/svg/smil/event/event-target-xlink-change-3.svg18
-rw-r--r--layout/reftests/svg/smil/event/event-target-xlink-change-4.svg18
-rw-r--r--layout/reftests/svg/smil/event/event-util.js37
-rw-r--r--layout/reftests/svg/smil/event/green-box-ref.svg3
-rw-r--r--layout/reftests/svg/smil/event/green-box-ref.xhtml8
-rw-r--r--layout/reftests/svg/smil/event/reftest-stylo.list33
-rw-r--r--layout/reftests/svg/smil/event/reftest.list32
35 files changed, 681 insertions, 0 deletions
diff --git a/layout/reftests/svg/smil/event/accesskey-entity-1.svg b/layout/reftests/svg/smil/event/accesskey-entity-1.svg
new file mode 100644
index 000000000..6bc6c849d
--- /dev/null
+++ b/layout/reftests/svg/smil/event/accesskey-entity-1.svg
@@ -0,0 +1,17 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ keypress(0x20);
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <circle id="circle" r="10"/>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="fill" attributeType="CSS"
+ to="green" begin="accesskey(&#x20;)" dur="4s"/>
+ <set attributeName="width" attributeType="XML"
+ to="200" begin="accesskey(&#x21;)" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/accesskey-entity-2.svg b/layout/reftests/svg/smil/event/accesskey-entity-2.svg
new file mode 100644
index 000000000..549b88756
--- /dev/null
+++ b/layout/reftests/svg/smil/event/accesskey-entity-2.svg
@@ -0,0 +1,15 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ keypress(0x0D);
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <circle id="circle" r="10"/>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="fill" attributeType="CSS"
+ to="green" begin="accesskey(&#x0D;)" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-begin-1.svg b/layout/reftests/svg/smil/event/event-begin-1.svg
new file mode 100644
index 000000000..3b87def1d
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-begin-1.svg
@@ -0,0 +1,16 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ click('circle');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <circle id="circle" r="10"/>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="fill" attributeType="CSS"
+ to="green"
+ begin="circle.click" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-begin-load-1.svg b/layout/reftests/svg/smil/event/event-begin-load-1.svg
new file mode 100644
index 000000000..e53d845e1
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-begin-load-1.svg
@@ -0,0 +1,14 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait" id="svg"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="fill" attributeType="CSS"
+ to="green"
+ begin="svg.SVGLoad" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-begin-offset-1.svg b/layout/reftests/svg/smil/event/event-begin-offset-1.svg
new file mode 100644
index 000000000..30b541b8d
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-begin-offset-1.svg
@@ -0,0 +1,16 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ click('circle');
+ delayedSnapshot(6)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <circle id="circle" r="10"/>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="fill" attributeType="CSS"
+ to="green"
+ begin="circle.click+4s" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-begin-offset-2.svg b/layout/reftests/svg/smil/event/event-begin-offset-2.svg
new file mode 100644
index 000000000..f1e503cf0
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-begin-offset-2.svg
@@ -0,0 +1,16 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(4);
+ click('circle');
+ delayedSnapshot(4)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <circle id="circle" r="10"/>
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green" calcMode="discrete"
+ begin="circle.click-4s" dur="8s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-begin-timeevent-1.svg b/layout/reftests/svg/smil/event/event-begin-timeevent-1.svg
new file mode 100644
index 000000000..37fa8d9c8
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-begin-timeevent-1.svg
@@ -0,0 +1,17 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ /* Make sure the event gets fired */
+ document.documentElement.setCurrentTime(0.1);
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="x" to="0" begin="0s" id="a"/>
+ <set attributeName="fill" attributeType="CSS"
+ to="green"
+ begin="a.beginEvent" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-begin-timeevent-2.svg b/layout/reftests/svg/smil/event/event-begin-timeevent-2.svg
new file mode 100644
index 000000000..6472fab70
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-begin-timeevent-2.svg
@@ -0,0 +1,18 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ /* Make sure the event gets fired */
+ document.documentElement.setCurrentTime(0.1);
+ document.documentElement.setCurrentTime(0.6);
+ delayedSnapshot(2.5)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="x" to="0" begin="0s" dur="0.5s" id="a"/>
+ <set attributeName="fill" attributeType="CSS"
+ to="green"
+ begin="a.endEvent" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-begin-timeevent-3.svg b/layout/reftests/svg/smil/event/event-begin-timeevent-3.svg
new file mode 100644
index 000000000..35247ed46
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-begin-timeevent-3.svg
@@ -0,0 +1,36 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="fastForwardToEvent()">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <script type="text/javascript">
+ const gTimeoutDur = 60000; // Time until we give up waiting for events in ms
+ var timeoutID;
+ function fastForwardToEvent()
+ {
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(4.99);
+ // This test is designed to pass quickly and fail slowly.
+ //
+ // In the success case, the second animation will start almost
+ // immediately, fire a beginEvent and trigger gotBegin below.
+ //
+ // In the failure case, the following timeout will fire (after
+ // gTimeoutDur), we'll seek to t=1s (to make sure we show the red
+ // square) and then finish.
+ timeoutID = window.setTimeout(finish, gTimeoutDur,
+ 1 /*seekTimeInSeconds*/);
+ document.documentElement.unpauseAnimations();
+ }
+ function gotBegin()
+ {
+ window.clearTimeout(timeoutID);
+ finish();
+ }
+ </script>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="x" to="0" begin="0s" dur="5s" repeatCount="2" id="a"/>
+ <set attributeName="fill" attributeType="CSS" to="green"
+ begin="a.repeatEvent" onbegin="gotBegin()"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-bubble-1.svg b/layout/reftests/svg/smil/event/event-bubble-1.svg
new file mode 100644
index 000000000..b4b4ed4cd
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-bubble-1.svg
@@ -0,0 +1,18 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ click('circle');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <g id="g">
+ <circle id="circle" r="10"/>
+ </g>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="fill" attributeType="CSS"
+ to="green"
+ begin="g.click" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-custom-1.svg b/layout/reftests/svg/smil/event/event-custom-1.svg
new file mode 100644
index 000000000..c3b9a50d3
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-custom-1.svg
@@ -0,0 +1,26 @@
+<!-- Tests support for custom events -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="sendEvent()">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <script type="text/javascript">
+ function sendEvent()
+ {
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ var evt = document.createEvent("SVGEvents");
+ evt.initEvent("user.defined", false, false);
+ var target = document.getElementById('rect');
+ target.dispatchEvent(evt);
+ delayedSnapshot(2);
+ }
+ </script>
+ <rect width="100" height="100" fill="red" id="rect">
+ <!-- SMIL allows periods to be embedded in the event name by escaping them
+ with a backslash. (Otherwise the part before the period would be
+ treated as an ID reference.) Test that we support that. -->
+ <set attributeName="fill" attributeType="CSS" to="green"
+ begin="rect.user\.defined" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-end-1.svg b/layout/reftests/svg/smil/event/event-end-1.svg
new file mode 100644
index 000000000..b846de94d
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-end-1.svg
@@ -0,0 +1,16 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(2);
+ click('circle');
+ delayedSnapshot(3)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <circle id="circle" r="10"/>
+ <rect width="100" height="100" fill="green">
+ <set attributeName="fill" attributeType="CSS"
+ to="red"
+ begin="1s" end="circle.click" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-end-2.svg b/layout/reftests/svg/smil/event/event-end-2.svg
new file mode 100644
index 000000000..36bbb9f26
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-end-2.svg
@@ -0,0 +1,18 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ /* Click event should be ignored since the element is inactive as per
+ * SMIL's event sensitivity rules */
+ click('circle');
+ delayedSnapshot(3)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <circle id="circle" r="10"/>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="fill" attributeType="CSS"
+ to="green"
+ begin="1s" end="circle.click+2s" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-end-open-1.svg b/layout/reftests/svg/smil/event/event-end-open-1.svg
new file mode 100644
index 000000000..0b9afb913
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-end-open-1.svg
@@ -0,0 +1,20 @@
+<!--
+ Generally speaking, when constructing intervals if all the end instance times
+ are before the next begin time there's no valid interval.
+
+ However, SMIL specifically makes an exception when the end attribute has event
+ conditions in which case an unresolved end is used.
+ -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(2);
+ document.documentElement.removeAttribute('class')">
+ <circle id="circle" r="10"/>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="fill" attributeType="CSS" to="green"
+ begin="0s; 2s" end="1s; circle.click"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-end-trimmed-1.svg b/layout/reftests/svg/smil/event/event-end-trimmed-1.svg
new file mode 100644
index 000000000..d4c06b599
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-end-trimmed-1.svg
@@ -0,0 +1,17 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(1);
+ document.getElementById('a').setAttribute('end', '0s');
+ /* Force a sample to make sure that event gets fired */
+ document.documentElement.setCurrentTime(1);
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="x" to="0" begin="0.5s" dur="10s" id="a"/>
+ <set attributeName="fill" attributeType="CSS"
+ to="green" begin="a.endEvent" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-preventDefault-1.svg b/layout/reftests/svg/smil/event/event-preventDefault-1.svg
new file mode 100644
index 000000000..4ebadda39
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-preventDefault-1.svg
@@ -0,0 +1,16 @@
+<!-- Calling preventDefault on the event should have no effect -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ click('circle');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <circle id="circle" r="10" onclick="evt.preventDefault()"/>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="fill" attributeType="CSS"
+ to="green" begin="circle.click" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-seek-1.svg b/layout/reftests/svg/smil/event/event-seek-1.svg
new file mode 100644
index 000000000..727c244c6
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-seek-1.svg
@@ -0,0 +1,20 @@
+<!-- Test a backwards seek with an event-generated time -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ id="svg"
+ class="reftest-wait">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <script type="text/javascript">
+ function seek()
+ {
+ document.documentElement.setCurrentTime(40);
+ finish(30);
+ }
+ document.addEventListener("MozReftestInvalidate", seek, false);
+ setTimeout(seek, 4000); // fallback for running outside reftest
+ </script>
+ <rect width="100" height="100" fill="red">
+ <set attributeName="fill" attributeType="CSS" to="green"
+ begin="svg.SVGLoad+20s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-target-default-1.svg b/layout/reftests/svg/smil/event/event-target-default-1.svg
new file mode 100644
index 000000000..2fedc4036
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-target-default-1.svg
@@ -0,0 +1,15 @@
+<!-- Test default parent target -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ click('rect');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <rect width="100" height="100" fill="red" id="rect">
+ <set attributeName="fill" attributeType="CSS" to="green"
+ begin="click" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-target-default-2.svg b/layout/reftests/svg/smil/event/event-target-default-2.svg
new file mode 100644
index 000000000..dec770e7e
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-target-default-2.svg
@@ -0,0 +1,14 @@
+<!-- Test default target with xlink:href -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ click('rect');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <rect width="100" height="100" fill="red" id="rect"/>
+ <set xlink:href="#rect" attributeName="fill" attributeType="CSS" to="green"
+ begin="click" dur="4s"/>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-target-id-change-1.svg b/layout/reftests/svg/smil/event/event-target-id-change-1.svg
new file mode 100644
index 000000000..836ebc9d4
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-target-id-change-1.svg
@@ -0,0 +1,15 @@
+<!-- Test that changes to ID assignments are reflected in event registration -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ document.getElementById('square').setAttribute('id', 'rect');
+ click('rect');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <rect width="100" height="100" fill="red" id="square"/>
+ <set xlink:href="#rect" attributeName="fill" attributeType="CSS" to="green"
+ begin="click" dur="4s"/>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-target-id-change-2.svg b/layout/reftests/svg/smil/event/event-target-id-change-2.svg
new file mode 100644
index 000000000..2046eb9c8
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-target-id-change-2.svg
@@ -0,0 +1,16 @@
+<!-- Test that changes to ID assignments are reflected in event registration.
+ Test for when the animation target becomes invalid. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ document.getElementById('rect').setAttribute('id', 'square');
+ click('square');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <rect width="100" height="100" fill="green" id="rect"/>
+ <set xlink:href="#rect" attributeName="fill" attributeType="CSS" to="red"
+ begin="click" dur="4s"/>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-target-id-change-3.svg b/layout/reftests/svg/smil/event/event-target-id-change-3.svg
new file mode 100644
index 000000000..9e73efb26
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-target-id-change-3.svg
@@ -0,0 +1,16 @@
+<!-- Test that changes to ID assignments are reflected in event registration.
+ Test with end specifications. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(1);
+ document.getElementById('square').setAttribute('id', 'rect');
+ click('rect');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <rect width="100" height="100" fill="green" id="square"/>
+ <set xlink:href="#rect" attributeName="fill" attributeType="CSS" to="red"
+ begin="0s" end="click" dur="4s"/>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-target-non-svg-1.xhtml b/layout/reftests/svg/smil/event/event-target-non-svg-1.xhtml
new file mode 100644
index 000000000..d57948d6c
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-target-non-svg-1.xhtml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<!--
+ Test for non-SVG event bases. This isn't strictly required but we at very
+ least we want to make sure our behaviour is defined.
+ -->
+<head>
+<script src="event-util.js" type="text/javascript"></script>
+<script>
+function snapshot() {
+ var svg = document.getElementById("svg");
+ svg.pauseAnimations();
+ svg.setCurrentTime(0);
+ click('a');
+ var a = document.getElementById('a');
+ a.style.display = 'none';
+ window.setTimeout(doSnapshot, 10);
+}
+
+function doSnapshot() {
+ var svg = document.getElementById("svg");
+ svg.pauseAnimations();
+ svg.setCurrentTime(2);
+ document.documentElement.removeAttribute("class");
+}
+
+document.addEventListener("MozReftestInvalidate", snapshot, false);
+setTimeout(snapshot, 4000); // fallback for running outside reftest
+
+</script>
+</head>
+<body>
+<a href="#" id="a">Play!</a>
+<svg xmlns="http://www.w3.org/2000/svg" width="120px" height="120px" id="svg">
+ <rect width="100" height="100" fill="red">
+ <set attributeName="fill" attributeType="CSS" to="green"
+ begin="a.click" dur="4s"/>
+ </rect>
+</svg>
+</body>
+</html>
diff --git a/layout/reftests/svg/smil/event/event-target-surgery-1.svg b/layout/reftests/svg/smil/event/event-target-surgery-1.svg
new file mode 100644
index 000000000..9959a14df
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-target-surgery-1.svg
@@ -0,0 +1,17 @@
+<!-- Test that animations are unregistered when removed -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ document.getElementById('rect').removeChild(
+ document.getElementById('anim'));
+ click('rect');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <rect width="100" height="100" fill="green" id="rect">
+ <set attributeName="fill" attributeType="CSS"
+ to="red" begin="click" dur="4s" id="anim"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-target-surgery-2.svg b/layout/reftests/svg/smil/event/event-target-surgery-2.svg
new file mode 100644
index 000000000..b9a778b38
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-target-surgery-2.svg
@@ -0,0 +1,15 @@
+<!-- Test that animations are unregistered when removed -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ document.documentElement.removeChild(document.getElementById('anim'));
+ click('rect');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <rect width="100" height="100" fill="green" id="rect"/>
+ <set xlink:href="#rect" attributeName="fill" attributeType="CSS"
+ to="red" begin="click" dur="4s" id="anim"/>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-target-surgery-3.svg b/layout/reftests/svg/smil/event/event-target-surgery-3.svg
new file mode 100644
index 000000000..cf68fc691
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-target-surgery-3.svg
@@ -0,0 +1,32 @@
+<!-- Test that event registration is updated when reparenting -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="reparent()">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <script type="text/javascript">
+ function reparent()
+ {
+ var svg = document.documentElement;
+ svg.pauseAnimations();
+ svg.setCurrentTime(0);
+ var circle = document.getElementById('circle');
+ var rect = document.getElementById('rect');
+ var animmove = document.getElementById('anim-move');
+ var animcolor = document.getElementById('anim-color');
+ circle.appendChild(animmove);
+ rect.appendChild(animcolor);
+ click('rect');
+ delayedSnapshot(2);
+ }
+ </script>
+ <circle id="circle" r="10">
+ <set attributeName="fill" attributeType="CSS"
+ to="green" begin="click" dur="4s" id="anim-color"/>
+ </circle>
+ <rect width="100" height="100" fill="red" id="rect">
+ <animateTransform attributeName="transform" type="translate"
+ values="100; 100" calcMode="discrete"
+ begin="click" dur="4s" id="anim-move"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-target-xlink-change-1.svg b/layout/reftests/svg/smil/event/event-target-xlink-change-1.svg
new file mode 100644
index 000000000..f742e9276
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-target-xlink-change-1.svg
@@ -0,0 +1,17 @@
+<!-- Test that changes to animation targets update event registration. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ document.getElementById('anim').setAttributeNS(
+ 'http://www.w3.org/1999/xlink', 'href', '#rect');
+ click('rect');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <circle id="circle" r="10"/>
+ <rect width="100" height="100" fill="red" id="rect"/>
+ <set xlink:href="#circle" attributeName="fill" attributeType="CSS" to="green"
+ begin="click" dur="4s" id="anim"/>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-target-xlink-change-2.svg b/layout/reftests/svg/smil/event/event-target-xlink-change-2.svg
new file mode 100644
index 000000000..0b8283f8b
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-target-xlink-change-2.svg
@@ -0,0 +1,18 @@
+<!-- Test that changes to animation targets update event registration. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ document.getElementById('anim').setAttributeNS(
+ 'http://www.w3.org/1999/xlink', 'href', '#circle');
+ click('rect');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <circle id="circle" r="10"/>
+ <rect width="100" height="100" fill="green" id="rect">
+ <set attributeName="fill" attributeType="CSS"
+ to="red" begin="click" dur="4s" id="anim"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-target-xlink-change-3.svg b/layout/reftests/svg/smil/event/event-target-xlink-change-3.svg
new file mode 100644
index 000000000..d88f1aa77
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-target-xlink-change-3.svg
@@ -0,0 +1,18 @@
+<!-- Test that changes to animation targets update event registration. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ document.getElementById('anim').removeAttributeNS(
+ 'http://www.w3.org/1999/xlink', 'href');
+ click('rect');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <circle id="circle" r="10"/>
+ <rect width="100" height="100" fill="red" id="rect">
+ <set xlink:href="#circle" attributeName="fill" attributeType="CSS"
+ to="green" begin="click" dur="4s" id="anim"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-target-xlink-change-4.svg b/layout/reftests/svg/smil/event/event-target-xlink-change-4.svg
new file mode 100644
index 000000000..14e6a4655
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-target-xlink-change-4.svg
@@ -0,0 +1,18 @@
+<!-- Test that changes to animation targets update event registration. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ document.getElementById('anim').removeAttributeNS(
+ 'http://www.w3.org/1999/xlink', 'href');
+ click('circle');
+ delayedSnapshot(2)">
+ <script xlink:href="event-util.js" type="text/javascript"/>
+ <circle id="circle" r="10"/>
+ <rect width="100" height="100" fill="green" id="rect">
+ <set xlink:href="#circle" attributeName="fill" attributeType="CSS"
+ to="red" begin="click" dur="4s" id="anim"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/event/event-util.js b/layout/reftests/svg/smil/event/event-util.js
new file mode 100644
index 000000000..0af17e102
--- /dev/null
+++ b/layout/reftests/svg/smil/event/event-util.js
@@ -0,0 +1,37 @@
+// Allows a moment for events to be processed then performs a seek and runs
+// a snapshot.
+function delayedSnapshot(seekTimeInSeconds)
+{
+ // Allow time for events to be processed
+ window.setTimeout(finish, 10, seekTimeInSeconds);
+}
+
+function finish(seekTimeInSeconds)
+{
+ document.documentElement.pauseAnimations();
+ if (seekTimeInSeconds)
+ document.documentElement.setCurrentTime(seekTimeInSeconds);
+ document.documentElement.removeAttribute("class");
+}
+
+function click(targetId)
+{
+ var evt = document.createEvent("MouseEvents");
+ evt.initMouseEvent("click", true, true, window,
+ 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ var target = document.getElementById(targetId);
+ target.dispatchEvent(evt);
+}
+
+function keypress(charCode)
+{
+ var evt = document.createEvent("KeyboardEvent");
+ evt.initKeyEvent("keypress", true, true, window,
+ false, // ctrlKeyArg
+ false, // altKeyArg
+ false, // shiftKeyArg
+ false, // metaKeyArg
+ 0, // keyCode
+ charCode);
+ document.documentElement.dispatchEvent(evt);
+}
diff --git a/layout/reftests/svg/smil/event/green-box-ref.svg b/layout/reftests/svg/smil/event/green-box-ref.svg
new file mode 100644
index 000000000..120941444
--- /dev/null
+++ b/layout/reftests/svg/smil/event/green-box-ref.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect width="100" height="100" fill="green"/>
+</svg>
diff --git a/layout/reftests/svg/smil/event/green-box-ref.xhtml b/layout/reftests/svg/smil/event/green-box-ref.xhtml
new file mode 100644
index 000000000..ce0bc78f1
--- /dev/null
+++ b/layout/reftests/svg/smil/event/green-box-ref.xhtml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" width="120px" height="120px">
+ <rect width="100" height="100" fill="green"/>
+</svg>
+</body>
+</html>
diff --git a/layout/reftests/svg/smil/event/reftest-stylo.list b/layout/reftests/svg/smil/event/reftest-stylo.list
new file mode 100644
index 000000000..b70cafd53
--- /dev/null
+++ b/layout/reftests/svg/smil/event/reftest-stylo.list
@@ -0,0 +1,33 @@
+# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
+# Tests related to SVG Animation (using SMIL) that use event timing.
+
+== event-begin-1.svg event-begin-1.svg
+== event-begin-offset-1.svg event-begin-offset-1.svg
+== event-begin-offset-2.svg event-begin-offset-2.svg
+== event-begin-timeevent-1.svg event-begin-timeevent-1.svg
+== event-begin-timeevent-2.svg event-begin-timeevent-2.svg
+random-if(Android) == event-begin-timeevent-3.svg event-begin-timeevent-3.svg
+== event-begin-load-1.svg event-begin-load-1.svg
+== event-bubble-1.svg event-bubble-1.svg
+== event-custom-1.svg event-custom-1.svg
+== event-end-1.svg event-end-1.svg
+== event-end-2.svg event-end-2.svg
+== event-end-open-1.svg event-end-open-1.svg
+== event-end-trimmed-1.svg event-end-trimmed-1.svg
+== event-preventDefault-1.svg event-preventDefault-1.svg
+== event-seek-1.svg event-seek-1.svg
+== event-target-default-1.svg event-target-default-1.svg
+== event-target-default-2.svg event-target-default-2.svg
+== event-target-id-change-1.svg event-target-id-change-1.svg
+== event-target-id-change-2.svg event-target-id-change-2.svg
+== event-target-id-change-3.svg event-target-id-change-3.svg
+== event-target-xlink-change-1.svg event-target-xlink-change-1.svg
+== event-target-xlink-change-2.svg event-target-xlink-change-2.svg
+== event-target-xlink-change-3.svg event-target-xlink-change-3.svg
+== event-target-xlink-change-4.svg event-target-xlink-change-4.svg
+== event-target-surgery-1.svg event-target-surgery-1.svg
+skip == event-target-surgery-2.svg event-target-surgery-2.svg
+== event-target-surgery-3.svg event-target-surgery-3.svg
+skip == event-target-non-svg-1.xhtml event-target-non-svg-1.xhtml
+== accesskey-entity-1.svg accesskey-entity-1.svg
+== accesskey-entity-2.svg accesskey-entity-2.svg
diff --git a/layout/reftests/svg/smil/event/reftest.list b/layout/reftests/svg/smil/event/reftest.list
new file mode 100644
index 000000000..02b845b07
--- /dev/null
+++ b/layout/reftests/svg/smil/event/reftest.list
@@ -0,0 +1,32 @@
+# Tests related to SVG Animation (using SMIL) that use event timing.
+
+== event-begin-1.svg green-box-ref.svg
+== event-begin-offset-1.svg green-box-ref.svg
+== event-begin-offset-2.svg green-box-ref.svg
+== event-begin-timeevent-1.svg green-box-ref.svg
+== event-begin-timeevent-2.svg green-box-ref.svg
+random-if(Android) == event-begin-timeevent-3.svg green-box-ref.svg
+== event-begin-load-1.svg green-box-ref.svg
+== event-bubble-1.svg green-box-ref.svg
+== event-custom-1.svg green-box-ref.svg
+== event-end-1.svg green-box-ref.svg
+== event-end-2.svg green-box-ref.svg
+== event-end-open-1.svg green-box-ref.svg
+== event-end-trimmed-1.svg green-box-ref.svg
+== event-preventDefault-1.svg green-box-ref.svg
+== event-seek-1.svg green-box-ref.svg
+== event-target-default-1.svg green-box-ref.svg
+== event-target-default-2.svg green-box-ref.svg
+== event-target-id-change-1.svg green-box-ref.svg
+== event-target-id-change-2.svg green-box-ref.svg
+== event-target-id-change-3.svg green-box-ref.svg
+== event-target-xlink-change-1.svg green-box-ref.svg
+== event-target-xlink-change-2.svg green-box-ref.svg
+== event-target-xlink-change-3.svg green-box-ref.svg
+== event-target-xlink-change-4.svg green-box-ref.svg
+== event-target-surgery-1.svg green-box-ref.svg
+== event-target-surgery-2.svg green-box-ref.svg
+== event-target-surgery-3.svg green-box-ref.svg
+== event-target-non-svg-1.xhtml green-box-ref.xhtml
+== accesskey-entity-1.svg green-box-ref.svg
+== accesskey-entity-2.svg green-box-ref.svg