Closed Bug 157445 Opened 23 years ago Closed 23 years ago

descendants of 'visibility:hidden' can't be 'visibility:visible' in Mozilla if the hidden frame has a widget

Categories

(Core :: Web Painting, defect, P2)

x86
Other
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: tapio.markula, Assigned: roc)

References

()

Details

(Keywords: testcase, Whiteboard: [fix])

Attachments

(6 files, 1 obsolete file)

According to David Baron (<dbaron@fas.harvard.edu>) descendants of visibility:hidden can have visibility:visible. Mozilla 1.1a has bug in this matter. Concering the CSS2 spec. the behavior of MS IE follows the stricly CSS2 spec. because the spec. ALLOWS that descendants of visibility:visible can have descencants, which have visibility:hidden. IF 'visibility' is inherited property, it is logical that descendants can have different values as their anchestors. BUT the new CSS3 spec. could however tell, that descendants of visibility:hidden can have visibility:visible and at this mean it differs essential from 'display:none'. This bug can be seen on the page: http://www.nic.fi/~tapio1/Sielu/future.php3 there was something wrong in this page because a CSS-file was corrupted. I fixed this matter. RELOAD the page if it looks bad. In principle it should have nice dynamic menus like in most of my pages, but some CSS is missing. If you HIDE the menu by using links on the right, ONE arrow should remain visible.
*** Bug 157446 has been marked as a duplicate of this bug. ***
I believe from some tests I did that Mozilla has full support for visible children of hidden parents. If you could simplify the code, I might be able to figure out why it isn't working. Otherwise, I think this bug cannot be traced.
to me to create a minimal-ish testcase.....
Assignee: attinasi → bzbarsky
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached file testcase
This shows what the problem is... removing the "position: fixed" makes the bug go away.
So the problem is that fixed-position elements have a widget. Anything that has a widget and "visibility:hidden" gets its view marked hidden (the comments say "If it has a widget, hide the view because the widget can't deal with it"). The checkin that added the above lines (nsCSSFrameConstructor, nsBoxFrame, nsContainerFrame, nsHTMLContainerFrame) was a very long time ago.... is that comment still relevant? What breaks if we allow something that has a widget to not paint itself but paint the kids? Over to views.
Assignee: bzbarsky → roc+moz
Severity: normal → major
Component: Layout → Views
Summary: descendants of 'visibility:hidden' can't be 'visibility:visible' in Mozilla → descendants of 'visibility:hidden' can't be 'visibility:visible' in Mozilla if the hidden frame has a widget
You're right. The "widget can't deal with it" comment and associated code is very old, from before I ever started hacking on views. I honestly don't know why it's in there. Try taking it out and see what happens :-). Over time I have reduced the need for widgets to be attached to views (attaching or removing a widget from a view shouldn't have any effect except for performance). However, I don't know what shoud happen if you have a hidden scroll frame with a visible child. That would be weird. I don't know what we'd do in that case although it is possible we would do something reasonable :-).
This fixes the original page and the position:fixed testcases. It does not fix the overflow:scroll issue, since there is separate code checking for a scrollframe there (and I don't think we want to change that). This is for testing purposes only; if this were to land it should be in an "alpha" milestone... That said, I see no problems so far running with this.
Priority: -- → P2
We really should merge all the view setup code into one place.
Reproduced on 12/16 Trunk, Win XP
Keywords: testcase
Linux trunk actually works for me. Is this only a problem on Windows?
Ah, testcase 91737 does not work on Linux.
Attached patch fixSplinter Review
This patch does the job. We hide anything that doesn't have native scrollbars, which means we *can* hide normal scroll frames. I'll attach an interesting test in a moment, which this patch passes.
Attachment #91761 - Attachment is obsolete: true
Comment on attachment 112586 [details] [diff] [review] fix What about similar code in nsBoxFrame, nsHTMLContainerFrame, nsCSSFrameConstructor?
Attachment #112586 - Flags: superreview?(bzbarsky)
Attachment #112586 - Flags: review?(bzbarsky)
Also interesting... attachment 91718 [details] fails in the 2003-01-24-05 nightly, and in my clean debug build (but not in my slightly-dirty opt build...)
I factored them all out into nsContainerFrame a while ago :-). One function to rule them all ...
Comment on attachment 112586 [details] [diff] [review] fix I knew there was a reason I thought you rocked. ;) That's likely when the second of the three testcases got fixed too.
Attachment #112586 - Flags: superreview?(bzbarsky)
Attachment #112586 - Flags: superreview+
Attachment #112586 - Flags: review?(bzbarsky)
Attachment #112586 - Flags: review+
Fix checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: