mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1018778 - Part b: use more early returns in nsDocumentViewer::SyncParentSubDocMap; r=roc
This commit is contained in:
parent
d008d6e04d
commit
67f40acbc2
@ -573,29 +573,33 @@ nsDocumentViewer::SyncParentSubDocMap()
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> pwin(docShell->GetWindow());
|
||||
nsCOMPtr<Element> element;
|
||||
if (mDocument && pwin) {
|
||||
element = pwin->GetFrameElementInternal();
|
||||
if (!mDocument || !pwin) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (element) {
|
||||
nsCOMPtr<nsIDocShellTreeItem> parent;
|
||||
docShell->GetParent(getter_AddRefs(parent));
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> parent_win = parent ? parent->GetWindow() : nullptr;
|
||||
if (parent_win) {
|
||||
nsCOMPtr<nsIDocument> parent_doc = parent_win->GetDoc();
|
||||
if (parent_doc) {
|
||||
if (mDocument && parent_doc->GetSubDocumentFor(element) != mDocument) {
|
||||
mDocument->SuppressEventHandling(nsIDocument::eEvents,
|
||||
parent_doc->EventHandlingSuppressed());
|
||||
}
|
||||
return parent_doc->SetSubDocumentFor(element, mDocument);
|
||||
}
|
||||
}
|
||||
nsCOMPtr<Element> element = pwin->GetFrameElementInternal();
|
||||
if (!element) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
nsCOMPtr<nsIDocShellTreeItem> parent;
|
||||
docShell->GetParent(getter_AddRefs(parent));
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> parent_win = parent ? parent->GetWindow() : nullptr;
|
||||
if (!parent_win) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> parent_doc = parent_win->GetDoc();
|
||||
if (!parent_doc) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (mDocument && parent_doc->GetSubDocumentFor(element) != mDocument) {
|
||||
mDocument->SuppressEventHandling(nsIDocument::eEvents,
|
||||
parent_doc->EventHandlingSuppressed());
|
||||
}
|
||||
return parent_doc->SetSubDocumentFor(element, mDocument);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
Loading…
Reference in New Issue
Block a user