I've found window.innerWidth,window.innerHeight,body.clientWidth and body.clientHeight get different values when executing it before and after window.onload. However, the web page doesn't change at all(the areas are all the same). The test results are listed below.Is this the correct behavior for all web-kit based browsers?
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<script>
console.log(window.innerWidth);
console.log("<br />");
console.log(window.innerHeight);
console.log("<br />");
console.log(body.clientWidth);
console.log("<br />");
console.log(body.clientHeight);
</script>
<body>
<br/>===================================<br/>
</body>
<script>
console.log(window.innerWidth);
console.log("<br />");
console.log(window.innerHeight);
console.log("<br />");
console.log(body.clientWidth);
console.log("<br />");
console.log(body.clientHeight);
</script>
</html>
Test Results:
Android Phone(720*1280,4.7''),Android Chrome
360
567
964
176
===================================
980 - window.innerWidth changed
1544 - window.innerHeight changed
964
440 - Why body.clientHeight becomes 440 after the blank body is loaded.