blob: f898557e3ea1b151898228ce3b05c0aa563cdc47 [file] [log] [blame]
<!DOCTYPE html>
| Test case which ensures that when a transition "begins" on an element with an
| ancestor that has display set to none, when display is set to non-none, the
| transition does not run (e.g. it appears immediately fully transitioned).
| While the specification doesn't seem to say anything about this, it is
| how Chrome and Firefox both work, and it is also intuitively in line with
| the following behavior specified for CSS Animations:
| From,
| "Setting the display property to ‘none’ will terminate any running animation
| applied to the element and its descendants. If an element has a display of
| ‘none’, updating display to a value other than ‘none’ will start all
| animations applied to the element by the ‘animation-name’ property, as well
| as all animations applied to descendants with display other than ‘none’."
#block {
width: 100px;
height: 100px;
background-color: red;
font-size: 30px;
transition: background-color 1s, transform 2s linear;
<div id="outer-container">
<div id="inner-container">
<div id="block"></div>
if (window.testRunner) {
var blockDiv = document.getElementById('block');
var containerDiv = document.getElementById('outer-container');
window.addEventListener('load', function() {
if (window.testRunner) {
// Do a layout upon the load event so that we setup our source styles
// that we will be transitioning from.
} = "none";
if (window.testRunner) {
} = 'blue'; = "translate(100px, 0)";
if (window.testRunner) {
// Run the transition a bit so that it is started but not completed.
window.testRunner.DoNonMeasuredLayout(); = "block";
// Measure that the transition should now appear to be fully completed.