| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <script src="../resources/js-test.js"></script> | |
| 3 <script> | |
| 4 window.jsTestIsAsync = true; | |
| 5 | |
| 6 var FixedRasterScaleBlurryContent = 1373; // From UseCounter.h | |
| 7 var FixedRasterScalePotentialPerformanceRegression = 1374; // From UseCounter.h | |
| 8 | |
| 9 function verify(step) { | |
| 10 switch (step) { | |
| 11 case 0: // initial state | |
| 12 shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScaleBlurr
yContent)"); | |
| 13 shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScalePoten
tialPerformanceRegression)"); | |
| 14 break; | |
| 15 case 1: // first transform set to 1.0 scale | |
| 16 shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScaleBlurr
yContent)"); | |
| 17 shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScalePoten
tialPerformanceRegression)"); | |
| 18 break; | |
| 19 case 2: // remainder of transforms are set to != 1.0 scale | |
| 20 case 3: | |
| 21 case 4: | |
| 22 case 5: | |
| 23 shouldBeTrue("window.internals.isUseCounted(document, FixedRasterScaleBlurry
Content)"); | |
| 24 shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScalePoten
tialPerformanceRegression)"); | |
| 25 break; | |
| 26 default: | |
| 27 shouldBeTrue("window.internals.isUseCounted(document, FixedRasterScaleBlurry
Content)"); | |
| 28 shouldBeTrue("window.internals.isUseCounted(document, FixedRasterScalePotent
ialPerformanceRegression)"); | |
| 29 break; | |
| 30 } | |
| 31 } | |
| 32 | |
| 33 function mutate(step) { | |
| 34 var div = document.getElementById("div"); | |
| 35 | |
| 36 // First scale is 1.0; scale is > 1.0 for the remainder of steps. | |
| 37 var scale = 2 * (step + 1); | |
| 38 div.style.transform = "translateZ(0) scale(" + scale + ", " + scale + ")"; | |
| 39 } | |
| 40 | |
| 41 function schedule(step) { | |
| 42 if (step <= 8) { | |
| 43 if (window.testRunner) { | |
| 44 window.testRunner.capturePixelsAsyncThen(function() { | |
| 45 verify(step); | |
| 46 mutate(step); | |
| 47 schedule(step+1); | |
| 48 }); | |
| 49 } | |
| 50 } else { | |
| 51 finishJSTest(); | |
| 52 } | |
| 53 } | |
| 54 | |
| 55 requestAnimationFrame(function() { schedule(0); }); | |
| 56 </script> | |
| 57 <div id="div" style="transform:translateZ(0); width:100px; height:100px; backgro
und-color:blue;">non-solid div</div> | |
| 58 | |
| 59 </html> | |
| OLD | NEW |