Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<link rel="match" href="svg-intrinsic-size-invalidation-ref.html">
<style>
#avatar {
width: 128px;
display: block;
}
#container {
width: max-content;
border: 10px solid green;
}
</style>
<div id="ancestor">
<div id="container">
<svg viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg" id="avatar">
<rect height="100%" width="100%" fill="blue"></rect>
</svg>
</div>
</div>
<script>
onload = function() {
let avatar = document.getElementById("avatar");
let ancestor = document.getElementById("ancestor");
avatar.getBoundingClientRect();
avatar.style.maxWidth = "100px";
ancestor.style.padding = "10px";
}
</script>