4 This test verifies that software layers are promoted to composited layers when their filter
5 outsets change to overlap a hardware layer.
7 If the test passes, the green drop-shadow of the black layer should appear over the blue
10 Note: Safari will paint the filter in software because drop-shadow is not the last filter in
14 #software-layer-to-promote {
15 background-color: black;
22 .initial-drop-shadow {
23 /* Safari paints filters in software when drop-shadow is not the last filter in the chain. */
24 -webkit-filter: drop-shadow(10px 10px 0px green) grayscale(0.5);
27 -webkit-filter: drop-shadow(100px 100px 0px green) grayscale(0.5);
29 #composited-layer-to-overlap {
30 background-color: blue;
31 transform: translateZ(0);
40 if (window.testRunner)
41 testRunner.waitUntilDone();
43 function appendLayerTreeTextToConsole()
45 if (!window.testRunner || !window.internals)
48 var layerTreeText = window.internals.layerTreeAsText(document);
49 document.getElementById("console").appendChild(document.createTextNode(layerTreeText));
54 // Dump the layer tree with the initial drop shadow, which does not overlap the composited layer.
55 appendLayerTreeTextToConsole();
57 // Force a software-painted drop shadow on Safari.
58 var targetElement = document.getElementById("software-layer-to-promote");
59 targetElement.className = "final-drop-shadow";
60 appendLayerTreeTextToConsole();
62 // Dump the layer tree again with the final drop shadow, which overlaps the composited layer.
63 if (window.testRunner) {
64 testRunner.dumpAsText();
65 testRunner.notifyDone();
70 <body onload="runTest()">
71 <div id="composited-layer-to-overlap"></div>
72 <div id="software-layer-to-promote" class="initial-drop-shadow"></div>
73 <pre id="console"></pre>