Commit 4afacb20 authored by Gijs Kruitbosch's avatar Gijs Kruitbosch
Browse files

Bug 1594457 - fix DOMTitleChanged handling for reloads, r=bgrins

Differential Revision: https://phabricator.services.mozilla.com/D52022

--HG--
extra : moz-landing-system : lando
parent ec7910ea
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -5249,6 +5249,10 @@
          return;
        }

        if (!browser.docShell || event.target != browser.docShell.document) {
          return;
        }

        var titleChanged = this.setTabTitle(tab);
        if (titleChanged && !tab.selected && !tab.hasAttribute("busy")) {
          tab.setAttribute("titlechanged", "true");
+10 −1
Original line number Diff line number Diff line
@@ -29,7 +29,16 @@ sendAsyncMessage("Content:BrowserChildReady", {
addEventListener(
  "DOMTitleChanged",
  function(aEvent) {
    if (!aEvent.isTrusted || aEvent.target.defaultView != content) {
    if (
      !aEvent.isTrusted ||
      // Check that we haven't been closed (DOM code dispatches this event
      // asynchronously).
      content.closed ||
      // Check that the document whose title changed is the toplevel document,
      // rather than a subframe, and check that it is still the current
      // document in the docshell - we may have started loading another one.
      docShell.document != aEvent.target
    ) {
      return;
    }
    sendAsyncMessage("DOMTitleChanged", { title: content.document.title });