Bug 1171708 - Use localName when detecting <xul:browsers> for XULFrameLoaderCreated. r?billm draft
authorMike Conley <mconley@mozilla.com>
Fri, 06 Nov 2015 13:59:47 -0500
changeset 308837 a15834e739c98140e21438031c791c2ae5792a8b
parent 308813 91d8ab369785377c2967f475acc0de4830e581df
child 308838 a9de07e15a62d79c64aaf62fc7d20da59ce5aaaa
push id7540
push usermconley@mozilla.com
push dateSun, 15 Nov 2015 23:34:28 +0000
reviewersbillm
bugs1171708
milestone45.0a1
Bug 1171708 - Use localName when detecting <xul:browsers> for XULFrameLoaderCreated. r?billm We were using tagName before, which is fine for the dynamically created browsers in new tabs, but not fine for the initial browser tab, which has a tagName of "xul:browser" instead of "browser". Using localName makes sure that we don't get the XML namespace included with the node name. We also separately check the namespace.
browser/components/sessionstore/SessionStore.jsm
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -872,17 +872,20 @@ var SessionStoreInternal = {
       case "TabUnpinned":
       case "SwapDocShells":
         this.saveStateDelayed(win);
         break;
       case "oop-browser-crashed":
         this.onBrowserCrashed(win, target);
         break;
       case "XULFrameLoaderCreated":
-        if (target.tagName == "browser" && target.frameLoader && target.permanentKey) {
+        if (target.prefix == "xul" &&
+            target.localName == "browser" &&
+            target.frameLoader &&
+            target.permanentKey) {
           this._lastKnownFrameLoader.set(target.permanentKey, target.frameLoader);
           this.resetEpoch(target);
         }
         break;
       default:
         throw new Error(`unhandled event ${aEvent.type}?`);
     }
     this._clearRestoringWindows();