Closed Bug 170040 Opened 23 years ago Closed 23 years ago

Elements not shown when body has overflow:hidden;

Categories

(Core :: Layout, defect)

defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 170011

People

(Reporter: bugzilla, Assigned: attinasi)

References

()

Details

(Keywords: regression, testcase)

Attachments

(4 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20020920 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20020920 This page and some subpages does not show anymore. Also see http://www.drunk.nl/lab This is a regression, worked fine before. Se bug 154568, comment 28 Reproducible: Always Steps to Reproduce:
Keywords: regression
Attached file Testcase
The problem is when setting overflow:hidden in the body tag. This testcase contains one div that is not shown at all because of this.
Summary: Page elements not visible → Elements now shown when body has overflow:hidden;
Summary: Elements now shown when body has overflow:hidden; → Elements not shown when body has overflow:hidden;
confirming - trunk build 2002092008
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Caused by the patch in bug 168294?
This behaviour is correct. The body has no in-flow content, therefore it has no height. Therefore the DIV is outside the body and is hidden.
But this brakes a lot of pages. I think that overflow:hidden; is used a lot to disable the scrollbars.
Then we need a quirks-mode hack to disable clipping for overflow:hidden on body (and HTML, I guess).
We'd better make a decision about this quickly.
Name some real web pages that it breaks. (By real, I mean ones that you use rather than ones that you (or someone you know) wrote.)
Oh, and see bug 93520 comment 25 about using 'overflow: hidden' on BODY to disable scrollbars.
This bug is incorrect. The BODY element is just a static element inside the HTML element. The height for the body is "auto" and since absolute positioned element inside another element do not take up any space the height will ignore the size and position of the absolute positioned children and the height will be calculated form static/relative positioned children
This one is more informative because it shows the height of the body. It also allows you to change the overflow to get a feeling for how the BODY element (and the overflow for it) fit into the CSS box model.
Ok, so this is incorrect, but if you just do a google search on hide scrollbars, you will find several links telling you about th use overflow:hidden; in the body to hide scrollbars. Will all those urls become "tech evangelism" bugs? Can comment 6 be a solution to this?
OS: Windows 98 → All
Hardware: PC → All
Before we make a quirk for it, we'd like to have some evidence that this affects a significant number of sites, i.e. that not having the quirk is noticeably hurting the experience of Mozilla users (and not just surprising Web developers). Assuming we get that, we have to decide what quirk to implement. My initial reaction is that we should address this and bug 93520 at the same time by, in quirks mode only, 1) Making overflow:hidden on BODY or HTML turn off scrollbars 2) Otherwise treating overflow:hidden on BODY or HTML as overflow:visible BTW, CSS gurus, we need a standards-based way to turn off scrollbars in the viewport, and I don't know what that is. In fact based on some comments by hixie in the past, I'm not even sure one currently exists. If not, please correct that situation :-). I realize that overflow:hidden on HTML or BODY certainly *isn't* a standards-compatible way to do that.
there isn't a standard compliant solution for everything and up until very recently this did the job, very well i might add. Anyway i don't want to be bitching as there is a very easy solution to the problem, just add, height: 100%; to your CSS and you're set, same result as before and when you think of it quite logical.
I have proposed something (@viewport) to the WG: http://lists.w3.org/Archives/Member/w3c-css-wg/2002JulSep/0396.html Incidentally, this bug is a duplicate of bug marked WONTFIX or INVALID.
*** Bug 177879 has been marked as a duplicate of this bug. ***
*** Bug 178150 has been marked as a duplicate of this bug. ***
*** Bug 178515 has been marked as a duplicate of this bug. ***
Something seemed to have changed, because the first testcase shows the div now. Even though the body has overflow:hidden;
This is a duplicate of a bug roc has, I think. He temporarily backed out the change that caused it while waiting for clarification from the CSS WG.
Whiteboard: DUPEME
This looks like a dupe of bug 148527
*** Bug 148527 has been marked as a duplicate of this bug. ***
11.1 Overflow and clipping A box may overflow if it is positioned absolutely. Overflow property specifies whether the content of a block-level element is clipped when it overflows the element's box (which is acting as a containing block for the content) ( http://www.w3.org/TR/REC-CSS2/visufx.html#overflow-clipping ) ----------------------------------------------------------------- OK. Now to matters. 11.1 Overflow and clipping "A box may overflow if it is positioned absolutely." Case 1) the absolute element's outer-edges fit within its containing block's inner-edges. result: no clipping should occur. Case 2) the absolute element's outer-edges do not fit within its containing block's inner-edges. result: clipping should occur. Case 3) the absolute element's containing block is the initial containing block. . Result: clipping should not occur
The attachment from bug 148527 , http://bugzilla.mozilla.org/attachment.cgi?id=85905&action=view The root (html element) establishes the containing block for the block level contents. The body is not the containing block of the contents (which are absolutely positioned). Expected Result: Body's computed height should be 0. Contents should not be clipped by body. Actual Result: Contets are clipped by body as if body were the containing block. 10.1 Definition of "containing block" If there is no such ancestor, the content edge of the root element's box establishes the containing block.
build: mac osx 20021130 In the two testcases here ACTUAL RESULTS: body { overflow: auto; } body's absolutetly positioned content is clipped. THis is incorrect. attachment 2 [details] [diff] [review] (id=100138) body { overflow: hidden; } body's absolutetly positioned content (red div) not is clipped, rather it is visible. THis is correct.
yes *** This bug has been marked as a duplicate of 170011 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: