| <!DOCTYPE html> |
| <html class=reftest-wait> |
| <title>View transitions: transition skipped if no containment on old element</title> |
| <link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> |
| <link rel="author" href="mailto:khushalsagar@chromium.org"> |
| |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| |
| <style> |
| div { |
| width: 100px; |
| height: 100px; |
| background: blue; |
| view-transition-name: target; |
| } |
| </style> |
| |
| <div id=first></div> |
| |
| <script> |
| promise_test(async t => { |
| return new Promise(async (resolve, reject) => { |
| let transition = document.startViewTransition(() => { |
| first.style.contain = "paint"; |
| }); |
| |
| let readyRejected = false; |
| transition.ready.then(reject, () => { readyRejected = true; }); |
| |
| let domUpdated = false; |
| transition.domUpdated.then(() => { domUpdated = true; }, reject); |
| transition.finished.then(() => { |
| assert_true(readyRejected, "ready not rejected"); |
| assert_true(domUpdated, "dom not updated"); |
| |
| if (window.getComputedStyle(first).contain == "paint") |
| resolve(); |
| else |
| reject("dom update callback did not run"); |
| |
| }, reject); |
| }); |
| }, "uncontained old element should skip the transition"); |
| </script> |