[csswg-drafts] [cssom-view] Let offsetWidth / offsetHeight report actual size? (#4541)

hugoholgersson has just created a new issue for https://github.com/w3c/csswg-drafts:

== [cssom-view] Let offsetWidth / offsetHeight report actual size? ==
```
<a href="#" id="a">
<div style="width: 40px; height: 40px; background-color: green;"></div>
</a>
<script>
document.write("This link has size: " + a.offsetWidth + "x" + a.offsetHeight + ".");
</script>
```

Firefox, Edge 42, IE 11: 40x40 
Chrome, Safari: 0x0

According to current spec [1], I guess Chrome is correct. However, from a developer perspective, returning the actual size, as Firefox does, is way more useful and intuitive.

[1] Return the size of "the first CSS layout box associated with the element".

Is Firefox's behavior spec-able?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4541 using your GitHub account

Received on Tuesday, 26 November 2019 13:48:18 UTC