Closed Bug 410391 Opened 17 years ago Closed 17 years ago

Clicking on the status-bar security button does not focus on the security tab in the pageinfo window

Categories

(SeaMonkey :: Page Info, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: philip.chee, Assigned: philip.chee)

References

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

Steps to reproduce:
1. Navigate to any page.
2. Click on the security button in the status bar.

Actual Results:
The pageinfo window is opened with the general tab selected.

Expected Results:
The pageinfo window is opened with the security tab selected.
Attachment #295010 - Flags: superreview?(neil)
Attachment #295010 - Flags: review?(db48x)
> -  tabbox.selectedItem = initialTab;
> -  tabbox.selectedItem.doCommand();
> -  tabbox.focus();
> +  tabbox.selectedTab = initialTab;
> +  tabbox.selectedTab.focus();

Cruft that came over from Firefox:
 .selectedItem doesn't work on <tabbox>.
 There are no oncommand attributes on any of the tabs.

Is .focus() needed here? I can't tell the difference with and without.
Neil on #IRC agrees that the .focus() isn't necessary.
Attachment #295010 - Attachment is obsolete: true
Attachment #295012 - Flags: superreview?(neil)
Attachment #295012 - Flags: review?(db48x)
Attachment #295010 - Flags: superreview?(neil)
Attachment #295010 - Flags: review?(db48x)
Comment on attachment 295012 [details] [diff] [review]
V1.1 Open the PageInfo window with the correct tab selected.

Sorry, but it turns out that I prefer the focus behaviour of attachment 295010 [details] [diff] [review].

I'm also not convinced about the navigator.js change - why not deal with it in page info instead?
Attachment #295012 - Flags: superreview?(neil) → superreview-
> I'm also not convinced about the navigator.js change - why not deal with it in
> page info instead?

API compatibility with Firefox 3.0b2. In porting Firefox PageInfo extensions to SeaMonkey I need fewer if/else blocks. e.g.:
============================================
function viewdep_show()
{
  var depTab = 'DepTab';
  if("@mozilla.org/xre/app-info;1" in Components.classes) {
    var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
                            .getService(Components.interfaces.nsIXULAppInfo);
    var versionChecker = Components.classes["@mozilla.org/xpcom/version-comparator;1"]
                                   .getService(Components.interfaces.nsIVersionComparator);
    if(versionChecker.compare(appInfo.platformVersion, "1.9b2") >= 0)
      depTab = 'Dep';
  }
  BrowserPageInfo(null, depTab);
}
============================================
If I use the full ID in pageInfo.js then I'll need another check for application as well as the check for Gecko version. By the way this is how I discovered the bug in SeaMonkey's pageInfo. But it's a minor problem. New patch coming up.
Fix Neil's nits.
Attachment #295012 - Attachment is obsolete: true
Attachment #295015 - Flags: superreview?(neil)
Attachment #295015 - Flags: review?(db48x)
Attachment #295012 - Flags: review?(db48x)
Comment on attachment 295015 [details] [diff] [review]
V1.2 Open the PageInfo window with the correct tab selected (fix nits)

Bah, he gives me a good reason, then ignores it...
Attachment #295015 - Flags: superreview?(neil) → superreview-
Attachment #295010 - Attachment is obsolete: false
Attachment #295010 - Flags: superreview+
Comment on attachment 295015 [details] [diff] [review]
V1.2 Open the PageInfo window with the correct tab selected (fix nits)

I guess you can do it this way too if you insist.
Attachment #295015 - Flags: superreview- → superreview+
Comment on attachment 295015 [details] [diff] [review]
V1.2 Open the PageInfo window with the correct tab selected (fix nits)

Perhaps change this:

>+  initialTab = document.getElementById(initialTab) || document.getElementById("generalTab");

to:

+  initialTab = document.getElementById(initialTab) || document.getElementById(initialTab + "Tab") || document.getElementById("generalTab");

(with appropriate line-wrappings)

This way here, cross UA extensions can work correctly, while we can still keep our code clean and not require the ID trailing with the word "Tab".

(Note, this change won't slow us down, as we pre-store the var "initialTab" as "generalTab" here, so only incorrect ID's will hit all conditions.)

Neil, Ratty, thoughts?
I thought of that, but some extension author might have two elements in their overlay called "foo" and "fooTab" where "foo" might be something else entirely.
could always swap the || order then? :-)
I'm going to file a bug against Firefox to revert to the previous API. Let's see how they react first.
Blocks: 407917
FYI: I've filed Bug 410751 against Firefox to revert to the previous API, so far it's got two r+ and is waiting for a1.9.
Comment on attachment 295015 [details] [diff] [review]
V1.2 Open the PageInfo window with the correct tab selected (fix nits)

r=db48x, thanks.
Attachment #295015 - Flags: review?(db48x) → review+
Keywords: checkin-needed
Attachment #295010 - Attachment is obsolete: true
Checking in suite/browser/pageinfo/pageInfo.js;
/cvsroot/mozilla/suite/browser/pageinfo/pageInfo.js,v  <--  pageInfo.js
new revision: 1.8; previous revision: 1.7
done
Status: NEW → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: