Closed Bug 2017004 Opened 9 months ago Closed 9 months ago

Port bug 543435: Make initial about:blank loading into iframe not get overwritten … (Follow-up)

Categories

(Thunderbird :: Upstream Synchronization, defect)

Thunderbird 147
defect

Tracking

(Not tracked)

RESOLVED FIXED
149 Branch

People

(Reporter: welpy-cw, Assigned: welpy-cw)

References

Details

(Keywords: regression)

Attachments

(1 external file)

There are several place in the code relying solely on Document.readyState which may cause problems after bug 543435. See for example this case with the following STR:

  1. Open a message in a standalone window.
  2. Close the 3-pane window.
  3. 'Tools' -> 'Address Book' (Ctrl-Shift-B)

After step 3, a new 3-pane window is being opened, but the address book tab is not, instead

Uncaught (in promise) TypeError: can't access property "globalOverlay", messengerWindow.tabmail is undefined
    toAddressBook chrome://messenger/content/mailCore.js:455
    oncommand chrome://messenger/content/messageWindow.xhtml:1

is displayed in the error console.

I am not sure if bug 2003514 would have an impact on this again, so for now I suggest the following patch. As mentioned, there are several other places we might want to check, see this Searchfox query.

Due to the changes in Bug 543435 (Synchronous about:blank), the initial empty
document is now created synchronously. This results in document.readyState
being "complete" immediately upon window creation.

Consequently, the checks in toAddressBook, toCalendar, and toImport were
passing prematurely, attempting to open tabs on the transient initial document
before the actual Mail UI was fully restored.

This patch adds a check for document.isUncommittedInitialDocument. If true,
the code will now correctly wait for the mail-tabs-session-restored
notification before attempting to interact with the window.

Assignee: nobody → h.w.forms
Status: NEW → ASSIGNED
See Also: → 2013725
Attachment #9545336 - Attachment description: Bug 2017004 - Wait for initial document commit in mailCore navigation helpers. r=#thunderbird-reviewers → Bug 2017004 - Centralize messenger window opening and wait for initial document commit. r=#thunderbird-reviewers
Target Milestone: --- → 149 Branch

Pushed by brendan@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/eef133129e0a
Centralize messenger window opening and wait for initial document commit. r=darktrojan

Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: