-
Notifications
You must be signed in to change notification settings - Fork 756
Open
Description
The Screen Interface define screen.width and screen.height in terms of the Web-exposed screen area.
It looks like this has not changed in a long time, since dc36ecd.
A web developer reported having to work around something around screen width/height in combination with orientation, and it looks like implementations disagree here. My test was simply:
<!doctype html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<pre></pre>
<script>
setInterval(() => {
document.querySelector('pre').textContent = `screen.width = ${screen.width}
screen.height = ${screen.height}
window.orientation = ${window.orientation}`;
}, 100);
</script>Testing this on Chrome for Android and Safari on iOS, I observe that:
- On Chrome,
screen.widthandscreen.heightflip when rotating the phone - On Safari,
screen.widthandscreen.heightstay the same - Chrome and Safari agree on what
window.orientationshould be, happily
Is the spec unambiguous on this point? I ask because I can't find any open WebKit bug about this, so I'm doubting the right behavior. (In my reading of the spec, maybe both are allowed?)
dpierangelimidnight-dev
Metadata
Metadata
Assignees
Type
Projects
Status
Regular agenda