What does the style visibility:hidden do when applied to the html element? Does it have anything to do with the scrollbars, esp. in regards to IE7?
Background: Oracle Apex generates this code, and I’m trying to work out if it’s causing an issue with an intermittently hidden horizontal scrollbar in IE7:
<style> html {visibility:hidden;} </style>
Specifications
According to the spec, the
visibilityproperty should still affect layout. This implies to me that it should not affect scrolling if an element ends up causing scroll behavior. Also, any children set tovisibleshould be visible within ahiddenelement.Observed Behavior
Using this fiddle…
Firefox, IE 8-10, Opera
Makes
visibility: hiddenon thehtmlelement not render thebody(as it should) but still shows some rendering of thehtmlitself as it shows thebackground-color. As BoltClock noted in his comment, this actually may be expected, since thebackgroundof thehtmlis (according to spec) to become…These browsers also allow elements set back to
visibleinside to show as the spec forvisibilityindicated, so thedivis showing and can scroll.Chrome and Safari
It does not render the
background-coloron thehtml, but it does allow thedivto show and it shows the scroll bars. So Chrome is not propagating thebackgroundproperty to the canvas, presumably because itsvisibilitywas set tohidden.IE7
The
background-colorfor thehtmlelement does not render (like Chrome) but there are also no scroll bars showing up for thedivelement inside. This seems to indicate that it is not properly staying in the layout per the spec.So it may be that the
visibility: hiddenproperty is part of your issue. Obviously, the background point relates not at all to your scroll issue, but does address the point of your overall question on how the property affects thehtmlelement.In my opinion, the Chrome and Safari rendering would seem to be the most intuitive (what I might expect as a designer), as I would not expect the
background-colorto render (since the element ishidden), but at the same time, if I set a child asvisible, then I would expect the browser to let me scroll on behalf of that child even if thehtmlwrapper is set tovisibility: hidden. However, whether the webkit browsers or the other browsers are closest to the spec is debatable, for as BoltClock noteed in his comment, the spec does not seem to indicate whethervisibilityon thehtmlelement should or should not affect the propagation of thebackgroundproperty).