Closed
Bug 56447
Opened 24 years ago
Closed 24 years ago
Cookie and Image UI sometimes has two tabs selected
Categories
(Core :: Graphics: Image Blocking, defect, P3)
Core
Graphics: Image Blocking
Tracking
()
People
(Reporter: jwbaker, Assigned: bugs)
References
Details
Attachments
(2 files)
731 bytes,
patch
|
Details | Diff | Splinter Review | |
1.85 KB,
patch
|
Details | Diff | Splinter Review |
On Linux 2000-10-12-21-MTrunk, the cookie and image UI sometimes comes up with two tabs selected. 1) Pick Tasks->Privacy->Images->View Sites Result: the dialog appears with both the first and third tabs selected. Expected Result: only the third tab is selected. My patch for this problem is attached. I wonder if the selection is supposed to automatically work when you set the index attribute of a tabcontrol?
Reporter | ||
Updated•24 years ago
|
Reporter | ||
Comment 1•24 years ago
|
||
Comment 2•24 years ago
|
||
morse needs to review this.
Comment 3•24 years ago
|
||
Very strange bug. It's obviously a glitch in the underlaying xul processing that is allowing this double-tab selection. This is simply a work-around to avoid the underlaying problem. But I am in agreement with this work-around. r=morse a=morse (as module owner)
Reporter | ||
Comment 4•24 years ago
|
||
Alright, but once this gets checked in I won't mark it fixed, but rather reassign to myself and mark future. I'll investigate XUL tabcontrol handling on the trunk.
Assignee | ||
Comment 5•24 years ago
|
||
This patch may fix the symptom, but the best fix for this is to use tabcontrol's 'selectedTab' property: tabControl.selectedTab = document.getElementById("imagesTab"); where 'tabControl' is the <tabcontrol>'s DOM node. The <xul:tabcontrol>'s code will sort everything else out for you.
Reporter | ||
Comment 6•24 years ago
|
||
Reporter | ||
Comment 7•24 years ago
|
||
I have attached a second patch which uses tabcontrol.selectedTab to set the active tab panel. Tested on Linux trunk build. Please give the new patch a quick review. Note that there is *no* way I would have ever discovered the selectedTab trick by myself. The XUL reference at http://www.mozilla.org/xpfe/xulref/ makes no mention of it. Indeed, http://www.mozilla.org/xpfe/xptoolkit/tabs.html specifically states that the correct way to make a tab active is by setting the index attribute. The string "selectedTab" does not appear on the mozilla.org site anywhere. I guess the only reference I can rely on are the XUL XML files themselves.(?)
Comment 8•24 years ago
|
||
r=morse for the second patch.
Assignee | ||
Comment 9•24 years ago
|
||
Yes, our <tabcontrol> implementation changed recently (in the past couple of months) to be completely defined in XBL, with an enhanced content node API. I'll send out a message to xpfe describing the new features... As for the newest patch, they call me Dr Pedant... the cleanest way to do this is like so: var tabID = !window.arguments[0] ? "cookiesTab" : "imagesTab"; element = document.getElementById("cookieViewerTabControl"); element.selectedTab = document.getElementById(tabID); (I saw you doing a comparison of window.arguments[0] with string "0", js makes these be the same in a simple equality comparison, it's only if you do window.arguments[0] === "0" [identity comparison] that type matters), so !window.arguments[0] is the same as (window.arguments[0] == "0")
Status: NEW → ASSIGNED
Comment 10•24 years ago
|
||
I would argue that using !window.arguments[0] instead of window.arguments[0] == "0" is a bad idea. It hides the intent of the code and so is much less readable.
Assignee | ||
Comment 11•24 years ago
|
||
The meaning of the parameter as a deck index is no longer really relevant, as the integer passed to the dialog is no longer used this way, rather it is now a boolean flag representing which tab to set as the selectedTab. If you wanted to make the meaning particularly explicit, you'd pass either "images" or "cookies" as the parameter to the dialog, and do a check for either of those, e.g. var tabID = window.arguments[0] == "cookies" ? "cookieTab" : "imagesTab";
Reporter | ||
Comment 12•24 years ago
|
||
My goal in making the patch was to change as few lines as possible, therefore having the best chance of slipping the fix into the 6.0 product. Therefore I left the wanky parameter passing and if/else logic in there.
Comment 13•24 years ago
|
||
This won't be accepted for rtm.
Assignee | ||
Comment 14•24 years ago
|
||
Really, I don't much care either way. !foo is just as readable to me as anything else. alternately, the expression would just read var tabID = window.arguments[0] == "0" ? "cookiesTab" : "imagesTab";
Comment 15•24 years ago
|
||
*** Bug 57258 has been marked as a duplicate of this bug. ***
Comment 16•24 years ago
|
||
*** Bug 58207 has been marked as a duplicate of this bug. ***
Updated•24 years ago
|
Hardware: PC → All
Comment 17•24 years ago
|
||
*** Bug 59633 has been marked as a duplicate of this bug. ***
Comment 18•24 years ago
|
||
*** Bug 60595 has been marked as a duplicate of this bug. ***
Comment 19•24 years ago
|
||
*** Bug 61089 has been marked as a duplicate of this bug. ***
Comment 20•24 years ago
|
||
*** This bug has been marked as a duplicate of 60210 ***
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Comment 21•24 years ago
|
||
verified dup of now fixed bug 60210 "Image manager shows 2 "top" tabs" (Linux SEA 2000121906)
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•