W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2019

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

From: Hugo via GitHub <sysbot+gh@w3.org>
Date: Tue, 26 Nov 2019 13:48:16 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-528736355-1574776095-sysbot+gh@w3.org>
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>
document.write("This link has size: " + a.offsetWidth + "x" + a.offsetHeight + ".");

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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:56 UTC