Bug 1570321 [wpt PR 18205] - Clear interval when a new syncbase is received, a=testonly

Automatic update from web-platform-tests
Clear interval when a new syncbase is received

When a receiving a new interval from a syncbase it
is meant to take precedence, we now clear the old
interval so it gets updated with the new time. This
solves some sorting bugs related to syncbases.

A new test has been added "onhover_syncbases.html" which
tests repeted "mouseover" and "mouseout" events.

Bug: 740541
Change-Id: I7a8e3691593a537c4dbc1da3bdbbe09eaf30e500
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1718704
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Auto-Submit: Edvard Thörnros <edvardt@opera.com>
Cr-Commit-Position: refs/heads/master@{#682841}

--

wpt-commits: 91e90a3a5fbd8161c3c4d9637466c23895752db9
wpt-pr: 18205
This commit is contained in:
Edvard Thörnros 2019-08-06 17:02:59 +00:00 committed by moz-wptsync-bot
parent f84ea16869
commit af37c2b16f

View File

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Check if onhover events reset correctly when triggred multiple times</title>
<link rel="help" href="https://svgwg.org/svg2-draft/single-page.html#interact-EventAttributes">
<link rel="author" title="Edvard Thörnros" href="mailto:edvardt@opera.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<svg>
<circle id="circle" cx="150" cy="75" r="50" fill="#F00">
<set attributeName="fill" to="#0F0" begin="mouseover"/>
<set attributeName="fill" to="#F00" begin="mouseout"/>
</circle>
</svg>
<script>
async_test(t => {
let rounds = 5; // How many times the cursor is moved in and out
let circle = document.querySelector("#circle");
let delay = 20;
let f = t.step_func(function() {
assert_equals(window.getComputedStyle(circle, null).fill,
"rgb(255, 0, 0)")
if (rounds-- == 0) {
t.done();
return;
}
circle.dispatchEvent(new Event("mouseover"));
step_timeout(function() {
assert_equals(window.getComputedStyle(circle, null).fill,
"rgb(0, 255, 0)")
circle.dispatchEvent(new Event("mouseout"))
t.step_timeout(f, delay);
}, delay);
});
step_timeout(function() { f(); }, 0);
});
</script>
</body>
</html>