mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Pass OnStartDocumentLoad() notifications received for child frames up to the DocLoaderListeners
This commit is contained in:
parent
d90a2215fc
commit
30ae7065dc
@ -2252,7 +2252,7 @@ nsWebShell::DoLoadURL(nsIURI * aUri,
|
||||
// Tell web-shell-container we are loading a new url
|
||||
if (nsnull != mContainer) {
|
||||
nsAutoString uniSpec (urlSpec);
|
||||
nsresult rv = mContainer->BeginLoadURL(this, uniSpec.GetUnicode());
|
||||
rv = mContainer->BeginLoadURL(this, uniSpec.GetUnicode());
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
@ -3450,14 +3450,31 @@ nsWebShell::OnStartDocumentLoad(nsIDocumentLoader* loader,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*Fire the OnStartDocumentLoad of the webshell observer
|
||||
*/
|
||||
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
|
||||
{
|
||||
mDocLoaderObserver->OnStartDocumentLoad(mDocLoader, aURL, aCommand);
|
||||
}
|
||||
if (loader == mDocLoader) {
|
||||
nsCOMPtr<nsIDocumentLoaderObserver> dlObserver;
|
||||
|
||||
if (!mDocLoaderObserver && mParent) {
|
||||
/* If this is a frame (in which case it would have a parent && doesn't
|
||||
* have a documentloaderObserver, get it from the rootWebShell
|
||||
*/
|
||||
nsCOMPtr<nsIWebShell> root;
|
||||
nsresult res = GetRootWebShell(*getter_AddRefs(root));
|
||||
|
||||
if (NS_SUCCEEDED(res) && root)
|
||||
root->GetDocLoaderObserver(*getter_AddRefs(dlObserver));
|
||||
}
|
||||
else
|
||||
{
|
||||
dlObserver = do_QueryInterface(mDocLoaderObserver); // we need this to addref
|
||||
}
|
||||
/*
|
||||
*Fire the OnStartDocumentLoad of the webshell observer
|
||||
*/
|
||||
if ((nsnull != mContainer) && (nsnull != dlObserver))
|
||||
{
|
||||
dlObserver->OnStartDocumentLoad(mDocLoader, aURL, aCommand);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -2252,7 +2252,7 @@ nsWebShell::DoLoadURL(nsIURI * aUri,
|
||||
// Tell web-shell-container we are loading a new url
|
||||
if (nsnull != mContainer) {
|
||||
nsAutoString uniSpec (urlSpec);
|
||||
nsresult rv = mContainer->BeginLoadURL(this, uniSpec.GetUnicode());
|
||||
rv = mContainer->BeginLoadURL(this, uniSpec.GetUnicode());
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
@ -3450,14 +3450,31 @@ nsWebShell::OnStartDocumentLoad(nsIDocumentLoader* loader,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*Fire the OnStartDocumentLoad of the webshell observer
|
||||
*/
|
||||
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
|
||||
{
|
||||
mDocLoaderObserver->OnStartDocumentLoad(mDocLoader, aURL, aCommand);
|
||||
}
|
||||
if (loader == mDocLoader) {
|
||||
nsCOMPtr<nsIDocumentLoaderObserver> dlObserver;
|
||||
|
||||
if (!mDocLoaderObserver && mParent) {
|
||||
/* If this is a frame (in which case it would have a parent && doesn't
|
||||
* have a documentloaderObserver, get it from the rootWebShell
|
||||
*/
|
||||
nsCOMPtr<nsIWebShell> root;
|
||||
nsresult res = GetRootWebShell(*getter_AddRefs(root));
|
||||
|
||||
if (NS_SUCCEEDED(res) && root)
|
||||
root->GetDocLoaderObserver(*getter_AddRefs(dlObserver));
|
||||
}
|
||||
else
|
||||
{
|
||||
dlObserver = do_QueryInterface(mDocLoaderObserver); // we need this to addref
|
||||
}
|
||||
/*
|
||||
*Fire the OnStartDocumentLoad of the webshell observer
|
||||
*/
|
||||
if ((nsnull != mContainer) && (nsnull != dlObserver))
|
||||
{
|
||||
dlObserver->OnStartDocumentLoad(mDocLoader, aURL, aCommand);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user