Bug 1646510: Remove deprecated nsContentUtils::GetCrossDocParentNode. r=nika

Moves its last remaining (parent-process-only) caller to use a local static
copy instead.

Differential Revision: https://phabricator.services.mozilla.com/D109420
This commit is contained in:
Kris Maglione 2021-03-22 23:19:59 +00:00
Родитель 2e4b430900
Коммит ed88fc8bd1
3 изменённых файлов: 21 добавлений и 24 удалений

Просмотреть файл

@ -2294,22 +2294,6 @@ bool nsContentUtils::LookupBindingMember(
return true;
}
// static
nsINode* nsContentUtils::GetCrossDocParentNode(nsINode* aChild) {
MOZ_ASSERT(aChild, "The child is null!");
nsINode* parent = aChild->GetParentNode();
if (parent && parent->IsContent() && aChild->IsContent()) {
parent = aChild->AsContent()->GetFlattenedTreeParent();
}
if (parent || !aChild->IsDocument()) {
return parent;
}
return aChild->AsDocument()->GetEmbedderElement();
}
nsINode* nsContentUtils::GetNearestInProcessCrossDocParentNode(
nsINode* aChild) {
if (aChild->IsDocument()) {

Просмотреть файл

@ -369,15 +369,12 @@ class nsContentUtils {
int32_t* aOutputHeight);
/**
* Returns the parent node of aChild crossing document boundaries.
* Returns the parent node of aChild crossing document boundaries, but skips
* any cross-process parent frames and continues with the nearest in-process
* frame in the hierarchy.
*
* Uses the parent node in the composed document.
*/
static nsINode* GetCrossDocParentNode(nsINode* aChild);
/**
* Like GetCrossDocParentNode, but skips any cross-process parent frames and
* continues with the nearest in-process frame in the hierarchy.
*/
static nsINode* GetNearestInProcessCrossDocParentNode(nsINode* aChild);
/**

Просмотреть файл

@ -3078,6 +3078,22 @@ void EventStateManager::DecideGestureEvent(WidgetGestureNotifyEvent* aEvent,
}
#ifdef XP_MACOSX
static nsINode* GetCrossDocParentNode(nsINode* aChild) {
MOZ_ASSERT(aChild, "The child is null!");
MOZ_ASSERT(XRE_IsParentProcess());
nsINode* parent = aChild->GetParentNode();
if (parent && parent->IsContent() && aChild->IsContent()) {
parent = aChild->AsContent()->GetFlattenedTreeParent();
}
if (parent || !aChild->IsDocument()) {
return parent;
}
return aChild->AsDocument()->GetEmbedderElement();
}
static bool NodeAllowsClickThrough(nsINode* aNode) {
while (aNode) {
if (aNode->IsXULElement(nsGkAtoms::browser)) {
@ -3095,7 +3111,7 @@ static bool NodeAllowsClickThrough(nsINode* aNode) {
return false;
}
}
aNode = nsContentUtils::GetCrossDocParentNode(aNode);
aNode = GetCrossDocParentNode(aNode);
}
return true;
}