blob: 9dfa239b1c91340140172385b299c02fc65137a6 [file] [edit]
<!DOCTYPE html>
<html>
<style>
body { margin: 0; }
#test {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
gap: 1rem;
font-family: -apple-system;
}
section {
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.7);
min-height: 100px;
}
button {
appearance: none;
border: none;
background: transparent;
padding: 0;
}
svg {
color: black;
}
</style>
<body>
<div id="test">
<section>
<button>
<svg viewBox="0 0 1500 1200" version="1.1" width="40" height="40" xmlns="http://www.w3.org/2000/svg">
<defs>
<radialGradient id="myGradient">
<stop offset="10%" stop-color="gold" />
<stop offset="95%" stop-color="red" />
</radialGradient>
</defs>
<rect x="10" y="20" width="800" height="600" rx="45" ry="45" fill="url(#myGradient)" />
</svg>
</button>
</section>
<section>
<button>
<svg viewBox="0 0 1500 1200" version="1.1" width="40" height="40" xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="20" width="800" height="600" rx="45" ry="45" fill="red" />
</svg>
</button>
</section>
<section>
<button>
<svg viewBox="0 0 1500 1200" version="1.1" width="40" height="40" xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="20" width="800" height="600" rx="45" ry="45" fill="black" />
</svg>
</button>
</section>
<section>
<button>
<svg viewBox="0 0 1500 1200" version="1.1" width="40" height="40" xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="20" width="800" height="600" rx="45" ry="45" fill="white" />
</svg>
</button>
</section>
<section>
<button>
<svg viewBox="0 0 1500 1200" version="1.1" width="40" height="40" xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="20" width="800" height="600" rx="45" ry="45" fill="currentcolor" />
</svg>
</button>
</section>
<section>
<button>
<svg style="color:green;" viewBox="0 0 1500 1200" version="1.1" width="40" height="40" xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="20" width="800" height="600" rx="45" ry="45" fill="currentcolor" />
</svg>
</button>
</section>
<section>
<button>
<svg viewBox="0 0 1500 1200" version="1.1" width="100" height="100" xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="20" width="600" height="400" rx="45" ry="45" fill="white" />
</svg>
</button>
</section>
<section>
<button>
<svg viewBox="0 0 1500 1200" version="1.1" width="100" height="100" xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="20" width="800" height="600" rx="45" ry="45" fill="white" />
</svg>
</button>
</section>
<section>
<button>
<svg viewBox="0 0 1500 1200" version="1.1" width="80" height="80" xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="20" width="800" height="600" rx="45" ry="45" fill="black" />
</svg>
</button>
</section>
<section>
<button>
<svg viewBox="0 0 1500 1200" version="1.1" width="80" height="80" xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="20" width="800" height="600" rx="45" ry="45" fill="white" />
</svg>
</button>
</section>
</div>
<pre id="results"></pre>
<script>
document.body.addEventListener("click", function(e) {
console.log(e, "event delegation");
});
if (window.testRunner)
testRunner.dumpAsText();
window.onload = function () {
if (!window.internals)
return;
results.textContent = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION | internals.LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES);
document.getElementById('test').remove();
};
</script>
</body>
</html>