<style> | |
div { width: 100px; height: 100px; } | |
#target { margin-top: -100px; background-color: green; } | |
#target:empty { display: none; } | |
</style> | |
<p> | |
This tests that specifying <tt>display: none;</tt> for the <tt>:empty</tt> | |
pseudoclass doesn’t affect non-empty elements. | |
</p> | |
<div style="background-color: red;"></div> | |
<div id="target"><span></span></div> | |
<p id="result"></p> | |
<script> | |
if (window.testRunner) | |
testRunner.dumpAsText(); | |
document.getElementById("result").innerText = document.getElementById("target").offsetWidth === 100 ? "PASS" : "FAIL"; | |
</script> |