| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <style> | |
| 5 .box { | |
| 6 width: 100px; | |
| 7 height: 100px; | |
| 8 position: relative; | |
| 9 z-index: 1; | |
| 10 top: 10px; | |
| 11 background-color: red; | |
| 12 border: 1px black solid; | |
| 13 } | |
| 14 .blending { | |
| 15 mix-blend-mode: difference; | |
| 16 } | |
| 17 #container { | |
| 18 position: absolute; | |
| 19 left: 0px; | |
| 20 z-index: 0; | |
| 21 } | |
| 22 </style> | |
| 23 <script src="../resources/runner.js"></script> | |
| 24 <script src="resources/framerate.js"></script> | |
| 25 <script> | |
| 26 window.onload = function () { | |
| 27 PerfTestRunner.prepareToMeasureValuesAsync({done: onCompletedRun, unit: 'f
ps'}); | |
| 28 | |
| 29 // The leaf element has blending | |
| 30 var lastElement = document.createElement("div"); | |
| 31 lastElement.setAttribute("class", "blending box"); | |
| 32 | |
| 33 for (var i = 0; i < 100; i++) { | |
| 34 var el = document.createElement("div"); | |
| 35 el.setAttribute("class", "box"); | |
| 36 el.appendChild(lastElement); | |
| 37 lastElement = el; | |
| 38 } | |
| 39 var container = document.getElementById("container"); | |
| 40 container.appendChild(lastElement); | |
| 41 startTrackingFrameRate({run: softwareAnimationStep}); | |
| 42 } | |
| 43 | |
| 44 function onCompletedRun() { | |
| 45 stopTrackingFrameRate(); | |
| 46 } | |
| 47 function softwareAnimationStep() { | |
| 48 var leftVal = parseInt(container.style.left) || 0; | |
| 49 container.style.left = (leftVal + 1) + "px"; | |
| 50 } | |
| 51 </script> | |
| 52 </head> | |
| 53 <body> | |
| 54 <pre id="log"> </pre> | |
| 55 <div id="container"> </div> | |
| 56 </body> | |
| 57 </html> | |
| OLD | NEW |