servo/tests/wpt/css-tests/css-transitions-1_dev/xhtml1/transition-duration-002.xht

36 lines
No EOL
1.5 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="utf-8" />
<title>CSS Transitions Test: transition-duration - positive number</title>
<link href="http://www.intel.com" rel="author" title="Intel" />
<link href="mailto:shiyoux.tan@intel.com" rel="author" title="Shiyou Tan" />
<link href="http://www.w3.org/TR/css3-transitions/#transition-duration-property" rel="help" title="2.2. The 'transition-duration' Property" />
<meta content="interact" name="flags" />
<meta content="The 'transition-duration' property set positive number specifies the time that transition from the old value to the new value should take." name="assert" />
<style>
div {
background-color: yellow;
height: 100px;
transition-duration: 2s;
transition-property: width;
transition-timing-function: linear;
width: 100px;
}
</style>
</head><body>
<p>Click the yellow square below. Test passes if the width of square stops growing when the number inside square is '2'.</p>
<div>0</div>
<script>
(function() {
var div = document.querySelector("div");
div.addEventListener("click", function(evt) {
div.setAttribute("style", "width: 200px;");
setInterval(function() {
var timer = parseInt(div.textContent, 10);
timer++;
div.textContent = timer;
}, 1000);
}, false);
})();
</script>
</body></html>