summaryrefslogtreecommitdiffstats
path: root/layout/reftests/svg/smil/syncbase
diff options
context:
space:
mode:
Diffstat (limited to 'layout/reftests/svg/smil/syncbase')
-rw-r--r--layout/reftests/svg/smil/syncbase/changed-interval-change-spec-1.svg21
-rw-r--r--layout/reftests/svg/smil/syncbase/changed-interval-change-spec-2.svg22
-rw-r--r--layout/reftests/svg/smil/syncbase/changed-interval-change-spec-3.svg22
-rw-r--r--layout/reftests/svg/smil/syncbase/changed-interval-change-spec-4.svg27
-rw-r--r--layout/reftests/svg/smil/syncbase/changed-interval-resolved-1.svg18
-rw-r--r--layout/reftests/svg/smil/syncbase/changed-interval-resolved-2.svg20
-rw-r--r--layout/reftests/svg/smil/syncbase/changed-interval-simple-1.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/changed-interval-simple-2.svg21
-rw-r--r--layout/reftests/svg/smil/syncbase/changed-interval-simple-3.svg21
-rw-r--r--layout/reftests/svg/smil/syncbase/changed-interval-simple-4.svg18
-rw-r--r--layout/reftests/svg/smil/syncbase/changed-interval-simple-5.svg21
-rw-r--r--layout/reftests/svg/smil/syncbase/changed-interval-sort-1.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/cross-container-1.xhtml33
-rw-r--r--layout/reftests/svg/smil/syncbase/cross-container-2.xhtml43
-rw-r--r--layout/reftests/svg/smil/syncbase/cross-container-3.xhtml63
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-change-1.svg20
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-change-2.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-delete-1.svg20
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-invalid-1.svg16
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-invalid-2.svg18
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-invalid-3.svg54
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-invalid-4.svg33
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-ok-1.svg16
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-ok-2.svg20
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-ok-3.svg34
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-ok-4.svg20
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-ok-5.svg23
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-recursion-1.svg42
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-recursion-2.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-self-ref-1.svg14
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-self-ref-2.svg14
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-self-ref-3.svg19
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-self-ref-4.svg32
-rw-r--r--layout/reftests/svg/smil/syncbase/cycle-self-ref-5.svg56
-rw-r--r--layout/reftests/svg/smil/syncbase/deleted-interval-simple-1.svg22
-rw-r--r--layout/reftests/svg/smil/syncbase/deleted-interval-simple-2.svg26
-rw-r--r--layout/reftests/svg/smil/syncbase/deleted-interval-simple-3.svg21
-rw-r--r--layout/reftests/svg/smil/syncbase/deleted-interval-simple-4.svg26
-rw-r--r--layout/reftests/svg/smil/syncbase/deleted-interval-simple-5.svg21
-rw-r--r--layout/reftests/svg/smil/syncbase/filtered-interval-1.svg24
-rw-r--r--layout/reftests/svg/smil/syncbase/green-box-ref.svg3
-rw-r--r--layout/reftests/svg/smil/syncbase/green-box-ref.xhtml8
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-chain-1.svg22
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-chain-2.svg22
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-doubly-dependent-1.svg16
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-doubly-dependent-2.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-doubly-dependent-3.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-early-end-1.svg18
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-early-end-2.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-early-end-3.svg18
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-early-end-4.svg26
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-early-end-5.svg19
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-early-end-6.svg16
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-early-end-7.svg22
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-end-dep-1.svg16
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-end-negative-1.svg39
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-end-negative-2.svg18
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-freeze-begin-1.svg31
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-negative-offset-1.svg16
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-negative-offset-2.svg30
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-negative-offset-3.svg18
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-negative-offset-4.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-negative-syncbase-1.svg16
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-restart-1.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-restart-2.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-restart-3.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-sample-order-1.svg29
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-simple-1.svg16
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-simple-2.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-triply-dependent-1.svg16
-rw-r--r--layout/reftests/svg/smil/syncbase/new-interval-triply-dependent-2.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/reftest.list99
-rw-r--r--layout/reftests/svg/smil/syncbase/sandwich-priority-1.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/sandwich-priority-10.svg26
-rw-r--r--layout/reftests/svg/smil/syncbase/sandwich-priority-11.svg18
-rw-r--r--layout/reftests/svg/smil/syncbase/sandwich-priority-12.svg24
-rw-r--r--layout/reftests/svg/smil/syncbase/sandwich-priority-2.svg18
-rw-r--r--layout/reftests/svg/smil/syncbase/sandwich-priority-3.svg20
-rw-r--r--layout/reftests/svg/smil/syncbase/sandwich-priority-4.svg15
-rw-r--r--layout/reftests/svg/smil/syncbase/sandwich-priority-5.svg20
-rw-r--r--layout/reftests/svg/smil/syncbase/sandwich-priority-6.svg17
-rw-r--r--layout/reftests/svg/smil/syncbase/sandwich-priority-7.svg27
-rw-r--r--layout/reftests/svg/smil/syncbase/sandwich-priority-8.svg25
-rw-r--r--layout/reftests/svg/smil/syncbase/sandwich-priority-9.svg21
-rw-r--r--layout/reftests/svg/smil/syncbase/trimmed-interval-1.svg22
85 files changed, 1966 insertions, 0 deletions
diff --git a/layout/reftests/svg/smil/syncbase/changed-interval-change-spec-1.svg b/layout/reftests/svg/smil/syncbase/changed-interval-change-spec-1.svg
new file mode 100644
index 0000000000..5952d99125
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/changed-interval-change-spec-1.svg
@@ -0,0 +1,21 @@
+<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.5);
+ document.getElementById('a').removeAttribute('begin');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Deleting the begin spec whilst the element is active should not cause
+ a change notification to be generated.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="10s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="green"
+ begin="a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/changed-interval-change-spec-2.svg b/layout/reftests/svg/smil/syncbase/changed-interval-change-spec-2.svg
new file mode 100644
index 0000000000..c2db156479
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/changed-interval-change-spec-2.svg
@@ -0,0 +1,22 @@
+<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.2);
+ document.getElementById('a').removeAttribute('begin');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Deleting the begin spec whilst the syncbase element is active should not
+ cause a change notification to be generated since the begin time is fixed
+ once the element is active.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="10s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="green"
+ begin="a.begin+0.5s" dur="1s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/changed-interval-change-spec-3.svg b/layout/reftests/svg/smil/syncbase/changed-interval-change-spec-3.svg
new file mode 100644
index 0000000000..103b0e780c
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/changed-interval-change-spec-3.svg
@@ -0,0 +1,22 @@
+<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.2);
+ document.getElementById('a').setAttribute('begin', '0s');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Changing the begin spec whilst the syncbase element is active should not
+ cause a change notification to be generated since the begin time is fixed
+ once the element is active.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="10s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="green"
+ begin="a.begin+0.5s" dur="1s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/changed-interval-change-spec-4.svg b/layout/reftests/svg/smil/syncbase/changed-interval-change-spec-4.svg
new file mode 100644
index 0000000000..ef7ba61a94
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/changed-interval-change-spec-4.svg
@@ -0,0 +1,27 @@
+<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('b').removeAttribute('begin');
+ document.getElementById('a').setAttribute('dur', '1s');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ 1. Initially, we have a begin time that is dependent on an unresolved time
+ (a.end).
+ 2. The begin attribute that created the begin time is then removed.
+ 3. The base interval on which the begin time is dependent is then resolved.
+
+ In this case, the unresolved dependent begin should have been cleared in
+ at point 2 and no new interval should be created.
+ -->
+ <rect width="100" height="100" fill="green">
+ <!-- Base interval with unresolved end time -->
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"/>
+ <!-- Dependent interval -->
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="red" begin="a.end" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/changed-interval-resolved-1.svg b/layout/reftests/svg/smil/syncbase/changed-interval-resolved-1.svg
new file mode 100644
index 0000000000..d6bbd1da78
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/changed-interval-resolved-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ When the animations are initially set up there's potential for a change
+ notification once b is resolved.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="10s; b.begin" dur="10s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin" dur="2s"/>
+ <set attributeName="y" begin="1s" id="b" to="0"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/changed-interval-resolved-2.svg b/layout/reftests/svg/smil/syncbase/changed-interval-resolved-2.svg
new file mode 100644
index 0000000000..d4b3c681ef
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/changed-interval-resolved-2.svg
@@ -0,0 +1,20 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="
+ document.getElementById('c').setAttribute('id', 'b');
+ setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ When the animations are initially set up a change notice should resolved
+ when c's id is updated to b.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="10s; b.begin" dur="10s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin" dur="2s"/>
+ <set attributeName="y" begin="1s" id="c" to="0"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/changed-interval-simple-1.svg b/layout/reftests/svg/smil/syncbase/changed-interval-simple-1.svg
new file mode 100644
index 0000000000..3ba8c6687d
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/changed-interval-simple-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A simple case of a changing interval.
+ The end will be updated when the syncbase does an early end.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s; 1s" dur="10s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.end" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/changed-interval-simple-2.svg b/layout/reftests/svg/smil/syncbase/changed-interval-simple-2.svg
new file mode 100644
index 0000000000..fc7756800f
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/changed-interval-simple-2.svg
@@ -0,0 +1,21 @@
+<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('a').beginElementAt(1);
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ We'll add another begin instance time at t=1s for 'a' by script, causing a
+ change notification.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="10s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/changed-interval-simple-3.svg b/layout/reftests/svg/smil/syncbase/changed-interval-simple-3.svg
new file mode 100644
index 0000000000..ae5f28fbfb
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/changed-interval-simple-3.svg
@@ -0,0 +1,21 @@
+<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('a').endElementAt(1);
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ We'll add another end instance time at t=1s for 'a' by script, causing a
+ change notification.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.end" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/changed-interval-simple-4.svg b/layout/reftests/svg/smil/syncbase/changed-interval-simple-4.svg
new file mode 100644
index 0000000000..671e9cd370
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/changed-interval-simple-4.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ An early end should generate two change notices here and because
+ restart="whenNotActive" we should only apply the earlier one, regardless of
+ what order they arrive in.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s; 1.5s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.end; a.end-0.5s" dur="2s" restart="whenNotActive"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/changed-interval-simple-5.svg b/layout/reftests/svg/smil/syncbase/changed-interval-simple-5.svg
new file mode 100644
index 0000000000..07648813c1
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/changed-interval-simple-5.svg
@@ -0,0 +1,21 @@
+<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('a').removeAttribute('begin');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Changing the begin attribute by script should cause a change notice to be
+ generated.
+ -->
+ <rect width="100" height="100" fill="green">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="10s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="red; red"
+ begin="a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/changed-interval-sort-1.svg b/layout/reftests/svg/smil/syncbase/changed-interval-sort-1.svg
new file mode 100644
index 0000000000..6fbd62a462
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/changed-interval-sort-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A simple case of a changing interval to check that instances times are
+ re-sorted.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s; 1s" dur="10s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="3s; a.end" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cross-container-1.xhtml b/layout/reftests/svg/smil/syncbase/cross-container-1.xhtml
new file mode 100644
index 0000000000..72d7eb782e
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cross-container-1.xhtml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<!--
+ The simplest possible test of a cross-time container dependency.
+ -->
+<head>
+<script>
+function snapshot() {
+ var a = document.getElementById("svg-a");
+ var b = document.getElementById("svg-b");
+ b.pauseAnimations();
+ a.pauseAnimations();
+ b.setCurrentTime(1); // In document time, 'b' has now begun and therefore so
+ // has 'a'
+ a.setCurrentTime(1); // So we only need seek forward 1s to get to the middle
+ // of the animation
+ document.documentElement.removeAttribute("class");
+}
+</script>
+</head>
+<body onload="snapshot()">
+<svg xmlns="http://www.w3.org/2000/svg" width="120px" height="120px" id="svg-a">
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="fill" attributeType="CSS" id="a"
+ values="orange; green; purple" calcMode="discrete"
+ begin="b.begin" dur="2s"/>
+ </rect>
+</svg>
+<svg xmlns="http://www.w3.org/2000/svg" width="120px" height="120px" id="svg-b">
+ <set attributeName="y" to="0" begin="1s" id="b"/>
+</svg>
+</body>
+</html>
diff --git a/layout/reftests/svg/smil/syncbase/cross-container-2.xhtml b/layout/reftests/svg/smil/syncbase/cross-container-2.xhtml
new file mode 100644
index 0000000000..272b65ae75
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cross-container-2.xhtml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<!--
+ Check that pausing the base time container makes dependent times unresolved.
+ -->
+<head>
+<script><!----><![CDATA[
+function snapshot() {
+ var a = document.getElementById("svg-a");
+ var b = document.getElementById("svg-b");
+ a.pauseAnimations();
+ b.pauseAnimations();
+ a.setCurrentTime(2); // Since b is paused, the start time of a is now
+ // unresolved.
+ // Check DOM state as well
+ var wrong = document.getElementById("wrong");
+ try {
+ document.getElementById("a").getStartTime();
+ } catch (e) {
+ if (e.name == "InvalidStateError" &&
+ e.code == DOMException.INVALID_STATE_ERR) {
+ wrong.style.setProperty('visibility', 'hidden', '');
+ }
+ }
+ document.documentElement.removeAttribute("class");
+}
+//]]></script>
+</head>
+<body onload="snapshot()">
+<svg xmlns="http://www.w3.org/2000/svg" width="120px" height="120px" id="svg-a">
+ <rect width="100" height="100" fill="green">
+ <set attributeName="fill" to="red" begin="b.begin" id="a"/>
+ </rect>
+ <g id="wrong">
+ <line stroke="black" stroke-width="8" x1="0" y1="0" x2="100" y2="100"/>
+ <line stroke="black" stroke-width="8" x1="0" y1="100" x2="100" y2="0"/>
+ </g>
+</svg>
+<svg xmlns="http://www.w3.org/2000/svg" width="120px" height="120px" id="svg-b">
+ <set attributeName="y" to="0" begin="1s" id="b"/>
+</svg>
+</body>
+</html>
diff --git a/layout/reftests/svg/smil/syncbase/cross-container-3.xhtml b/layout/reftests/svg/smil/syncbase/cross-container-3.xhtml
new file mode 100644
index 0000000000..d5e94ac12e
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cross-container-3.xhtml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<!--
+ Check that calls to beginElement cause the pause time to be updated.
+
+ This is an area that's underspecified so we're just going with what's
+ intuitive. A is supposed to start at the same time as B. However, whilst B is
+ paused, a script calls 'beginElement'. Yet A is not paused. Intuitively,
+ A should start at the time beginElement is called. However, unless we handle
+ this situation specifically, what happens instead is that A is considered to
+ begin at the time when B was paused as follows:
+
+
+ Document time:
+ 0 1 2 3 4 ...
+ A:
+ B: |.......*..........
+ ^ Pause starts here
+ ^ beginElement called here
+
+ Intuitively, A should start at t=2s, not t=1s. To provide this behaviour we
+ must specifically handle it.
+
+ Perhaps a more fundamental question is whether a call to beginElement should
+ take effect whilst the document is paused. Currently it does. This is
+ consistent with Opera but not Safari.
+ -->
+<head>
+<script>
+function snapshot() {
+ var svgb = document.getElementById("svg-b");
+ svgb.pauseAnimations();
+ setTimeout('snapshotB()', 100);
+}
+
+function snapshotB() {
+ var svga = document.getElementById("svg-a");
+ svga.pauseAnimations();
+ var b = document.getElementById("b");
+ b.beginElement();
+ // Force a sample on the first document fragment before taking a snapshot
+ svga.setCurrentTime(svga.getCurrentTime());
+ document.documentElement.removeAttribute("class");
+}
+
+document.addEventListener("MozReftestInvalidate", snapshot, false);
+setTimeout(snapshot, 4000); // fallback for running outside reftest
+
+</script>
+</head>
+<body>
+<svg xmlns="http://www.w3.org/2000/svg" width="120px" height="120px" id="svg-a">
+ <rect width="100" height="100" fill="orange">
+ <animate attributeName="fill" attributeType="CSS" id="a"
+ values="green; red"
+ begin="b.begin" dur="0.5s"/>
+ </rect>
+</svg>
+<svg xmlns="http://www.w3.org/2000/svg" width="120px" height="120px" id="svg-b">
+ <set attributeName="y" to="0" begin="indefinite" id="b"/>
+</svg>
+</body>
+</html>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-change-1.svg b/layout/reftests/svg/smil/syncbase/cycle-change-1.svg
new file mode 100644
index 0000000000..25a3c4ad39
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-change-1.svg
@@ -0,0 +1,20 @@
+<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('a').beginElementAt(1);
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test that cycles don't cause problems for change notices as well.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="b.begin; 3s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="orange; green; purple"
+ begin="a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-change-2.svg b/layout/reftests/svg/smil/syncbase/cycle-change-2.svg
new file mode 100644
index 0000000000..861be05c9a
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-change-2.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test that cycles don't cause problems for change notices as well. In this
+ case we have an early end.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="b.begin; 0s; 1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="orange; green; purple"
+ begin="a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-delete-1.svg b/layout/reftests/svg/smil/syncbase/cycle-delete-1.svg
new file mode 100644
index 0000000000..79408a0483
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-delete-1.svg
@@ -0,0 +1,20 @@
+<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('a').setAttribute('end', '0s');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test that cycles don't cause problems for deleted intervals.
+ -->
+ <rect width="100" height="100" fill="green">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="b.begin; 1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="red; red"
+ begin="a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-invalid-1.svg b/layout/reftests/svg/smil/syncbase/cycle-invalid-1.svg
new file mode 100644
index 0000000000..863de4a938
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-invalid-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ An invalid cycle. Example 1 from SMIL3 section 5.4.5.
+ -->
+ <rect width="100" height="100" fill="green">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="b.begin" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="red"
+ begin="a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-invalid-2.svg b/layout/reftests/svg/smil/syncbase/cycle-invalid-2.svg
new file mode 100644
index 0000000000..97829d6554
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-invalid-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ An invalid cycle. Example 2 From SMIL3 section 5.4.5.
+ -->
+ <rect width="100" height="100" fill="blue">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="c.end" dur="4s"/>
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="b"
+ begin="a.begin" dur="3s"/>
+ <animate attributeName="fill" attributeType="CSS" id="c"
+ values="green; red"
+ begin="0" end="b.end"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-invalid-3.svg b/layout/reftests/svg/smil/syncbase/cycle-invalid-3.svg
new file mode 100644
index 0000000000..9e7d460aff
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-invalid-3.svg
@@ -0,0 +1,54 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ An invalid cycle that propagates backwards.
+ Example 4 from SMIL3 section 5.4.5.
+
+ Regarding cycle detection SMIL 3.0 says:
+
+ "When a cycle is detected, the change propagation is ignored. The element
+ that detected the second visit ignores the second change notice, and so
+ breaks the cycle."
+
+ So we are only concerned with cycles amongst CHANGE notices. We understand
+ this as follows:
+
+ a: 5s-7s
+ new -> b: 4s-6s
+ new -> a: 3s-5s
+ change -> b: 2s-4s
+ change -> a: 1s-3s
+ change -> b: second change notice, break cycle!
+
+ Thus giving us:
+ a: 1s-3s; 3s-5s; 5s-7s
+ b: 2s-4s; 4s-6s
+
+ Opera gives us:
+ a: -1s-1s; 1s-3s; 3s-5s; 5s-7s
+ b: 0s-2s; 2s-4s; 4s-6s
+
+ Safari gives us:
+ a: 3s-5s; 5s-7s
+ b: 2s-4s; 4s-6s
+
+ Batik 1.7 gives:
+ a: 5s-7s
+ b: 4s-6s
+
+ Currently we have the result described above, i.e.
+ a: 1s-3s; 3s-5s; 5s-7s
+ b: 2s-4s; 4s-6s
+
+ -->
+ <rect y="100" width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="-50" to="50" id="a"
+ begin="5s; b.begin-1s" dur="2s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="green; orange"
+ begin="a.begin-1s" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-invalid-4.svg b/layout/reftests/svg/smil/syncbase/cycle-invalid-4.svg
new file mode 100644
index 0000000000..ddf489308d
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-invalid-4.svg
@@ -0,0 +1,33 @@
+<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('a').removeAttribute('dur');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A cycle that is valid at first but then becomes invalid.
+
+ So at first we have:
+ a: 0s-1.5s
+ new -> b: 1.5s-2.5s
+ new -> a: add 1.5s begin instance time
+
+ Remove 'dur' attr:
+ a: 0s-unresolved
+ change -> b: unresolved... delete interval
+ delete -> a: already visited <break>
+
+ a: 0s-unresolved
+ b: unresolved-unresolved
+ -->
+ <rect width="100" height="100" fill="green">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="b.begin; 0s" dur="1.5s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="red; red"
+ begin="a.end" dur="1s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-ok-1.svg b/layout/reftests/svg/smil/syncbase/cycle-ok-1.svg
new file mode 100644
index 0000000000..7040027044
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-ok-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A cycle that should be allowed.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="b.begin; 1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="orange; green; purple"
+ begin="a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-ok-2.svg b/layout/reftests/svg/smil/syncbase/cycle-ok-2.svg
new file mode 100644
index 0000000000..df53f6f80c
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-ok-2.svg
@@ -0,0 +1,20 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A ping-pong cycle that should be allowed.
+ Example 3 from SMIL3 section 5.4.5.
+ We have:
+ t=0s --> b: 0s-1s, a: 1s-2s
+ t=1s --> a: 1s-2s, b: 1.5s->2.5s
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="b.begin+1s" dur="1s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="orange; green; purple"
+ begin="0s; a.begin+0.5s" dur="1s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-ok-3.svg b/layout/reftests/svg/smil/syncbase/cycle-ok-3.svg
new file mode 100644
index 0000000000..7ef9b866c1
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-ok-3.svg
@@ -0,0 +1,34 @@
+<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('c').setAttribute('dur', '1s');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Based on Example 2 from SMIL3 section 5.4.5, an invalid cycle,
+ but made valid by a DOM call.
+
+ At first we have:
+ a: unresolved-unresolved
+ b: unresolved-unresolved
+ c: 0s-unresolved
+
+ Then we set dur on c=1s, giving us
+ a: 1s-1.5s
+ b: 1s-3s
+ c: 0s-1s
+ -->
+ <rect width="100" height="100" fill="blue">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="c.end" dur="0.5s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="orange; green; purple"
+ begin="a.begin" dur="2s"/>
+ <animate attributeName="fill" attributeType="CSS" id="c"
+ values="red; red"
+ begin="0" end="b.end"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-ok-4.svg b/layout/reftests/svg/smil/syncbase/cycle-ok-4.svg
new file mode 100644
index 0000000000..02bd95f928
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-ok-4.svg
@@ -0,0 +1,20 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A cycle that should be allowed. Here ends and begins coincide.
+
+ So we have:
+ a: 0s-1.5s, 1.5s-3s, 3s-4.5s, ...
+ b: 1.5s-2.5s, 3s-4s, ...
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="b.begin; 0s" dur="1.5s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="orange; green; purple"
+ begin="a.end" dur="1s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-ok-5.svg b/layout/reftests/svg/smil/syncbase/cycle-ok-5.svg
new file mode 100644
index 0000000000..f6597a0cc3
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-ok-5.svg
@@ -0,0 +1,23 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ From SVG 1.2 Tiny Test Suite, animate-elem-221-t.svg
+
+ This test case is interesting because begin is not set on the first
+ animation. If we incorrectly detect this as a deleted begin time and thus
+ a deleted interval we get stuck in a loop marking the interval as deleted
+ and the new.
+ -->
+ <rect y="100" width="100" height="100" fill="red">
+ <animate id="a1" attributeName="y" attributeType="XML"
+ from="-20" to="80" dur="10s"
+ end="a1.begin+6s" max="2.5s" />
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple" keyTimes="0; 0.1; 1" dur="10s"
+ begin="1s" end="a1.end+6s"
+ max="7.5s" fill="freeze"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-recursion-1.svg b/layout/reftests/svg/smil/syncbase/cycle-recursion-1.svg
new file mode 100644
index 0000000000..cb0411dc27
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-recursion-1.svg
@@ -0,0 +1,42 @@
+<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('c').removeAttribute('dur');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ At first we have:
+ c: 0s-1s
+ new -> a: 1s-1.5s
+ new -> b: 1s-2s
+ new -> c: 0s-1s [end: 2s]
+
+ Then we remove dur on c giving us:
+ c: 0s-2s
+ change -> a: 2s-2.5s
+ change -> b: 2s-3s
+ change -> c: 0s-3s
+ change -> a: 3s-3.5s [Should break the cycle here]
+ change -> b: 3s-4s
+ change -> c: 0s-4s
+ etc.
+
+ If we break on the second change notice we should arrive at:
+ a: 2s-2.5s
+ b: 2s-3s
+ c: 0s-3s
+ -->
+ <rect x="100" y="100" width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="c.end" dur="0.5s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="green; blue"
+ begin="a.begin" dur="1s"/>
+ <animate attributeName="x" attributeType="XML" id="c"
+ from="0" to="100" fill="freeze"
+ begin="0" end="b.end" dur="1s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-recursion-2.svg b/layout/reftests/svg/smil/syncbase/cycle-recursion-2.svg
new file mode 100644
index 0000000000..df859a5305
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-recursion-2.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ If we don't detect the cycle here, we'll keep doing reverse propagation for
+ a very long time. Probably long enough for something to go really wrong.
+ -->
+ <rect width="100" height="100" fill="green">
+ <animate attributeName="y" attributeType="XML" from="100" to="100" id="a"
+ begin="20h; b.begin-1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="red; red"
+ begin="a.begin-1s" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-self-ref-1.svg b/layout/reftests/svg/smil/syncbase/cycle-self-ref-1.svg
new file mode 100644
index 0000000000..2163529726
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-self-ref-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"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A valid self-referential cycle.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="fill" attributeType="CSS" id="a"
+ values="orange; green; purple"
+ begin="a.begin+1.5s; -0.5s" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-self-ref-2.svg b/layout/reftests/svg/smil/syncbase/cycle-self-ref-2.svg
new file mode 100644
index 0000000000..b5fe6e1dd4
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-self-ref-2.svg
@@ -0,0 +1,14 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A valid self-referential cycle.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="fill" attributeType="CSS" id="a"
+ values="orange; green; purple"
+ begin="a.end; -1s" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-self-ref-3.svg b/layout/reftests/svg/smil/syncbase/cycle-self-ref-3.svg
new file mode 100644
index 0000000000..50fdaf9739
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-self-ref-3.svg
@@ -0,0 +1,19 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A valid self-referential cycle.
+
+ We have a 4s animation which should give us green after 1s of its active
+ duration. The active duration is constrained to 2s using a self-referential
+ end spec. Furthermore a self-referential begin spec causes the animation to
+ restart as soon as it begins.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="fill" attributeType="CSS" id="a"
+ values="orange; green; blue; yellow; purple"
+ begin="a.end; -1s" end="a.begin+2s" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-self-ref-4.svg b/layout/reftests/svg/smil/syncbase/cycle-self-ref-4.svg
new file mode 100644
index 0000000000..c53b3c5fa7
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-self-ref-4.svg
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="byeByeB()">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <script type="text/javascript">
+ function byeByeB()
+ {
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(0);
+ // Drop b
+ var b = document.getElementById('b');
+ b.parentNode.removeChild(b);
+ b = null;
+ // Snapshot at time t=4s. This is because there are two possible error cases
+ // we want to detect:
+ // i) b disappears and we just keep the existing time for a.begin+1s of t=2s
+ // ii) b disappears and we update the time for a.begin+1s to t=3s
+ setTimeAndSnapshot(4, false);
+ }
+ </script>
+ <!-- We have an arrangement where a is dependent on b and itself. If b's
+ interval disappears while a is still in the waiting state then the begin
+ time "a.begin+1s" should disappear too since a never begun. -->
+ <rect width="100" height="100" fill="green">
+ <set id="a" attributeName="fill" attributeType="CSS" to="red"
+ begin="b.begin; a.begin+1s"/>
+ <set id="b" attributeName="y" attributeType="XML" to="0"
+ begin="1s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/cycle-self-ref-5.svg b/layout/reftests/svg/smil/syncbase/cycle-self-ref-5.svg
new file mode 100644
index 0000000000..e0e36e152a
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/cycle-self-ref-5.svg
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="byeByeB()">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <script type="text/javascript">
+ function byeByeB()
+ {
+ document.documentElement.pauseAnimations();
+ document.documentElement.setCurrentTime(2.5);
+ // Drop b
+ var b = document.getElementById('b');
+ b.parentNode.removeChild(b);
+ b = null;
+ setTimeAndSnapshot(8, false);
+ }
+ </script>
+ <!-- Similar to cycle-self-ref-4.svg but with end times.
+
+ We have an arrangement where a's end time is dependent on b and on
+ itself.
+
+ Initially:
+ - a's end time will be resolved as "b.end", i.e. 3s.
+ - Accordingly, the instance time for "a.end+2s" will be 5s (3s+2s).
+ - i.e. a's list of end instance times will be: [3, 5, 9].
+
+ If b's interval disappears (because we delete b):
+ - The end time "b.end" will become unresolved.
+ - i.e. a's list of end instance times will be: [5, 9, unresolved].
+
+ However, when updating a's end time we should not use the "5s" instance
+ time since it is based on a's end time which is what we are updating.
+
+ Expected behaviour:
+ - The instance time of "5s" will be skipped and the time of "9s" will be
+ used instead.
+ - At t=8s the animation will still be playing and the rectangle will be
+ green.
+
+ Failure behaviour:
+ - The next end instance time in the list will be used, giving a an end
+ time of 5s.
+ - The time "a.end+2s" will then be accordingly updated to 7s since a's
+ end time is now 5s. (Any subsequent attempts to update the time will be
+ ignored according to SMIL's cycle detection rules.)
+ - At t=8s the animation will have stopped and the rectangle will be red.
+ -->
+ <rect width="100" height="100" fill="red">
+ <set id="a" attributeName="fill" attributeType="CSS" to="green"
+ begin="2s" end="b.end; a.end+2s; 9s"/>
+ <set id="b" attributeName="y" attributeType="XML" to="0"
+ begin="1s" end="3s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/deleted-interval-simple-1.svg b/layout/reftests/svg/smil/syncbase/deleted-interval-simple-1.svg
new file mode 100644
index 0000000000..cb516275a8
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/deleted-interval-simple-1.svg
@@ -0,0 +1,22 @@
+<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('a').setAttribute('end', '0s');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A simple case of a deleting interval.
+ The timebase interval is made invalid by script and hence a delete
+ notification should be propagated to the dependent interval.
+ -->
+ <rect width="100" height="100" fill="green">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="10s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="red; red"
+ begin="a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/deleted-interval-simple-2.svg b/layout/reftests/svg/smil/syncbase/deleted-interval-simple-2.svg
new file mode 100644
index 0000000000..6e4df7dbce
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/deleted-interval-simple-2.svg
@@ -0,0 +1,26 @@
+<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.75);
+ document.getElementById('a').setAttribute('restart', 'never');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Originally we have an interval from -1.5s to 0.5s. We'll ignore 'a's begin
+ time of t=0s because we are restart="whenNotActive".
+ At time t=0.1s, 'a' will create a new interval from 1.0 to 1.1s and we'll
+ add the new instance time of 1.0s.
+ However, at t=0.75s the restart mode of 'a' is changed to restart="never"
+ therefore the second interval is deleted and the change should be propagated
+ to us.
+ -->
+ <rect width="100" height="100" fill="green">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s; 1s" dur="0.1s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="red; red"
+ begin="-1.5s; a.begin" dur="2s" restart="whenNotActive"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/deleted-interval-simple-3.svg b/layout/reftests/svg/smil/syncbase/deleted-interval-simple-3.svg
new file mode 100644
index 0000000000..7f290b8a0c
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/deleted-interval-simple-3.svg
@@ -0,0 +1,21 @@
+<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.25);
+ document.getElementById('a').setAttribute('restart', 'never');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ As with deleted-interval-simple-2.svg but this time we should get the
+ deleted interval notice while in the active state.
+ -->
+ <rect width="100" height="100" fill="green">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s; 1s" dur="0.1s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="red; red"
+ begin="-1.5s; a.begin" dur="2s" restart="whenNotActive"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/deleted-interval-simple-4.svg b/layout/reftests/svg/smil/syncbase/deleted-interval-simple-4.svg
new file mode 100644
index 0000000000..e7d1a8e599
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/deleted-interval-simple-4.svg
@@ -0,0 +1,26 @@
+<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('a').beginElementAt(0.5);
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Originally the third animation's interval is from 1s->3s, but then by
+ script we add another begin time to 'a' at 0.5, and since 'a' can't
+ restart, this is the only begin time it will ever generate. Therefore, all
+ the ends for animation 'b' are before the begin, and there's no valid
+ interval.
+ -->
+ <rect width="100" height="100" fill="green">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="3s" dur="10s" restart="never"/>
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="b"
+ begin="1s" end="a.begin" dur="3s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="red; red"
+ begin="b.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/deleted-interval-simple-5.svg b/layout/reftests/svg/smil/syncbase/deleted-interval-simple-5.svg
new file mode 100644
index 0000000000..677c960330
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/deleted-interval-simple-5.svg
@@ -0,0 +1,21 @@
+<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('a').removeAttribute('dur');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A case of a changing interval that causes another interval to have an
+ unresolved begin time and hence be deleted.
+ -->
+ <rect width="100" height="100" fill="green">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s" dur="1s"/>
+ <animate attributeName="fill" attributeType="CSS" id="b"
+ values="red; red"
+ begin="a.end" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/filtered-interval-1.svg b/layout/reftests/svg/smil/syncbase/filtered-interval-1.svg
new file mode 100644
index 0000000000..2ed6d549be
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/filtered-interval-1.svg
@@ -0,0 +1,24 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ This test ensures that even if we have an old interval, if it is part of an
+ active dependency chain it should not be filtered.
+ -->
+ <rect width="100" height="100" fill="orange">
+ <!-- This animation is indirectly dependent on anim 'b' and hence, even
+ though it appears earlier in the document it should be given
+ priority. -->
+ <set attributeName="fill" to="green" begin="a.begin"/>
+
+ <!-- This will generate a series of short intervals such that by t=2s the
+ interval via which the first animation depends on b might be considered
+ as a candidate for filtering. -->
+ <set attributeName="width" to="100" begin="b.begin-2s; a.begin+0.2s"
+ dur="0.1s" id="a"/>
+
+ <set attributeName="fill" to="red" begin="2s" id="b"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/green-box-ref.svg b/layout/reftests/svg/smil/syncbase/green-box-ref.svg
new file mode 100644
index 0000000000..120941444a
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/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/syncbase/green-box-ref.xhtml b/layout/reftests/svg/smil/syncbase/green-box-ref.xhtml
new file mode 100644
index 0000000000..ce0bc78f12
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/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/syncbase/new-interval-chain-1.svg b/layout/reftests/svg/smil/syncbase/new-interval-chain-1.svg
new file mode 100644
index 0000000000..ec71c47eee
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-chain-1.svg
@@ -0,0 +1,22 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test some chained interval creation.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s; 1s" dur="4s"/>
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="b"
+ begin="a.begin" dur="4s"/>
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="c"
+ begin="b.begin-1s" dur="4s"/>
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="d"
+ begin="c.begin+0.5s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="d.begin; a.begin" dur="5s" restart="whenNotActive"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-chain-2.svg b/layout/reftests/svg/smil/syncbase/new-interval-chain-2.svg
new file mode 100644
index 0000000000..831f12e262
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-chain-2.svg
@@ -0,0 +1,22 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test some chained interval creation.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s; 1s" dur="4s"/>
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="b"
+ begin="a.begin" dur="4s"/>
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="c"
+ begin="b.begin-1s" dur="4s"/>
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="d"
+ begin="c.begin+0.5s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="d.begin; a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-doubly-dependent-1.svg b/layout/reftests/svg/smil/syncbase/new-interval-doubly-dependent-1.svg
new file mode 100644
index 0000000000..17f5daf97e
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-doubly-dependent-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test a relationship where one element depends on another twice.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin+0.5s; a.begin" dur="1s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-doubly-dependent-2.svg b/layout/reftests/svg/smil/syncbase/new-interval-doubly-dependent-2.svg
new file mode 100644
index 0000000000..1f669b0898
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-doubly-dependent-2.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test a relationship where one element depends on another twice.
+ (As with previous test but reversing the order of the specifications.)
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin; a.begin+0.5s" dur="1s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-doubly-dependent-3.svg b/layout/reftests/svg/smil/syncbase/new-interval-doubly-dependent-3.svg
new file mode 100644
index 0000000000..d3d2908ebd
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-doubly-dependent-3.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test a relationship where one element depends on another twice and where the
+ restart mode should cause one instance time to be ignored.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin+0.5s; a.begin" dur="2s" restart="whenNotActive"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-early-end-1.svg b/layout/reftests/svg/smil/syncbase/new-interval-early-end-1.svg
new file mode 100644
index 0000000000..3fd87aff8f
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-early-end-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test an early end with a negative offset.
+ (An early end is when a new interval restarts the current animation
+ mid-way.)
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s; 2s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin-0.5s" dur="1s" restart="whenNotActive"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-early-end-2.svg b/layout/reftests/svg/smil/syncbase/new-interval-early-end-2.svg
new file mode 100644
index 0000000000..9dc79c318d
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-early-end-2.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test an early end where two times could be chosen for the following
+ interval.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s; 1.5s" dur="1s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin+0.25s; a.begin" dur="1s" restart="whenNotActive"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-early-end-3.svg b/layout/reftests/svg/smil/syncbase/new-interval-early-end-3.svg
new file mode 100644
index 0000000000..de8920f48f
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-early-end-3.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test an early end where two times could be chosen for the following
+ interval.
+ (As before but with a negative offset.)
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s; 1.75s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin-0.25s; a.begin" dur="1s" restart="whenNotActive"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-early-end-4.svg b/layout/reftests/svg/smil/syncbase/new-interval-early-end-4.svg
new file mode 100644
index 0000000000..e46c2d62da
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-early-end-4.svg
@@ -0,0 +1,26 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test an early end where two times could be chosen for the following
+ interval.
+ (As before but with a negative offset and with the second animation getting
+ overlapping intervals from a's begin times, with one such interval being
+ rejected since it overlaps an already-completed interval when it's
+ created.)
+
+ Details: At time t=1.75, we generate an interval starting at 1.35 for the
+ second animation. However, this overlaps that animation's already-complete
+ previous interval from 0.4s to 1.4s (which is "already complete" because
+ we're at t=1.75, past its end at 1.4s). So, the new interval is rejected.
+ -->
+ <rect width="100" height="100" fill="green">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s; 1.75s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="red"
+ begin="a.begin-0.4s; a.begin+0.4s" dur="1s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-early-end-5.svg b/layout/reftests/svg/smil/syncbase/new-interval-early-end-5.svg
new file mode 100644
index 0000000000..545e640a22
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-early-end-5.svg
@@ -0,0 +1,19 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test two early ends where one generates an earlier time for the other.
+
+ So both restart at 1.5s, and both old intervals should be ended off. Hence
+ the syncbase time should be ignored.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0.5s; 1.5s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="0.75s; 1.5s; a.begin-0.5s" dur="1s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-early-end-6.svg b/layout/reftests/svg/smil/syncbase/new-interval-early-end-6.svg
new file mode 100644
index 0000000000..f4ea84c903
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-early-end-6.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test two early ends where one generates a later time for the other.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0.5s; 1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="0.5s; 1s; a.begin+0.5s" dur="1s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-early-end-7.svg b/layout/reftests/svg/smil/syncbase/new-interval-early-end-7.svg
new file mode 100644
index 0000000000..79f99594a5
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-early-end-7.svg
@@ -0,0 +1,22 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test that we don't apply an early end too soon.
+
+ Although the second animation will have an interval from 2s-6s, it shouldn't
+ be informed about this until the early end happens, at t=3s. Until that time
+ it should be expecting to start at t=4s.
+
+ If the second animation is started at t=2s it means the early end has been
+ applied too soon.
+ -->
+ <rect width="100" height="100" fill="green">
+ <set attributeName="y" attributeType="XML" to="0" id="a"
+ begin="0s; 3s" dur="5s"/>
+ <set attributeName="fill" attributeType="CSS"
+ to="red" begin="a.end-1s" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-end-dep-1.svg b/layout/reftests/svg/smil/syncbase/new-interval-end-dep-1.svg
new file mode 100644
index 0000000000..4140569239
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-end-dep-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ The simplest possible end dependency.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s" dur="1s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.end" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-end-negative-1.svg b/layout/reftests/svg/smil/syncbase/new-interval-end-negative-1.svg
new file mode 100644
index 0000000000..0ba96dbeb4
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-end-negative-1.svg
@@ -0,0 +1,39 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test a dependency with a negative offset that occurs at the end of another
+ interval.
+
+ This is one of the most important tests in the suite.
+
+ REALLY IMPORTANT: Suppose we generate a new instance time, placed at a
+ particular instant during the previous interval. In fact, correct behavior
+ depends on *when* we generate this instance time. If we generate it AFTER
+ the previous interval has ended, then the new instance time will be
+ IGNORED. However, if we generate it BEFORE the previous interval has ended
+ (and if restart="always"), then a new interval will be generated, and the
+ animation will restart.
+ (To be absolutely clear: above, the words "AFTER" and "BEFORE" describe
+ *when the instance time is generated*, as opposed to *where on the timeline
+ the instance time is placed*).
+
+ So, if a new instance time is generated at the same time as an interval is
+ due to end what should happen? SMIL's endpoint-exclusive timing seems to
+ imply that interval ends should be processed first and hence the new
+ instance time should be ignored. Opera, WebKit and Batik seem to agree on
+ this.
+
+ Hence why this test is so important. It tests that we are actually
+ processing ends first.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s; 1.5s" dur="1.5s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green" fill="freeze"
+ begin="a.begin-0.5s" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-end-negative-2.svg b/layout/reftests/svg/smil/syncbase/new-interval-end-negative-2.svg
new file mode 100644
index 0000000000..e9c1f2f448
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-end-negative-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test a dependency with a negative offset that occurs at the end of another
+ interval.
+ (As with the previous test but with an early end.)
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0s; 1.5s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green" fill="freeze"
+ begin="a.begin-0.5s" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-freeze-begin-1.svg b/layout/reftests/svg/smil/syncbase/new-interval-freeze-begin-1.svg
new file mode 100644
index 0000000000..07df8fc111
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-freeze-begin-1.svg
@@ -0,0 +1,31 @@
+<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.5);
+ document.getElementById('a').setAttribute('begin', '3s');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Tests that when we create an interval we freeze the begin time once it has
+ started.
+
+ So we have:
+
+ a: begin: 2s
+ b: begin: a.begin-1s
+
+ at t=1s, b begins
+ at t=1.5s, a's begin time is updated to 3s which will create a change notice
+
+ However, b should not then restart at t=2s regardless of the restart mode
+ because once the interval has started the begin time is fixed.
+ -->
+ <rect width="100" height="100" fill="red">
+ <set attributeName="y" attributeType="XML" to="0" id="a" begin="2s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin-1s" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-negative-offset-1.svg b/layout/reftests/svg/smil/syncbase/new-interval-negative-offset-1.svg
new file mode 100644
index 0000000000..8116606d74
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-negative-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Simple case of a negative offset.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin-0.5s" dur="3s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-negative-offset-2.svg b/layout/reftests/svg/smil/syncbase/new-interval-negative-offset-2.svg
new file mode 100644
index 0000000000..e06b9607d8
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-negative-offset-2.svg
@@ -0,0 +1,30 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Simple case of a negative offset before the syncbase has begun.
+
+ SMILANIM 3.3.6 Propagating changes to times has:
+
+ When an element begins or ends, the time dependents of the element are
+ effectively notified of the action, and the schedule for the time
+ dependents may be affected. Note than an element must actually begin
+ before any of the time dependents (dependent on the begin) are affected,
+ and that an element must actually end before any of the time dependents
+ (dependent on the end) are affected.
+
+ This would suggest that a time dependent that is defined to start BEFORE its
+ syncbase does not actually start until the syncbase starts. However Opera,
+ WebKit, and Batik all agree that when we know when the syncbase will start,
+ we resolve the negative offset in advance.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="3s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="green; orange"
+ begin="a.begin-1s" dur="3s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-negative-offset-3.svg b/layout/reftests/svg/smil/syncbase/new-interval-negative-offset-3.svg
new file mode 100644
index 0000000000..fc8f5c0324
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-negative-offset-3.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A simple syncbase relationship using a negative offset that creates a begin
+ time before the document begin. We're really just testing for unwanted
+ clamping here.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin-3s" dur="8s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-negative-offset-4.svg b/layout/reftests/svg/smil/syncbase/new-interval-negative-offset-4.svg
new file mode 100644
index 0000000000..663e3c562a
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-negative-offset-4.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A simple syncbase relationship using a negative offset that creates a begin
+ time of 0. Just checking that 0 is not treated as a special value.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="2s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin-2s" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-negative-syncbase-1.svg b/layout/reftests/svg/smil/syncbase/new-interval-negative-syncbase-1.svg
new file mode 100644
index 0000000000..428becb376
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-negative-syncbase-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A simple syncbase relationship using negative times.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="-1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin-1s" dur="8s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-restart-1.svg b/layout/reftests/svg/smil/syncbase/new-interval-restart-1.svg
new file mode 100644
index 0000000000..ce7f6480d1
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-restart-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A simple test that a syncbase that fires twice will also cause its dependent
+ to run twice (assuming restart="always" which is the default).
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0.5s; 1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-restart-2.svg b/layout/reftests/svg/smil/syncbase/new-interval-restart-2.svg
new file mode 100644
index 0000000000..dc03b9bcac
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-restart-2.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test that restart="whenNotActive" on the syncbase prevents a new instance
+ time from being propagated to the time dependent.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s; 1.5s" dur="4s" restart="whenNotActive"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-restart-3.svg b/layout/reftests/svg/smil/syncbase/new-interval-restart-3.svg
new file mode 100644
index 0000000000..78e79d8c83
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-restart-3.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test that restart="whenNotActive" on the time dependent causes new instance
+ times from the syncbase to be ignored.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s; 1.5s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin" dur="2s" restart="whenNotActive"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-sample-order-1.svg b/layout/reftests/svg/smil/syncbase/new-interval-sample-order-1.svg
new file mode 100644
index 0000000000..3f7b668b02
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-sample-order-1.svg
@@ -0,0 +1,29 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test that ends are sampled first.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="-3s; 1.5s" dur="20s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin-0.5s; 1.5s" dur="2s" restart="whenNotActive"/>
+ <!--
+ So initially we have:
+ a: -3->17s
+ (b): -3.5->-1.5s (instance times: -3.5s, 1.5s)
+
+ At t=1.5s we get an early end on 'a', giving us:
+ a: 1.5->21.5s
+ (b): 1.0->3.0s (instance times: 1.0s, 1.5s)
+
+ If, at t=1.5s, we sample the second animation first, we'll start an
+ interval from 1.5s instead of 1.0s. So this is a test that ends are
+ actually sampled first.
+ -->
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-simple-1.svg b/layout/reftests/svg/smil/syncbase/new-interval-simple-1.svg
new file mode 100644
index 0000000000..ed0ea22d62
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-simple-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ The simplest possible syncbase test.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-simple-2.svg b/layout/reftests/svg/smil/syncbase/new-interval-simple-2.svg
new file mode 100644
index 0000000000..25d627805b
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-simple-2.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ A simple syncbase relationship where the syncbase appears after the
+ time dependent in the document.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin" dur="2s"/>
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="4s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-triply-dependent-1.svg b/layout/reftests/svg/smil/syncbase/new-interval-triply-dependent-1.svg
new file mode 100644
index 0000000000..c3b7cc3ead
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-triply-dependent-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test a relationship where one element depends on another thrice.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin; a.begin; a.begin" dur="2s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/new-interval-triply-dependent-2.svg b/layout/reftests/svg/smil/syncbase/new-interval-triply-dependent-2.svg
new file mode 100644
index 0000000000..b1ade9c624
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/new-interval-triply-dependent-2.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test a relationship where one element depends on another thrice.
+ (As before but with different offsets.)
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="1s" dur="4s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="orange; green; purple"
+ begin="a.begin-0.5s; a.begin+0.5s; a.begin" dur="1s"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/reftest.list b/layout/reftests/svg/smil/syncbase/reftest.list
new file mode 100644
index 0000000000..52728b2a53
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/reftest.list
@@ -0,0 +1,99 @@
+# Tests related to SVG Animation (using SMIL) that use syncbase timing.
+
+# New intervals
+== new-interval-simple-1.svg green-box-ref.svg
+== new-interval-simple-2.svg green-box-ref.svg
+== new-interval-negative-offset-1.svg green-box-ref.svg
+== new-interval-negative-offset-2.svg green-box-ref.svg
+== new-interval-negative-offset-3.svg green-box-ref.svg
+== new-interval-negative-offset-4.svg green-box-ref.svg
+== new-interval-negative-syncbase-1.svg green-box-ref.svg
+== new-interval-restart-1.svg green-box-ref.svg
+== new-interval-restart-2.svg green-box-ref.svg
+== new-interval-restart-3.svg green-box-ref.svg
+== new-interval-early-end-1.svg green-box-ref.svg
+== new-interval-early-end-2.svg green-box-ref.svg
+== new-interval-early-end-3.svg green-box-ref.svg
+== new-interval-early-end-4.svg green-box-ref.svg
+== new-interval-early-end-5.svg green-box-ref.svg
+== new-interval-early-end-6.svg green-box-ref.svg
+== new-interval-early-end-7.svg green-box-ref.svg
+== new-interval-doubly-dependent-1.svg green-box-ref.svg
+== new-interval-doubly-dependent-2.svg green-box-ref.svg
+== new-interval-doubly-dependent-3.svg green-box-ref.svg
+== new-interval-triply-dependent-1.svg green-box-ref.svg
+== new-interval-triply-dependent-2.svg green-box-ref.svg
+== new-interval-end-negative-1.svg green-box-ref.svg
+== new-interval-end-negative-2.svg green-box-ref.svg
+== new-interval-end-dep-1.svg green-box-ref.svg
+== new-interval-chain-1.svg green-box-ref.svg
+== new-interval-chain-2.svg green-box-ref.svg
+== new-interval-sample-order-1.svg green-box-ref.svg
+== new-interval-freeze-begin-1.svg green-box-ref.svg
+
+# Changing intervals
+== changed-interval-simple-1.svg green-box-ref.svg
+== changed-interval-simple-2.svg green-box-ref.svg
+== changed-interval-simple-3.svg green-box-ref.svg
+== changed-interval-simple-4.svg green-box-ref.svg
+== changed-interval-simple-5.svg green-box-ref.svg
+== changed-interval-resolved-1.svg green-box-ref.svg
+== changed-interval-resolved-2.svg green-box-ref.svg
+== changed-interval-sort-1.svg green-box-ref.svg
+== changed-interval-change-spec-1.svg green-box-ref.svg
+== changed-interval-change-spec-2.svg green-box-ref.svg
+== changed-interval-change-spec-3.svg green-box-ref.svg
+== changed-interval-change-spec-4.svg green-box-ref.svg
+
+# Deleted intervals
+== deleted-interval-simple-1.svg green-box-ref.svg
+== deleted-interval-simple-2.svg green-box-ref.svg
+== deleted-interval-simple-3.svg green-box-ref.svg
+== deleted-interval-simple-4.svg green-box-ref.svg
+== deleted-interval-simple-5.svg green-box-ref.svg
+
+# Trimmed intervals
+== trimmed-interval-1.svg green-box-ref.svg
+
+# Cyclic dependencies
+== cycle-ok-1.svg green-box-ref.svg
+== cycle-ok-2.svg green-box-ref.svg
+== cycle-ok-3.svg green-box-ref.svg
+== cycle-ok-4.svg green-box-ref.svg
+== cycle-ok-5.svg green-box-ref.svg
+== cycle-self-ref-1.svg green-box-ref.svg
+== cycle-self-ref-2.svg green-box-ref.svg
+== cycle-self-ref-3.svg green-box-ref.svg
+== cycle-self-ref-4.svg green-box-ref.svg
+== cycle-self-ref-5.svg green-box-ref.svg
+== cycle-invalid-1.svg green-box-ref.svg
+== cycle-invalid-2.svg green-box-ref.svg
+== cycle-invalid-3.svg green-box-ref.svg
+== cycle-invalid-4.svg green-box-ref.svg
+== cycle-change-1.svg green-box-ref.svg
+== cycle-change-2.svg green-box-ref.svg
+== cycle-delete-1.svg green-box-ref.svg
+== cycle-recursion-1.svg green-box-ref.svg
+== cycle-recursion-2.svg green-box-ref.svg
+
+# Animation sandwich priority
+== sandwich-priority-1.svg green-box-ref.svg
+== sandwich-priority-2.svg green-box-ref.svg
+== sandwich-priority-3.svg green-box-ref.svg
+== sandwich-priority-4.svg green-box-ref.svg
+== sandwich-priority-5.svg green-box-ref.svg
+== sandwich-priority-6.svg green-box-ref.svg
+== sandwich-priority-7.svg green-box-ref.svg
+== sandwich-priority-8.svg green-box-ref.svg
+== sandwich-priority-9.svg green-box-ref.svg
+== sandwich-priority-10.svg green-box-ref.svg
+== sandwich-priority-11.svg green-box-ref.svg
+== sandwich-priority-12.svg green-box-ref.svg
+
+# Cross-time container dependencies
+== cross-container-1.xhtml green-box-ref.xhtml
+== cross-container-2.xhtml green-box-ref.xhtml
+== cross-container-3.xhtml green-box-ref.xhtml
+
+# Filtering
+== filtered-interval-1.svg green-box-ref.svg
diff --git a/layout/reftests/svg/smil/syncbase/sandwich-priority-1.svg b/layout/reftests/svg/smil/syncbase/sandwich-priority-1.svg
new file mode 100644
index 0000000000..9d99fa0829
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/sandwich-priority-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test of animation sandwich priority based on syncbase dependencies.
+
+ Normally, the second element would win because it appears later in the
+ document, but since the first element is dependent on the second, it should
+ apply on top of the second.
+ -->
+ <rect width="100" height="100" fill="orange">
+ <set attributeName="fill" to="green" begin="a.begin"/>
+ <set attributeName="fill" to="red" begin="0s" id="a"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/sandwich-priority-10.svg b/layout/reftests/svg/smil/syncbase/sandwich-priority-10.svg
new file mode 100644
index 0000000000..0732c695f5
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/sandwich-priority-10.svg
@@ -0,0 +1,26 @@
+<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('b').setAttribute('end', 'a.begin');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test of animation sandwich priority based on syncbase dependencies.
+
+ Tests a change to an interval end that leaves the time the same but changes
+ the dependency chain.
+
+ At first c is dependent on b only.
+ Then via script we make b dependent on a's begin time so that c's begin time
+ is indirectly dependent on a's begin time and so should have a higher
+ priority.
+ -->
+ <rect width="100" height="100" fill="orange">
+ <set attributeName="fill" to="green" begin="b.end" id="c"/>
+ <set attributeName="fill" to="orange" begin="0s" end="1s" id="b"/>
+ <set attributeName="fill" to="red" begin="1s" id="a"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/sandwich-priority-11.svg b/layout/reftests/svg/smil/syncbase/sandwich-priority-11.svg
new file mode 100644
index 0000000000..05407bd6c9
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/sandwich-priority-11.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test of animation sandwich priority based on syncbase dependencies.
+
+ Test in the waiting state, with frozen animation effects from an
+ earlier interval.
+ -->
+ <rect width="100" height="100" fill="orange">
+ <set attributeName="fill" to="green" begin="a.begin" dur="1s"
+ fill="freeze"/>
+ <set attributeName="fill" to="red" begin="0s; 3s" dur="1s" id="a"
+ fill="freeze"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/sandwich-priority-12.svg b/layout/reftests/svg/smil/syncbase/sandwich-priority-12.svg
new file mode 100644
index 0000000000..8164e56fa8
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/sandwich-priority-12.svg
@@ -0,0 +1,24 @@
+<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('a').beginElementAt(1);
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test of animation sandwich priority based on syncbase dependencies.
+
+ This case includes a complex cycle that should nevertheless produce
+ consistent results.
+
+ If this fails, it will fail intermittently. The test is not so much
+ concerned with which colour should win (there are other tests for that) but
+ simply with determinancy.
+ -->
+ <rect width="100" height="100" fill="orange">
+ <set attributeName="fill" id="a" to="green" begin="b.begin; 3s"/>
+ <set attributeName="fill" id="b" to="red" begin="a.begin"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/sandwich-priority-2.svg b/layout/reftests/svg/smil/syncbase/sandwich-priority-2.svg
new file mode 100644
index 0000000000..3d6d458f50
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/sandwich-priority-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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test of animation sandwich priority based on syncbase dependencies.
+
+ A longer chain.
+ -->
+ <rect width="100" height="100" fill="orange">
+ <set attributeName="fill" to="blue" begin="a.begin-0.5s" id="b"/>
+ <set attributeName="fill" to="green" begin="d.begin"/>
+ <set attributeName="fill" to="black" begin="c.begin-0.5s" id="d"/>
+ <set attributeName="x" to="0" begin="b.begin+1s" id="c"/>
+ <set attributeName="fill" to="red" begin="1s" id="a"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/sandwich-priority-3.svg b/layout/reftests/svg/smil/syncbase/sandwich-priority-3.svg
new file mode 100644
index 0000000000..f8ba708d75
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/sandwich-priority-3.svg
@@ -0,0 +1,20 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test of animation sandwich priority based on syncbase dependencies.
+
+ This chain goes through end and begin specs but SMIL seems to imply that
+ it's only when one element's begin time is dependent on another's begin time
+ that it affects the chaining because it should act as if the time base begun
+ before the the dependent. So in this case 'c' is (indirectly) dependent on
+ 'a's end time and so shouldn't be given the higher priority.
+ -->
+ <rect width="100" height="100" fill="orange">
+ <set attributeName="fill" to="red" begin="b.begin-1s" id="c"/>
+ <set attributeName="x" to="0" begin="a.end-1s" id="b"/>
+ <set attributeName="fill" to="green" begin="1s" dur="2s" id="a"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/sandwich-priority-4.svg b/layout/reftests/svg/smil/syncbase/sandwich-priority-4.svg
new file mode 100644
index 0000000000..7ce158672a
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/sandwich-priority-4.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test of animation sandwich priority based on syncbase dependencies.
+
+ This case includes a cycle.
+ -->
+ <rect width="100" height="100" fill="orange">
+ <set attributeName="fill" id="b" to="green" begin="a.begin"/>
+ <set attributeName="fill" id="a" to="red" begin="0s; b.begin"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/sandwich-priority-5.svg b/layout/reftests/svg/smil/syncbase/sandwich-priority-5.svg
new file mode 100644
index 0000000000..05d82ffdf1
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/sandwich-priority-5.svg
@@ -0,0 +1,20 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test of animation sandwich priority based on syncbase dependencies.
+
+ This case includes many cycles.
+
+ c is dependent on a.
+ b is dependent on c.
+ So b is the most dependent and should be on top.
+ -->
+ <rect width="100" height="100" fill="purple">
+ <set attributeName="fill" id="c" to="orange" begin="a.begin; b.begin"/>
+ <set attributeName="fill" id="b" to="green" begin="c.begin; b.begin"/>
+ <set attributeName="fill" id="a" to="red" begin="1s; b.begin; c.begin"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/sandwich-priority-6.svg b/layout/reftests/svg/smil/syncbase/sandwich-priority-6.svg
new file mode 100644
index 0000000000..a27b81dfab
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/sandwich-priority-6.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="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test of animation sandwich priority based on syncbase dependencies.
+
+ Test in the postactive state.
+ -->
+ <rect width="100" height="100" fill="orange">
+ <set attributeName="fill" to="green" begin="a.begin"
+ dur="1s" fill="freeze"/>
+ <set attributeName="fill" to="red" begin="0s" id="a"
+ dur="1s" fill="freeze"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/sandwich-priority-7.svg b/layout/reftests/svg/smil/syncbase/sandwich-priority-7.svg
new file mode 100644
index 0000000000..db72072a75
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/sandwich-priority-7.svg
@@ -0,0 +1,27 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait"
+ onload="setTimeAndSnapshot(2, true)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test of animation sandwich priority based on syncbase dependencies.
+
+ Test for true dependency checking.
+
+ We construct a tree as follows:
+
+ b-c
+ a<
+ d
+
+ If we're doing naive dependency checking that only considers the depth of
+ a dependency in the tree we'll end up saying that 'c' is dependent on 'd'
+ but it's not.
+ -->
+ <rect width="100" height="100" fill="orange">
+ <set attributeName="fill" to="yellow" begin="1s" dur="2s" id="a"/>
+ <set attributeName="fill" to="purple" begin="a.begin" dur="2s" id="b"/>
+ <set attributeName="fill" to="red" begin="b.begin" dur="2s" id="c"/>
+ <set attributeName="fill" to="green" begin="a.begin" dur="2s" id="d"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/sandwich-priority-8.svg b/layout/reftests/svg/smil/syncbase/sandwich-priority-8.svg
new file mode 100644
index 0000000000..7d31b87bff
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/sandwich-priority-8.svg
@@ -0,0 +1,25 @@
+<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('b').setAttribute('begin', 'a.begin');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test of animation sandwich priority based on syncbase dependencies.
+
+ Test that we don't filter out a change to the timing model that does not
+ affect the start time of an interval but which DOES affect the dependency
+ chain.
+
+ Given the arrangement below, 'a' will have higher priority, as it is later
+ in the document. However, via script, we make 'b' dependent on 'a' giving
+ it a higher priority whilst preserving the interval times.
+ -->
+ <rect width="100" height="100" fill="orange">
+ <set attributeName="fill" to="green" begin="1s" id="b"/>
+ <set attributeName="fill" to="red" begin="1s" id="a"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/sandwich-priority-9.svg b/layout/reftests/svg/smil/syncbase/sandwich-priority-9.svg
new file mode 100644
index 0000000000..d8ec1709cd
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/sandwich-priority-9.svg
@@ -0,0 +1,21 @@
+<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('b').setAttribute('begin', 'a.begin');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ Test of animation sandwich priority based on syncbase dependencies.
+
+ As with test 8 but here we check that such changes are propagated to
+ dependent elements.
+ -->
+ <rect width="100" height="100" fill="orange">
+ <set attributeName="fill" to="yellow" begin="1s" id="b"/>
+ <set attributeName="fill" to="green" begin="b.begin" id="c"/>
+ <set attributeName="fill" to="red" begin="1s" id="a"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/syncbase/trimmed-interval-1.svg b/layout/reftests/svg/smil/syncbase/trimmed-interval-1.svg
new file mode 100644
index 0000000000..c22af2e315
--- /dev/null
+++ b/layout/reftests/svg/smil/syncbase/trimmed-interval-1.svg
@@ -0,0 +1,22 @@
+<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');
+ setTimeAndSnapshot(2, false)">
+ <script xlink:href="../smil-util.js" type="text/javascript"/>
+ <!--
+ The timebase interval is updated such that it would be deleted but because
+ it is active, it is trimmed instead. Test that the dependent interval is
+ notified accordingly.
+ -->
+ <rect width="100" height="100" fill="red">
+ <animate attributeName="y" attributeType="XML" from="0" to="0" id="a"
+ begin="0.5s" dur="10s"/>
+ <animate attributeName="fill" attributeType="CSS"
+ values="purple; green; orange" keyTimes="0; 0.75; 1"
+ begin="a.end" dur="2s"/>
+ </rect>
+</svg>