| <style> |
| input { |
| transition: margin 1s, background 200ms; |
| } |
| </style> |
| <body> |
| Tests that transitions don't trigger due to intrinsic margins. |
| <input type="submit" value="Button"></input> |
| <script> |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| onload = function() { |
| var finished = false; |
| var target = document.querySelector('input'); |
| var marginBefore = getComputedStyle(target).margin; |
| target.offsetTop; |
| target.style.background = 'green'; |
| // The background transition should finish before any transition on margin. |
| target.addEventListener('transitionend', function() { |
| if (finished) |
| return; |
| finished = true; |
| var marginAfter = getComputedStyle(target).margin |
| document.body.textContent = marginBefore == marginAfter ? |
| 'PASS' : |
| 'FAIL: expected [' + marginBefore + '] but was [' + marginAfter + ']'; |
| if (window.testRunner) { |
| testRunner.notifyDone(); |
| } |
| }); |
| }; |
| </script> |