From e61c8b68a6a3b532a9c1e44e421b55c0a884be6e Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Fri, 1 Mar 2013 14:04:29 +1100 Subject: [PATCH] Bug 821208 - don't reference chatbox.iframe until the XBL bindings have been created. r=gavin --- browser/base/content/socialchat.xml | 83 +++++++++++++---------------- 1 file changed, 37 insertions(+), 46 deletions(-) diff --git a/browser/base/content/socialchat.xml b/browser/base/content/socialchat.xml index 6ca1d44be29..c485ee20200 100644 --- a/browser/base/content/socialchat.xml +++ b/browser/base/content/socialchat.xml @@ -20,6 +20,37 @@ + + document.getAnonymousElementByAttribute(this, "anonid", "iframe"); @@ -381,51 +412,6 @@ ]]> - - - - - - - - @@ -451,11 +437,16 @@ this.chatboxForURL.delete(aURL); } cb = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "chatbox"); + // _callbacks is a javascript property instead of a as it + // must exist before the (possibly delayed) bindings are created. + cb._callbacks = [aCallback]; + // src also a javascript property; the src attribute is set in the ctor. + cb.src = aURL; if (aMode == "minimized") cb.setAttribute("minimized", "true"); + cb.setAttribute("origin", aProvider.origin); this.insertBefore(cb, this.firstChild); this.selectedChat = cb; - this.initChatBox(cb, aProvider, aURL, aCallback); this.chatboxForURL.set(aURL, Cu.getWeakReference(cb)); this.resize(); ]]>