Fix bug #73947. Clients weren't getting notifications when the first loaded content was about:blank or was streamed in data. Attach the listeners when you get a state change, not a progress change since we don't get progress changes on streamed content. r=tor,bryner sr=shaver

This commit is contained in:
blizzard%redhat.com 2001-04-11 23:18:10 +00:00
Родитель 66cd4b7f18
Коммит b6cdcc7852
3 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -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

Просмотреть файл

@ -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));