4 <script src=
"../../../resources/js-test.js"></script>
11 transform: translate3d(
0,
0,
0);
16 <div id=
"layer" class=
"composited">A layer that may or may not be composited
</div>
17 <p id=
"description"></p>
18 <div id=
"console"></div>
20 description("Make sure we don't crash when a layer with a touch event handler becomes non-composited");
22 var layer
= document
.getElementById('layer');
23 layer
.addEventListener('touchstart', function() {});
25 // Ensure we've done a layout, updated compositing, and we have a hit rect on this composited layer.
26 var x
= layer
.offsetTop
;
29 window
.internals
.forceCompositingUpdate(document
);
32 if (window
.internals
) {
33 rects
= window
.internals
.touchEventTargetLayerRects(document
);
34 shouldBe("rects.length", "1");
35 shouldBeEqualToString("rects[0].layerAssociatedNode.id", "layer");
38 // Make the layer non-composited
41 // Verify we now have a hit rect on the document.
42 // (layout and compositing update are done by touchEventTargetLayerRects().)
43 if (window
.internals
) {
44 rects
= window
.internals
.touchEventTargetLayerRects(document
);
45 shouldBe("rects.length", "1");
46 shouldBeEqualToString("rects[0].layerAssociatedNode.nodeName", "#document");