cssvwunit feature detection broken on Firefox in the presence of a scrollbar #1045

Closed
rjgotten opened this Issue Sep 25, 2013 · 5 comments

Projects

None yet

2 participants

@rjgotten

Firefox bases the width of the vw unit on the viewport minus any scrollbars. This corresponds to document.documentElement.clientWidth and not window.innerWidth as the cssvwunit test is currently using.

@patrickkettner
Member

Hey @rjgotten, I was not able to replicate this. When I checked this in Firefox 24 on Windows and OS X, the numbers are identical. Could you let us know more about the case you are running into? A specific browser and OS version, and a jsfiddle would be amazing

@rjgotten

Hey @rjgotten, I was not able to replicate this. When I checked this in Firefox 24 on Windows and OS X, the numbers are identical.

That would be because your testcase is incorrect; the codepen sample does not include a vertical scrollbar.
This issue only occurs when a vertical scrollbar is present.

@patrickkettner
Member

Not sure what you mean, there is a vertical scrollbar

image

@rjgotten

Your test is still broken.

The vertical scroll bar is not yet present before the first paint, which means as long as the Modernizr test runs before first paint you will not see the problem.

Add something like:

:root {
  overflow-y : scroll;
}

to force the vertical scrollbar to always be present and you'll see the difference pop up.

@patrickkettner
Member

Ah, how silly of me. Thank you for your persistence :]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment