summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/svg/layout/svg-intrinsic-size-invalidation.html
blob: 7c3daf8e5c0c4b4c4cbb1f2ca38f237b480f8c9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!doctype html>
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1730351">
<link rel="help" href="https://drafts.csswg.org/css-sizing/#valdef-width-max-content">
<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>