Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 function listener() { | 1 function listener() { |
| 2 } | 2 } |
| 3 | 3 |
| 4 function log(msg) { | 4 function log(msg) { |
| 5 var span = document.createElement("span"); | 5 var span = document.createElement("span"); |
| 6 document.getElementById("console").appendChild(span); | 6 document.getElementById("console").appendChild(span); |
| 7 span.innerHTML = msg + '<br />'; | 7 span.innerHTML = msg + '<br />'; |
| 8 } | 8 } |
| 9 | 9 |
| 10 function nameForNode(node) { | 10 function nameForNode(node) { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 visualize = true; | 129 visualize = true; |
| 130 } | 130 } |
| 131 | 131 |
| 132 if (window.internals) { | 132 if (window.internals) { |
| 133 window.internals.settings.setMockScrollbarsEnabled(true); | 133 window.internals.settings.setMockScrollbarsEnabled(true); |
| 134 } | 134 } |
| 135 | 135 |
| 136 window.onload = function() { | 136 window.onload = function() { |
| 137 // Run each general test case. | 137 // Run each general test case. |
| 138 var tests = document.querySelectorAll('.testcase'); | 138 var tests = document.querySelectorAll('.testcase'); |
| 139 | |
| 140 // Add document wide touchend and touchcancel events to ensure they | |
| 141 // are not added to the compositor hit test rects. | |
|
tdresser
2016/04/13 16:52:35
Nit: we're adding listeners, not events.
I'm a bi
dtapuska
2016/04/13 18:00:15
touchend and touchcancel use to be added to the hi
tdresser
2016/04/13 18:44:39
Ah, makes sense.
Maybe reword "to ensure" to "and
dtapuska
2016/04/13 18:49:08
Done.
| |
| 142 document.documentElement.addEventListener('touchend', listener, false); | |
| 143 document.documentElement.addEventListener('touchcancel', listener, false); | |
| 144 | |
| 139 for ( var i = 0; i < tests.length; i++) { | 145 for ( var i = 0; i < tests.length; i++) { |
| 140 // Force a compositing update before testing each case to ensure that | 146 // Force a compositing update before testing each case to ensure that |
| 141 // any subsequent touch rect updates are actually done because of | 147 // any subsequent touch rect updates are actually done because of |
| 142 // the event handler changes in the test itself. | 148 // the event handler changes in the test itself. |
| 143 if (window.internals) | 149 if (window.internals) |
| 144 window.internals.forceCompositingUpdate(document); | 150 window.internals.forceCompositingUpdate(document); |
| 145 testElement(tests[i]); | 151 testElement(tests[i]); |
| 146 } | 152 } |
| 147 | 153 |
| 148 if (window.additionalTests) | 154 if (window.additionalTests) |
| 149 additionalTests(); | 155 additionalTests(); |
| 150 | 156 |
| 151 if (!visualize && window.internals) { | 157 if (!visualize && window.internals) { |
| 152 var testContainer = document.getElementById("tests"); | 158 var testContainer = document.getElementById("tests"); |
| 153 testContainer.parentNode.removeChild(testContainer); | 159 testContainer.parentNode.removeChild(testContainer); |
| 154 } | 160 } |
| 155 | 161 |
| 156 document.documentElement.setAttribute('done', 'true'); | 162 document.documentElement.setAttribute('done', 'true'); |
| 157 }; | 163 }; |
| OLD | NEW |