diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-14 12:13:01 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-14 12:13:01 +0100 |
commit | 35c61a027dc6f4d58ca9d33e06da79adf2503ebd (patch) | |
tree | 8ec4f35ab71eb895d3ea993faf4deec39e4ad258 /layout/style/test/test_animations_event_order.html | |
parent | c58cec26c73da9a5c48f7d75555c6a2409965693 (diff) | |
download | UXP-35c61a027dc6f4d58ca9d33e06da79adf2503ebd.tar UXP-35c61a027dc6f4d58ca9d33e06da79adf2503ebd.tar.gz UXP-35c61a027dc6f4d58ca9d33e06da79adf2503ebd.tar.lz UXP-35c61a027dc6f4d58ca9d33e06da79adf2503ebd.tar.xz UXP-35c61a027dc6f4d58ca9d33e06da79adf2503ebd.zip |
Bug 1264125: Fire transitioncancel event when a transition is canceled (added tests + style clean up)
Issue #55
Diffstat (limited to 'layout/style/test/test_animations_event_order.html')
-rw-r--r-- | layout/style/test/test_animations_event_order.html | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/layout/style/test/test_animations_event_order.html b/layout/style/test/test_animations_event_order.html index f948bf0a5..7204934d2 100644 --- a/layout/style/test/test_animations_event_order.html +++ b/layout/style/test/test_animations_event_order.html @@ -48,7 +48,8 @@ var gDisplay = document.getElementById('display'); 'animationend', 'transitionrun', 'transitionstart', - 'transitionend' ] + 'transitionend', + 'transitioncancel' ] .forEach(event => gDisplay.addEventListener(event, event => gEventsReceived.push(event), @@ -623,6 +624,43 @@ checkEventOrder([ divs[0], 'transitionrun' ], divs.forEach(div => div.remove()); divs = []; +// 4j. Test sorting transitions with cancel +// The order of transitioncancel is based on StyleManager. +// So this test looks like wrong result at a glance. However +// the gecko will cancel div1's transition before div2 in this case. + +divs = [ document.createElement('div'), + document.createElement('div') ]; +divs.forEach((div, i) => { + gDisplay.appendChild(div); + div.style.marginLeft = '0px'; + div.setAttribute('id', 'div' + i); +}); + +divs[0].style.transition = 'margin-left 10s 5s'; +divs[1].style.transition = 'margin-left 10s'; + +getComputedStyle(divs[0]).marginLeft; +divs.forEach(div => div.style.marginLeft = '100px'); +getComputedStyle(divs[0]).marginLeft; + +advance_clock(0); +advance_clock(5 * 1000); +divs.forEach(div => div.style.display = 'none' ); +getComputedStyle(divs[0]).display; +advance_clock(10 * 1000); + +checkEventOrder([ divs[0], 'transitionrun' ], + [ divs[1], 'transitionrun' ], + [ divs[1], 'transitionstart' ], + [ divs[0], 'transitionstart' ], + [ divs[1], 'transitioncancel' ], + [ divs[0], 'transitioncancel' ], + 'Simultaneous transitionrun/start/cancel on siblings'); + +divs.forEach(div => div.remove()); +divs = []; + SpecialPowers.DOMWindowUtils.restoreNormalRefresh(); </script> |