mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-14 20:16:10 +00:00
lazily instantiate mDocument. bug 88229 r=jst,rpotts
This commit is contained in:
parent
aff7819e0d
commit
452c8e0f41
@ -748,6 +748,13 @@ NS_IMETHODIMP GlobalWindowImpl::GetPrincipal(nsIPrincipal** result)
|
|||||||
|
|
||||||
NS_IMETHODIMP GlobalWindowImpl::GetDocument(nsIDOMDocument** aDocument)
|
NS_IMETHODIMP GlobalWindowImpl::GetDocument(nsIDOMDocument** aDocument)
|
||||||
{
|
{
|
||||||
|
/* lazily instantiate an about:blank document if necessary, and if we have
|
||||||
|
what it takes to do so. Note that domdoc here is the same thing as
|
||||||
|
our mDocument, but we don't have to explicitly set the member variable
|
||||||
|
because the docshell has already called SetNewDocument(). */
|
||||||
|
if (!mDocument && mDocShell)
|
||||||
|
nsCOMPtr<nsIDOMDocument> domdoc(do_GetInterface(mDocShell));
|
||||||
|
|
||||||
*aDocument = mDocument;
|
*aDocument = mDocument;
|
||||||
NS_IF_ADDREF(*aDocument);
|
NS_IF_ADDREF(*aDocument);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user