tabbox.selectedTab returns tab from another tabbox if tabpanels comes before tabs

UNCONFIRMED
Unassigned

Status

()

defect
UNCONFIRMED
12 years ago
5 months ago

People

(Reporter: matmota, Unassigned)

Tracking

({testcase})

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.4) Gecko/20070509 SeaMonkey/1.1.2
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a6pre) Gecko/20070616 Minefield/3.0a6pre

When putting the tabpanels element before the tabs element in a tabbox, with another tabbox inside one of its tabpanels, the property selectedTab of the outer tabbox is set to the selected tab in the inner tabbox.
It does not make a difference whether the inner tabbox has the tabs and tabpanels elements in the normal order or not.


Reproducible: Always

Steps to Reproduce:
1.Load the attached example XUL file, with a tabbox with another tabbox inside one of its panels, and the tabpanels child before the tabs one.
2.Click on "Test tabbox.selectedTab", which reports about the selected tab in the outer tabbox (identifier "correct-tabbox").

Actual Results:  
The alert message reports as follows:
-------------------------------------------
The selected tab in
correct-tabbox
belongs to the tabbox
bogus-tabbox
The tab label is: This is the bogus one
-------------------------------------------


Expected Results:  
The alert message should report the following:
-------------------------------------------
The selected tab in
correct-tabbox
belongs to the tabbox
correct-tabbox
The tab label is: Tab 1
-------------------------------------------
This is what happens if you move the tabs child element in the outer tabbox to be before the tabpanels child element.

I did this because I wanted the tabs drawn on top of the tabpanels to get the selected tab displayed connected to its panel, as a workaround for bug #265698

Apart from Firefox 3.0a6pre in MacOS X as reported, I've tried also in Firefox 2.0.0.4, and SeaMonkey 1.1.2, bot in MacOS X.
Also in Firefox 2.0.0.4 in Windows XP.
The results are always the same.

In the case of SeaMonkey, this test case also causes the following exception, even after putting the tabs element before tabpanels, when selecting "Tab 2" and then "Tab 1":
------------------------------------------------------
Error: [Exception... "'Permission denied to get property XULElement.disabled' when calling method: [nsIDOMXULControlElement::disabled]"  nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)"  location: "JS frame :: chrome://global/content/bindings/tabbox.xml :: selectNewTab :: line 331"  data: no]
Source File: chrome://global/content/bindings/tabbox.xml
Line: 331
------------------------------------------------------
Keywords: testcase
Version: unspecified → Trunk
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.