Closed Bug 558673 Opened 10 years ago Closed 10 years ago

Implement Firefox TabBrowser API: getIcon()

Categories

(SeaMonkey :: UI Design, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.1a2

People

(Reporter: sgautherie, Assigned: sgautherie)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

http://mxr.mozilla.org/mozilla-central/search?string=getIcon&case=1
{
/browser/base/content/tabbrowser.xml
    * line 658 -- <method name="getIcon">
}

Currently needed by bug 556684
/docshell/test/browser/browser_bug550565.js
This doesn't (fully) fix, but it helps, bug 556684.
Attachment #438373 - Flags: superreview?(neil)
Attachment #438373 - Flags: review?(neil)
Blocks: 554908
review ping
Attachment #438373 - Flags: review?(bugspam.Callek)
Comment on attachment 438373 [details] [diff] [review]
(Av1) Just copy it from Firefox
[Checkin: Comment 4]

Stealing review, going for the "no sr needed" route.
Attachment #438373 - Flags: superreview?(neil)
Attachment #438373 - Flags: review?(neil)
Attachment #438373 - Flags: review?(bugspam.Callek)
Attachment #438373 - Flags: review+
Comment on attachment 438373 [details] [diff] [review]
(Av1) Just copy it from Firefox
[Checkin: Comment 4]


http://hg.mozilla.org/comm-central/rev/650b6d05de95
Attachment #438373 - Attachment description: (Av1) Just copy it from Firefox → (Av1) Just copy it from Firefox [Checkin: Comment 4]
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Depends on: 525708
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.1a2
+          <![CDATA[
+            let browser = aTab ? this.getBrowserForTab(aTab) : this.selectedBrowser;
Bah. Use |var| for top level variables. Spidermonkey internally converts top level lets to vars anyway.
(In reply to comment #5)
> +          <![CDATA[
> +            let browser = aTab ? this.getBrowserForTab(aTab) :
> this.selectedBrowser;
> Bah. Use |var| for top level variables. Spidermonkey internally converts top
> level lets to vars anyway.

Fwiw, is method == top level ?
> Fwiw, is method == top level ?

let|var browser is at the top of the scope of the "getIcon" method so, yes. The sytle guide for suite/ is to use lets only for sub-scope variables e.g. inside for/if/while/try blocks and only if there is a chance of ambiguity e.g. if you have several |for (var i = 0; i < foo: i++)| then you should use |for (let i = 0; i < foo: i++)|
Comment on attachment 438373 [details] [diff] [review]
(Av1) Just copy it from Firefox
[Checkin: Comment 4]

>+            let browser = aTab ? this.getBrowserForTab(aTab) : this.selectedBrowser;
This could also have used .linkedBrowser (getBrowserForTab also only exists for Firefox compatibility).
(In reply to comment #8)
> This could also have used .linkedBrowser (getBrowserForTab also only exists for
> Firefox compatibility).

Ftr,
*Done in bug 554908.
*http://mxr.mozilla.org/comm-central/search?string=getBrowserForTab&case=on&find=%2Fsuite%2F
 "Found 17 matching lines in 9 files"
 Should we update "all" these too? And add a comment on getBrowserForTab()?
You need to log in before you can comment on or make changes to this bug.