- From: Boris Zbarsky <bzbarsky@mit.edu>
- Date: Mon, 13 Apr 2015 17:26:41 -0400
- To: www-style@w3.org
On 4/13/15 5:13 PM, Simon Pieters wrote:
> Yeah, it should be null to match scrollTop's behavior. This was an
> oversight.
>
> https://github.com/w3c/csswg-drafts/commit/ad098d66cfc02a4952e8af2eeea742c520d10c2b
So what _is_ scrollTop's behavior, exactly? Consider this testcase
(quirks mode):
<html>
<body style="display: none">
</body>
<script>
var body = document.createElement("body");
document.documentElement.appendChild(body);
var div = document.createElement("div");
div.style.height = "5000px";
body.appendChild(div);
</script>
</html>
scroll down and check document.body.scrollTop.
I believe the current spec says that this should return window.scrollY
(because the element in question is the body element and does not have a
scrolling box), but in Firefox it does not (because it doesn't have a
box at all).
In IE11, .scrollTop on _both_ of the <body> elements in that testcase
returns the scroll position. So does document.documentElement.scrollTop...
-Boris
Received on Monday, 13 April 2015 21:27:11 UTC