зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1434399 part 2. Remove nsIDOMXULDocument's popupNode attribute. r=mystor
MozReview-Commit-ID: 5x0Fa12jBvg
This commit is contained in:
Родитель
9fe358b3cc
Коммит
099100b791
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче