diff --git a/embedding/browser/gtk/src/EmbedPrivate.cpp b/embedding/browser/gtk/src/EmbedPrivate.cpp index 5d8917652fd4..8d6600246920 100644 --- a/embedding/browser/gtk/src/EmbedPrivate.cpp +++ b/embedding/browser/gtk/src/EmbedPrivate.cpp @@ -396,6 +396,11 @@ EmbedPrivate::AppendToStream(const char *aData, PRInt32 aLen) { if (!mStream) return NS_ERROR_FAILURE; + + // Attach listeners to this document since in some cases we don't + // get updates for content added this way. + ContentStateChange(); + return mStream->AppendToStream(aData, aLen); } @@ -441,7 +446,7 @@ EmbedPrivate::FindPrivateForBrowser(nsIWebBrowserChrome *aBrowser) } void -EmbedPrivate::ContentProgressChange(void) +EmbedPrivate::ContentStateChange(void) { // we don't attach listeners to chrome if (mListenersAttached && !mIsChrome) diff --git a/embedding/browser/gtk/src/EmbedPrivate.h b/embedding/browser/gtk/src/EmbedPrivate.h index a02bc5a84fd2..833ab65ededd 100644 --- a/embedding/browser/gtk/src/EmbedPrivate.h +++ b/embedding/browser/gtk/src/EmbedPrivate.h @@ -73,9 +73,9 @@ class EmbedPrivate { static EmbedPrivate *FindPrivateForBrowser(nsIWebBrowserChrome *aBrowser); // This is an upcall that will come from the progress listener - // whenever there is a progress change. We need this so we can + // whenever there is a content state change. We need this so we can // attach event listeners. - void ContentProgressChange (void); + void ContentStateChange (void); // This is an upcall from the progress listener when content is // finished loading. We have this so that if it's chrome content diff --git a/embedding/browser/gtk/src/EmbedProgress.cpp b/embedding/browser/gtk/src/EmbedProgress.cpp index 17014480a9a0..818ffe57001d 100644 --- a/embedding/browser/gtk/src/EmbedProgress.cpp +++ b/embedding/browser/gtk/src/EmbedProgress.cpp @@ -51,6 +51,8 @@ EmbedProgress::OnStateChange(nsIWebProgress *aWebProgress, PRInt32 aStateFlags, PRUint32 aStatus) { + // give the widget a chance to attach any listeners + mOwner->ContentStateChange(); // if we've got the start flag, emit the signal if ((aStateFlags & GTK_MOZ_EMBED_FLAG_IS_DOCUMENT) && (aStateFlags & GTK_MOZ_EMBED_FLAG_START)) @@ -99,9 +101,6 @@ EmbedProgress::OnProgressChange(nsIWebProgress *aWebProgress, PRInt32 aMaxTotalProgress) { - // give the widget a chance to attach any listeners - mOwner->ContentProgressChange(); - nsXPIDLCString uriString; RequestToURIString(aRequest, getter_Copies(uriString));