зеркало из https://github.com/mozilla/gecko-dev.git
Adding support to get to the nsIDocShell from the iframe element. Fix for 27161. r=pavlov a=jevering
This commit is contained in:
Родитель
c70d285bff
Коммит
168ad6720e
|
@ -75,13 +75,6 @@ nsXULIFrameElement::GetDocShell(nsIDocShell** aDocShell)
|
||||||
{
|
{
|
||||||
NS_ENSURE_ARG_POINTER(aDocShell);
|
NS_ENSURE_ARG_POINTER(aDocShell);
|
||||||
|
|
||||||
NS_ERROR("Not Yet Implemented");
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
/*
|
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
|
||||||
|
|
||||||
nsCOMPtr<nsIContent> content(do_QueryInterface(mOuter));
|
nsCOMPtr<nsIContent> content(do_QueryInterface(mOuter));
|
||||||
nsCOMPtr<nsIDocument> document;
|
nsCOMPtr<nsIDocument> document;
|
||||||
content->GetDocument(*getter_AddRefs(document));
|
content->GetDocument(*getter_AddRefs(document));
|
||||||
|
@ -92,44 +85,11 @@ nsXULIFrameElement::GetDocShell(nsIDocShell** aDocShell)
|
||||||
if(!presShell)
|
if(!presShell)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
// Get the parent of the popup content.
|
nsCOMPtr<nsISupports> subShell;
|
||||||
nsCOMPtr<nsIDOMNode> popupSet;
|
presShell->GetSubShellFor(content, getter_AddRefs(subShell));
|
||||||
mOuter->GetParentNode(getter_AddRefs(popupSet));
|
if(!subShell)
|
||||||
if (!popupSet)
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
// Do a sanity check to ensure we have a popup set or menu element.
|
CallQueryInterface(subShell, aDocShell);
|
||||||
nsString tagName;
|
|
||||||
nsCOMPtr<nsIDOMElement> popupSetElement = do_QueryInterface(popupSet);
|
|
||||||
popupSetElement->GetTagName(tagName);
|
|
||||||
if (tagName != "popupset" && tagName != "menu")
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
// Now obtain the popup set frame.
|
|
||||||
nsCOMPtr<nsIContent> popupSetContent = do_QueryInterface(popupSet);
|
|
||||||
nsIFrame* frame;
|
|
||||||
presShell->GetPrimaryFrameFor(popupSetContent, &frame);
|
|
||||||
if (!frame)
|
|
||||||
return NS_OK;
|
|
||||||
|
|
||||||
// Obtain the element frame.
|
|
||||||
nsCOMPtr<nsIContent> elementContent = do_QueryInterface(aElement);
|
|
||||||
nsIFrame* elementFrame;
|
|
||||||
presShell->GetPrimaryFrameFor(elementContent, &elementFrame);
|
|
||||||
if (!elementFrame)
|
|
||||||
return NS_OK;
|
|
||||||
|
|
||||||
//XXX Once we have the frame we need to get to the inner frame and then
|
|
||||||
// extract the object the inner frame is holding on to.
|
|
||||||
|
|
||||||
nsCOMPtr<nsIHTMLInnerFrame> innerFrame;
|
|
||||||
elementFrame->GetInnerFrame(getter_AddRefs(innerFrame));
|
|
||||||
|
|
||||||
nsCOMPtr<nsIHTMLIFrameInnerFrame> iframeInnerFrame(do_QueryInterface(innerFrame));
|
|
||||||
if(!iframeInnerFrame)
|
|
||||||
return NS_OK;
|
|
||||||
|
|
||||||
iframeInnerFrame->GetDocShell(aDocShell);
|
|
||||||
|
|
||||||
return NS_OK; */
|
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче