Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / transitions / transition-with-calc-spin.html
1 <style>
2 #testdiv {
3     background-color: inherit; /* needed to dodge the matched properties cache */
4 }
5 .test {
6     transition: 1s;
7     width: calc(100% - 10px); /* calc compares inequal with the same exact calc value */
8 }
9 </style>
10 <body onload="test()">
11 Test that calc values in transitions don't lead to a style resolution spin.
12 <div id=log></div>
13 <div id=testdiv></div>
14 <script>
15 if (window.testRunner) {
16     testRunner.waitUntilDone();
17     testRunner.dumpAsText();
18 }
19
20 function test() {
21     document.body.offsetWidth;
22
23     const startStyleRecalcCount = window.internals ? internals.styleRecalcCount() : 0;
24
25     testdiv.classList.add('test');
26
27     if (!window.internals)
28         return;
29     setTimeout(() => {
30        const styleRecalcCount = internals.styleRecalcCount() - startStyleRecalcCount;
31        if (styleRecalcCount <= 3)
32            log.innerHTML = "PASS"
33        else
34            log.innerHTML = `FAIL: styleRecalcCount: ${ internals.styleRecalcCount() - startStyleRecalcCount}`;
35        testRunner.notifyDone();
36     }, 10);
37 }
38 </script>
39 </div>