[Webkit-unassigned] [Bug 52653] Media queries should ignore scroll bars when calculating width of viewport

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 25 19:09:19 PDT 2023


--- Comment #6 from Šime Vidas <sime.vidas at gmail.com> ---
Since in Safari, CSS media queries take classic scrollbars into account, I tried to determine how Safari prevents infinite loops that can be caused in such an environment.

I’ve uploaded two videos that show Safari’s behavior: https://mastodon.social/@simevidas/111128752905785569


* Safari shows empty scrollbar gutters. The scrollbar is not present, but the scrollbar gutter is still there, and as a result, the viewport size is reduced.

* The value returned by document.documentElement.clientWidth does not match the viewport width. This property is supposed to return the width of the initial containing block, which has the same width as the layout viewport in desktop browsers. But in Safari in these specific scenarios, the property returns a number that is *larger* than the viewport width.

So in order to prevent infinite loops, Safari implements some weird behaviors that could be considered bugs. If Apple does not want to align with other browsers and the CSS spec, then you should at least document Safari’s behavior, so that developers have an easier time understanding it. This is of course if Safari behaves as intended.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230926/18373876/attachment-0001.htm>

More information about the webkit-unassigned mailing list