[Webkit-unassigned] [Bug 133271] vw units not calculated properly when scrollbars are present and overflow is not auto

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Oct 26 12:49:41 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=133271

Karan Lyons <karan at karanlyons.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |karan at karanlyons.com

--- Comment #3 from Karan Lyons <karan at karanlyons.com> ---
Scrollbars are supposed to *not* be ignored when overflow is set to scroll. Currently, they're ignored no matter what overflow's set to, which is in defiance of the viewport units' spec.

By way of example, assume a viewport 200px wide by 100px tall. If the root element is set to "overflow: auto;", 100vw should be 200px, and 100vh 100px. This is because the scrollbars should be ignored, regardless of whether they're present. For this case all browsers are doing the right thing. Here's what that looks like, in crude ascii form:

+------------------+
|                  |
|     viewport     |
|     200x100      |
|                  |
|                  |
+------------------+


Now set "overflow: scroll;". Let's say our scrollbars are 20px wide. So if scrollbars are visible, the browser's viewport is now 20px less in whichever dimension has a scrollbar. If its in both dimensions, our layout is now as such:

+----------------+-+
|    viewport    | |
|     180x80     | |
|                | |
+----------------+ |
|   scrollbars     |
+------------------+

Currently, Webkit reports the viewport as *still* being 200x100. Which makes viewport units close to useless when scrollbars are present: 100 units no longer equals 100% of the viewport, but some amount more.

The spec is very clear about this being incorrect behavior. It states, "The viewport-percentage lengths are relative to the size of the initial containing block."[1] and only a couple sentences later says, "Note that the initial containing block’s size is affected by the presence of scrollbars on the viewport."

Right now the initial containing block's (the document's root element in this case) size is *not* being affected by the presence of scrollbars on the viewport, like the spec states it should be.

[1] http://dev.w3.org/csswg/css-values/#viewport-relative-lengths

-- 
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/20141026/486def77/attachment-0002.html>


More information about the webkit-unassigned mailing list