| <!DOCTYPE html> |
| |
| <html> |
| <head> |
| <style> |
| .container { |
| height: 150px; |
| width: 150px; |
| float: left; |
| position: relative; |
| border: 1px solid black; |
| padding: 20px; |
| margin: 10px; |
| box-sizing: border-box; |
| box-shadow: 0 0 4px rgba(0, 0, 0, 0.2); |
| } |
| |
| .box { |
| position: relative; |
| height: 40px; |
| width: 100px; |
| background-color: rgba(0, 0, 128, 0.5); |
| } |
| |
| p { |
| line-height: 20px; |
| } |
| |
| .composited { |
| will-change: transform; |
| } |
| |
| .antialiased { |
| -webkit-font-smoothing: antialiased; |
| } |
| |
| .smoothed { |
| -webkit-font-smoothing: subpixel-antialiased; |
| } |
| </style> |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| if (window.internals) { |
| internals.setFontSmoothingEnabled(true); |
| internals.settings.setSubpixelAntialiasedLayerTextEnabled(true) |
| } |
| |
| function doTest() |
| { |
| if (window.internals) |
| document.getElementById('layers').innerText = internals.layerTreeAsText(document); |
| } |
| |
| window.addEventListener('load', doTest, false); |
| </script> |
| </head> |
| <body> |
| |
| <div class="composited container" style="visibility:hidden"> |
| This text is hidden. |
| <div style="position: relative; visibility: visible;"> |
| <p>Visibility hidden ancestor with visible child</p> |
| </div> |
| </div> |
| |
| <div class="composited container"> |
| <div style="position: relative; visibility: hidden;"> |
| <p>Hidden child with text</p> |
| </div> |
| </div> |
| |
| <div class="composited container" style="visibility:hidden"> |
| <p class="smoothed">This text is hidden.</p> |
| <div style="position: relative; visibility: visible;"> |
| <p class="antialiased">Only visible text is antialiased</p> |
| </div> |
| </div> |
| |
| <div class="composited container"> |
| <p class="antialiased">This text is antialiased. There is a hidden smoothed child</p> |
| <div style="position: relative; visibility: hidden;"> |
| <p class="smoothed">This smoothed text is hidden</p> |
| </div> |
| </div> |
| |
| <pre id="layers"></pre> |
| |
| </body> |
| </html> |