blob: e07265d2765aa5bd7abcc3ac964626409806dd53 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<svg width="400" height="400">
<rect id="target" x="10" y="10" width="80" height="80" />
</svg>
<script>
'use strict';
// From UseCounter.h
var SVGSMILBeginOrEndEventValue = 1455;
var SVGSMILBeginOrEndSyncbaseValue = 1456;
test(() => {
var target = document.getElementById('target');
var animation = document.createElementNS("http://www.w3.org/2000/svg", "animate");
animation.setAttribute("begin", "5s");
target.appendChild(animation);
assert_false(internals.isUseCounted(document, SVGSMILBeginOrEndEventValue));
assert_false(internals.isUseCounted(document, SVGSMILBeginOrEndSyncbaseValue));
}, 'begin using time is not counted as event or syncbase value.');
test(() => {
var target = document.getElementById('target');
assert_false(internals.isUseCounted(document, SVGSMILBeginOrEndEventValue));
var animation = document.createElementNS("http://www.w3.org/2000/svg", "animate");
animation.setAttribute("begin", "target.click");
target.appendChild(animation);
assert_true(internals.isUseCounted(document, SVGSMILBeginOrEndEventValue));
}, 'begin using event-value is use counted.');
test(() => {
var target = document.getElementById('target');
assert_false(internals.isUseCounted(document, SVGSMILBeginOrEndSyncbaseValue));
var animation = document.createElementNS("http://www.w3.org/2000/svg", "animate");
animation.setAttribute("begin", "anim.end");
target.appendChild(animation);
assert_true(internals.isUseCounted(document, SVGSMILBeginOrEndSyncbaseValue));
}, 'begin using syncbase-value is use counted.');
</script>