gecko-dev/testing/web-platform/tests/css/css-transitions/changing-while-transition-003.html
Brian Birtles 5c463074ca Bug 1547417 [wpt PR 16462] - [css-transitions] Fix transition tests (part 2), a=testonly
Automatic update from web-platform-tests
[css-transitions] Simplify before-DOMContentLoaded-001.html test

This test is still not awesome. It introduces a 3s delay which will be
too long most of the time but probably not long enough in some extra
cases (very loaded down CI etc.).

Unfortunately, there doesn't appear to be any way to arbitrarily delay
DOMContentLoaded in a way that can be aborted (short of pehaps setting
up a server script that we communicate with out-of-band). Basically,
only script loading delays DOMContentLoaded (external stylesheets block
rendering, but not DOMContentLoaded) yet there doesn't appear to be any
facility in HTML for aborting a script load (dropping the <script>
element, replacing its 'src' attribute etc. etc. don't work).

So this is probably as good as we can do.

I'm actually going to drop this test in the next commit in this series
but I thought I'd land these fixups for now for posterity.

--
[css-transitions] Drop before-DOMContentLoaded-001.html

Dropping this test because:

* It tests unspecified behavior (as indicated in README)
* It fails in at least Firefox and Chrome (and probably every UA since
  it refers to a resource that, as best I can tell, does not exist)
* There doesn't appear to be any way to make it run in a manner that is
  both performant and reliable (see previous commit)

--
[css-transitions] Fix before-load-001.html

--
[css-transitions] Rewrite tests for testing changes to transition properties while transitions are in-flight

--
[css-transitions] Tidy up currentcolor test

This test is quite old and has been updated to test the opposite of what
it was originally intended to test.[1] As a result the (broken) link to
the W3C bugzilla instance[2] only adds confusion.

This patch drops some old links, updates others, and generally tries to
make the test a little easier to follow.

[1] 09e605708e
[2] Try this link instead: https://web.archive.org/web/20170716073923/https://www.w3.org/Bugs/Public/show_bug.cgi?id=14605

--
[css-transitions] Address review feedback

--

wpt-commits: dc856e97caa0481b9fa92ab3bbb0fd7bfdadb403, 0f7659c5b3645fb0d09fedb5616bfa922bc91988, 85562a6afbaec362023a50854a51071714f4cf6c, 3628366592dfc5cd0e6fb34960acb51c817608ba, f7cbefc0f4e8ee7a3c0b43fdf028168137e0df06, 42e8d3c188506894a81b55e157afcd2ffa119b1c
wpt-pr: 16462
2019-06-05 10:27:22 +01:00

56 lines
1.7 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title>CSS Transitions Test: behavior when transition-delay changes while transitioning</title>
<meta name="assert" content="Checks a change to the transition-delay
property does not affect an in-flight transition">
<link rel="help" title="3. Starting of transitions" href="https://drafts.csswg.org/css-transitions/#starting">
<script src="/resources/testharness.js" type="text/javascript"></script>
<script src="/resources/testharnessreport.js" type="text/javascript"></script>
<script src="./support/helper.js" type="text/javascript"></script>
</head>
<body>
<div id="log"></div>
<script>
promise_test(async t => {
// Start a 200s transition 50% of the way through
const div = addDiv(t, {
style: 'transition: height 200s -100s linear; height: 0px',
});
getComputedStyle(div).height;
div.style.height = '100px';
assert_equals(
getComputedStyle(div).height,
'50px',
'Transition should be initially 50% complete'
);
// Set the transition-delay to -50s.
div.style.transitionDelay = '-50s';
// If the change to the transition-delay was reflected, the
// computed height would now be '25px'.
assert_equals(
getComputedStyle(div).height,
'50px',
'Even after updating the transition-delay, the transition should be 50% complete'
);
// Wait a frame just to be sure that the changed delay is not later
// updated.
await waitForFrame();
assert_greater_than_equal(
parseInt(getComputedStyle(div).height),
50,
'Even in the next frame the updated transition-delay should not apply'
);
}, 'Changes to transition-delay should not affect in-flight transitions');
</script>
</body>
</html>