4 <link rel=
"stylesheet" href=
"resources/compositor-touch-hit-rects.css">
7 transform: translateZ(
0);
25 Tests that there is an upper limit on the number of hit rects generated per layer. http://crbug.com/
299177.
30 <div id=
"manychildren" class=
"testcase">
31 <div class=
"child"></div>
36 <div id=
"console"></div>
37 <script src=
"resources/compositor-touch-hit-rects.js"></script>
40 const kMaxRects
= 100;
41 const kFixedRects
= 1;
43 function verifyRectCount(expectedRects
) {
44 var rects
= window
.internals
.touchEventTargetLayerRects(document
);
45 log('Test node has ' + document
.querySelectorAll('.child').length
+ ' children with ' + rects
.length
+ ' rects');
46 if (rects
.length
!= expectedRects
) {
47 log('FAIL - got ' + rects
.length
+ ' rects, expected ' + expectedRects
+ '.');
51 preRunHandlerForTest
['manychildren'] = function(e
) {
52 var template
= document
.querySelector('.child');
53 for( var i
= 0; i
< kMaxRects
- kFixedRects
- 1; i
++) {
54 template
.parentElement
.appendChild(template
.cloneNode());
57 // Make sure the test is working properly.
58 verifyRectCount(kMaxRects
);
60 // Now push us over the limit.
61 template
.parentElement
.appendChild(template
.cloneNode());
64 // Verify that any additional rects get subsumed.
65 template
.parentElement
.appendChild(template
.cloneNode());