Bug 1434399 part 2. Remove nsIDOMXULDocument's popupNode attribute. r=mystor

MozReview-Commit-ID: 5x0Fa12jBvg
This commit is contained in:
Boris Zbarsky 2018-01-31 14:49:27 -05:00
parent 99c47399c4
commit ae5bc0e5e3
2 changed files with 8 additions and 39 deletions

View File

@ -13,8 +13,6 @@ interface nsIBoxObject;
[uuid(7790d4c3-e8f0-4e29-9887-d683ed2b2a44)]
interface nsIDOMXULDocument : nsIDOMDocument
{
attribute nsIDOMNode popupNode;
/**
* These attributes correspond to trustedGetPopupNode().rangeOffset and
* rangeParent. They will help you find where in the DOM the popup is

View File

@ -1340,11 +1340,9 @@ GetScopeObjectOfNode(nsINode* node)
// nsIDOMXULDocument interface
//
NS_IMETHODIMP
XULDocument::GetPopupNode(nsIDOMNode** aNode)
already_AddRefed<nsINode>
XULDocument::GetPopupNode()
{
*aNode = nullptr;
nsCOMPtr<nsINode> node;
nsCOMPtr<nsPIWindowRoot> rootWin = GetWindowRoot();
if (rootWin) {
@ -1360,46 +1358,19 @@ XULDocument::GetPopupNode(nsIDOMNode** aNode)
if (node && nsContentUtils::CanCallerAccess(node)
&& GetScopeObjectOfNode(node)) {
*aNode = node->AsDOMNode();
NS_ADDREF(*aNode);
return node.forget();
}
return NS_OK;
}
already_AddRefed<nsINode>
XULDocument::GetPopupNode()
{
nsCOMPtr<nsIDOMNode> node;
DebugOnly<nsresult> rv = GetPopupNode(getter_AddRefs(node));
MOZ_ASSERT(NS_SUCCEEDED(rv));
nsCOMPtr<nsINode> retval(do_QueryInterface(node));
return retval.forget();
}
NS_IMETHODIMP
XULDocument::SetPopupNode(nsIDOMNode* aNode)
{
nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
if (aNode) {
// only allow real node objects
NS_ENSURE_ARG(node);
}
nsCOMPtr<nsPIWindowRoot> rootWin = GetWindowRoot();
if (rootWin) {
rootWin->SetPopupNode(node);
}
return NS_OK;
return nullptr;
}
void
XULDocument::SetPopupNode(nsINode* aNode)
{
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(aNode));
DebugOnly<nsresult> rv = SetPopupNode(node);
MOZ_ASSERT(NS_SUCCEEDED(rv));
nsCOMPtr<nsPIWindowRoot> rootWin = GetWindowRoot();
if (rootWin) {
rootWin->SetPopupNode(aNode);
}
}
// Returns the rangeOffset element from the XUL Popup Manager. This is for