Implement getBrowser() in MailNews windows

RESOLVED FIXED in seamonkey2.1b1

Status

SeaMonkey
MailNews: Message Display
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: Robert Kaiser, Assigned: Robert Kaiser)

Tracking

Trunk
seamonkey2.1b1

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
Thunderbird has a getBrowser() implementation in its mail window, originally introduced for their use of the find bar, but also used with toolkit's zoom manager and potentially others, see http://mxr.mozilla.org/comm-central/source/mail/base/content/mailWindow.js#506

We should implement it for the same reasons as well as for Thunderbird add-on compat.

I'll need it for the zoom manager in bug 386363, for one thing.
(Assignee)

Comment 1

7 years ago
FYI, bug 328795 originally introduced it in Thunderbird.

I already worked around it not being there in bug bug 562339 ending up with http://mxr.mozilla.org/comm-central/source/suite/mailnews/mailContextMenus.js#119 - we should probably changes that one to use getBrowser() as well.
(Assignee)

Comment 2

7 years ago
Created attachment 467496 [details] [diff] [review]
v1: implement it!

This patch is relatively straight-forward, esp. as that caller it adds right now had exactly the same code in use before. :)
Attachment #467496 - Flags: review?(iann_bugzilla)

Comment 3

7 years ago
Comment on attachment 467496 [details] [diff] [review]
v1: implement it!

>+// The zoom manager, view source and possibly some other functions still rely
>+// on the getBrowser function.
>+function getBrowser()
>+{
>+  return GetTabMail() ? GetTabMail().getBrowserForSelectedTab() :
>+                        document.getElementById("messagepane");
>+}

Um, getMessageBrowser() exists...
(Assignee)

Comment 4

7 years ago
(In reply to comment #3)
> Um, getMessageBrowser() exists...

for one thing, it can't replace getBrowser() as toolkit code doesn't know about anything else but getBrowser. For the other, it doesn't take .getBrowserForSelectedTab() into account, from what I see, and Thunderbird switched away from what getMessageBrowser does in bug 495818 because that returned the wrong browser in some cases.

Comment 5

7 years ago
Comment on attachment 467496 [details] [diff] [review]
v1: implement it!

I'd prefer getBrowser function to be in mailWindowOverlay.js, so r=me with that addressed.
Attachment #467496 - Flags: review?(iann_bugzilla) → review+

Comment 6

7 years ago
> > Um, getMessageBrowser() exists...
> 
> for one thing, it can't replace getBrowser() as toolkit code doesn't know about
> anything else but getBrowser. For the other, it doesn't take
> .getBrowserForSelectedTab() into account, from what I see, and Thunderbird
> switched away from what getMessageBrowser does in bug 495818 because that
> returned the wrong browser in some cases.

I meant that you should call getMessageBrowser() (or even gMessageBrowser) instead of touching document.getElementById("messagepane") directly.
(Assignee)

Comment 7

7 years ago
Pushed as http://hg.mozilla.org/comm-central/rev/071ee24478ff with Ian's and Karsten's nits addressed.
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.1b1
You need to log in before you can comment on or make changes to this bug.