Closed Bug 1154193 Opened 10 years ago Closed 2 years ago

scrollTop on document.body when it is display:none should work

Categories

(Core :: DOM: CSS Object Model, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
firefox40 --- affected

People

(Reporter: zcorpan, Assigned: smaug)

References

Details

In quirks mode, when "the body element" is display:none, setting scrollTop on it should scroll the viewport. http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3497 <!-- quirks --> <head style="display:block; height:1000px; background:url(image) no-repeat center center"> <body style="display:none" onload="document.body.scrollTop = 400"> This should work per spec and it does in other browsers. We could change the spec but I don't see that it is obviously wrong to have a display:none body still work as a controller for the viewport.
Flags: needinfo?(roc)
In standards mode, should this also work if the documentElement is display:none? I guess that's not really detectable...
Yeah, I think you can't scroll if the root is display:none.
Olli, does the scrollingElement stuff fix this too, or does this need a separate fix?
Flags: needinfo?(bugs)
It does not change this stuff.
Flags: needinfo?(bugs)
but I guess I could take this too.
Assignee: nobody → bugs
Status: NEW → RESOLVED
Closed: 2 years ago
Depends on: 1364360
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.