Closed
Bug 261826
Opened 20 years ago
Closed 15 years ago
XUL tabs appear in wrong order, if a tab's HIDDEN attribute is set to TRUE then later revealed by either setting HIDDEN to FALSE or removing the HIDDEN attribute entirely.
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: agilmore, Assigned: bzbarsky)
References
Details
Attachments
(2 files)
837 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
1.21 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1 The following XUL demonstrates the problem. The tabs will appear in the incorrect order : first, second, fourth, third. <!-- XML Start here --> <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="MyWindow" title="" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="800" height="600" onload="revealTab()"> <script type="application/x-javascript"> function revealTab(){ document.getElementById("fourthTab").setAttribute("hidden", "false"); } </script> <tabbox> <tabs> <tab label="first"/> <tab label="second"/> <tab label="third"/> <tab id="fourthTab" label="fourth" hidden="true"/> </tabs> <tabpanels> <tabpanel> <label value="First page"/> </tabpanel> <tabpanel> <label value="second page"/> </tabpanel> <tabpanel> <label value="third page"/> </tabpanel> <tabpanel> <label value="fourth page"/> </tabpanel> </tabpanels> </tabbox> </window> <!-- XML End --> Reproducible: Always Steps to Reproduce: 1. View code placed in 'Details' in mozilla browser 2. 3. Actual Results: Third tab appears after the Fourth tab, rather then where it should appear, before. Expected Results: Display the tabs in the order they are defined in the XUL - First, Second, Third, Fourth. This bug occurs at least in FF 9.x, 1.0PR and Mozilla Navigator, on OSes Win98, Win2000 and Debian Linux.
Assignee: general → nobody
Component: GFX → XP Toolkit/Widgets: XUL
QA Contact: ian
Assignee | ||
Comment 1•20 years ago
|
||
Assignee | ||
Comment 2•20 years ago
|
||
Looks like frame construction gets confused about where the frame for the tabpanel goes.... In particular, the problem is that the XBL inserts a spacer at the beginning of the child list of the <tabs> and that in nsCSSFrameConstructor::ContentInserted we call nsCSSFrameConstructor::FindPreviousSibling to find the previous sibling. But we use aIndexInContainer as the place to start looking, and our index in the content iterator is actually one larger (because of the anonymous content XBL inserted). See the XXX comment before the FindPreviousSibling() call in ContentInserted(); that's biting us here, basically.
Assignee | ||
Comment 3•20 years ago
|
||
Assignee | ||
Comment 4•20 years ago
|
||
I think the best thing to do here would be to make GetInsertionPoint() return not only the insertion point but also the index of the content in the insertion point.... That would replace aIndexInContainer for the following manipulations, then. Alternately, we need to fix FindPreviousSibling() to not start with aIndexInContainer, since that can end up bogus. Thoughts?
Status: UNCONFIRMED → NEW
Component: XP Toolkit/Widgets: XUL → Layout: Misc Code
Ever confirmed: true
QA Contact: core.layout.misc-code
A hack(?) would be to wrap the tabs <children> with <hbox>, which has the added side-effect of making ordinal on <tab>s work as expected (since consumers don't have to understand the spacers on the ends of the <tabs>). Of course, doing that causes crashes (why wouldn't it? eXtremely Unstable Languages are the best!), so I'm not going to pursue cleaning up the theme to look right.
Comment 7•18 years ago
|
||
(In reply to comment #6) >A hack(?) would be to wrap the tabs <children> with <hbox> Unfortunately this stops the tabs from flexing properly, so it's no use.
Comment 8•15 years ago
|
||
I'm pretty sure setting .collapsed instead should mitigate these problems (at least some of them).
Assignee | ||
Comment 9•15 years ago
|
||
Fixed by checkin for bug 307394. Checked in test.
Status: NEW → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → bzbarsky
Updated•6 years ago
|
Product: Core → Core Graveyard
Updated•6 years ago
|
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•