Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/transitions/cancel-and-start-new.html |
| diff --git a/third_party/WebKit/LayoutTests/transitions/cancel-and-start-new.html b/third_party/WebKit/LayoutTests/transitions/cancel-and-start-new.html |
| index 5aa27849141b6f78ae60b607a1817fae4a3eb40b..461ee3d9a15df00cc02a434e7f38cfd70fd33405 100644 |
| --- a/third_party/WebKit/LayoutTests/transitions/cancel-and-start-new.html |
| +++ b/third_party/WebKit/LayoutTests/transitions/cancel-and-start-new.html |
| @@ -1,10 +1,9 @@ |
| <!DOCTYPE html> |
| - |
| <html> |
| <head> |
| <style> |
| #target { |
| - position: relative; |
| + position: absolute; |
| background-color: #933; |
| width: 50px; |
| height: 50px; |
| @@ -13,13 +12,11 @@ |
| } |
| #target.transition-top { |
| top: 400px; |
| - -webkit-transition: top 100ms linear; |
| - transition: top 100ms linear; |
| + transition: top 200ms linear; |
| } |
| #target.transition-left { |
| left: 400px; |
| - -webkit-transition: left 100ms linear; |
| - transition: left 100ms linear; |
| + transition: left 200ms linear; |
| } |
| </style> |
| <script> |
| @@ -37,18 +34,19 @@ |
| function cancelTransition() |
| { |
| document.getElementById("target").classList.remove('transition-top'); |
| + setTimeout(startNewTransition, 100); |
| } |
| function startNewTransition() |
| { |
| document.getElementById("target").classList.add('transition-left'); |
| - setTimeout(check, 50); |
| + setTimeout(check, 100); |
| } |
| function check() |
| { |
| var left = parseFloat(window.getComputedStyle(document.getElementById('target')).left); |
| - if (isEqual(left, 200, 50)) |
| + if (isEqual(left, 200, 80)) |
| var result = "<span style='color:green'>PASS</span>"; |
| else |
| var result = "<span style='color:red'>FAIL(was: " + left + ", expected: 200)</span>"; |
| @@ -60,12 +58,13 @@ |
| function start() |
| { |
| document.getElementById("target").classList.add('transition-top'); |
| - setTimeout("cancelTransition()", 50); |
| - setTimeout("startNewTransition()", 100); |
| + setTimeout(cancelTransition, 100); |
|
alancutter (OOO until 2018)
2016/06/30 04:36:20
Use internals.pauseAnimations() instead of setTime
Eric Willigers
2016/07/01 03:15:46
Done
|
| } |
| + |
| + window.onload = start; |
| </script> |
| </head> |
| -<body onload="start()"> |
| +<body> |
| <p> |
| Tests that having stopped a transition before it completes, a subsequent |
| transition starts correctly. |