<script src="../http/tests/inspector/inspector-test.js"></script>
<script src="../http/tests/inspector/layers-test.js"></script>
<script>
+if (window.internals) {
+ document.addEventListener('webkitAnimationStart', function() {
+ internals.pauseAnimations(0);
+ });
+}
+
function test()
{
function dumpCompositingReasons(layer, callback)
layer.requestCompositingReasons(function(reasons)
{
var node = WebInspector.domAgent.nodeForId(layer.nodeIdForSelfOrAncestor());
- var label = node.appropriateSelectorFor(false);
+ var label = WebInspector.DOMPresentationUtils.fullQualifiedSelector(node, false);
InspectorTest.addResult("Compositing reasons for " + label + ": " + reasons.sort().join(","));
- callback();
+ if (callback)
+ callback();
});
}
"preserve3d"
];
- function iterateThroughLayers(nextLayerId)
- {
- if (nextLayerId >= idsToTest.length) {
- InspectorTest.completeTest();
- return;
- }
- dumpCompositingReasons(InspectorTest.findLayerByNodeIdAttribute(idsToTest[nextLayerId]), iterateThroughLayers.bind(this, nextLayerId + 1));
- }
function onGotLayers()
{
- dumpCompositingReasons(InspectorTest._layerTreeModel.contentRoot(), iterateThroughLayers.bind(this, 0));
+ dumpCompositingReasons(InspectorTest._layerTreeModel.contentRoot());
+ for (var i = 0; i < idsToTest.length - 1; ++i)
+ dumpCompositingReasons(InspectorTest.findLayerByNodeIdAttribute(idsToTest[i]));
+ dumpCompositingReasons(InspectorTest.findLayerByNodeIdAttribute(idsToTest[idsToTest.length - 1]), InspectorTest.completeTest.bind(InspectorTest));
}
InspectorTest.requestLayers(onGotLayers);
}