Bug 1698693 - Convert audited calls to GetCrossDocParentFrame() to GetCrossDocParentFrameInProcess(). r=tnikkel

See bug 1698693 comment 6 and subsequent comments for the audit.

Depends on D117388

Differential Revision: https://phabricator.services.mozilla.com/D117389
This commit is contained in:
Botond Ballo 2021-06-23 22:05:31 +00:00
Родитель c20a537ecd
Коммит cdcdf984e4
4 изменённых файлов: 15 добавлений и 13 удалений

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

@ -1084,7 +1084,7 @@ void DisplayPortUtils::ExpireDisplayPortOnAsyncScrollableAncestor(
nsIFrame* aFrame) {
nsIFrame* frame = aFrame;
while (frame) {
frame = nsLayoutUtils::GetCrossDocParentFrame(frame);
frame = nsLayoutUtils::GetCrossDocParentFrameInProcess(frame);
if (!frame) {
break;
}

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

@ -3676,7 +3676,8 @@ bool PresShell::ScrollFrameRectIntoView(nsIFrame* aFrame, const nsRect& aRect,
if (!parent && !(aScrollFlags & ScrollFlags::ScrollNoParentFrames)) {
nsPoint extraOffset(0, 0);
int32_t APD = container->PresContext()->AppUnitsPerDevPixel();
parent = nsLayoutUtils::GetCrossDocParentFrame(container, &extraOffset);
parent = nsLayoutUtils::GetCrossDocParentFrameInProcess(container,
&extraOffset);
if (parent) {
int32_t parentAPD = parent->PresContext()->AppUnitsPerDevPixel();
rect = rect.ScaleToOtherAppUnitsRoundOut(APD, parentAPD);

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

@ -1074,7 +1074,7 @@ bool nsLayoutUtils::IsAncestorFrameCrossDoc(const nsIFrame* aAncestorFrame,
const nsIFrame* aFrame,
const nsIFrame* aCommonAncestor) {
for (const nsIFrame* f = aFrame; f != aCommonAncestor;
f = GetCrossDocParentFrame(f)) {
f = GetCrossDocParentFrameInProcess(f)) {
if (f == aAncestorFrame) return true;
}
return aCommonAncestor == aAncestorFrame;
@ -1498,7 +1498,7 @@ static nsIFrame* GetNearestScrollableOrOverflowClipFrame(
}
return (aFlags & nsLayoutUtils::SCROLLABLE_SAME_DOC)
? aFrame->GetParent()
: nsLayoutUtils::GetCrossDocParentFrame(aFrame);
: nsLayoutUtils::GetCrossDocParentFrameInProcess(aFrame);
};
for (nsIFrame* f = aFrame; f; f = GetNextFrame(f)) {
@ -1737,7 +1737,7 @@ nsPoint GetEventCoordinatesRelativeTo(nsIWidget* aWidget,
const nsIFrame* rootFrame = frame;
bool transformFound = false;
for (const nsIFrame* f = frame; f;
f = nsLayoutUtils::GetCrossDocParentFrame(f)) {
f = nsLayoutUtils::GetCrossDocParentFrameInProcess(f)) {
if (f->IsTransformed() || ViewportUtils::IsZoomedContentRoot(f)) {
transformFound = true;
}
@ -2181,11 +2181,11 @@ const nsIFrame* nsLayoutUtils::FindNearestCommonAncestorFrame(
commonAncestor = aFrame1->PresShell()->GetRootFrame();
}
for (const nsIFrame* f = aFrame1; f != commonAncestor;
f = nsLayoutUtils::GetCrossDocParentFrame(f)) {
f = nsLayoutUtils::GetCrossDocParentFrameInProcess(f)) {
ancestors1.AppendElement(f);
}
for (const nsIFrame* f = aFrame2; f != commonAncestor;
f = nsLayoutUtils::GetCrossDocParentFrame(f)) {
f = nsLayoutUtils::GetCrossDocParentFrameInProcess(f)) {
ancestors2.AppendElement(f);
}
uint32_t minLengths = std::min(ancestors1.Length(), ancestors2.Length());
@ -4216,7 +4216,7 @@ nsIFrame* nsLayoutUtils::GetParentOrPlaceholderForCrossDoc(
const nsIFrame* aFrame) {
nsIFrame* f = GetParentOrPlaceholderFor(aFrame);
if (f) return f;
return GetCrossDocParentFrame(aFrame);
return GetCrossDocParentFrameInProcess(aFrame);
}
nsIFrame* nsLayoutUtils::GetDisplayListParent(nsIFrame* aFrame) {
@ -6973,7 +6973,7 @@ const nsIFrame* nsLayoutUtils::GetDisplayRootFrame(const nsIFrame* aFrame) {
} else if (IsPopup(f)) {
return f;
}
nsIFrame* parent = GetCrossDocParentFrame(f);
nsIFrame* parent = GetCrossDocParentFrameInProcess(f);
if (!parent) return f;
f = parent;
}
@ -9341,7 +9341,7 @@ CSSPoint nsLayoutUtils::GetCumulativeApzCallbackTransform(nsIFrame* aFrame) {
}
// Proceed to the parent frame.
frame = GetCrossDocParentFrame(frame);
frame = GetCrossDocParentFrameInProcess(frame);
}
return delta;
}

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

@ -7012,7 +7012,7 @@ Matrix4x4Flagged nsIFrame::GetTransformMatrix(ViewportType aViewportType,
// The offset from a zoomed content root to its parent (e.g. from
// a canvas frame to a scroll frame) is in layout coordinates, so
// apply it before applying any layout-to-visual transform.
*aOutAncestor = nsLayoutUtils::GetCrossDocParentFrame(this);
*aOutAncestor = nsLayoutUtils::GetCrossDocParentFrameInProcess(this);
nsPoint delta = GetOffsetToCrossDoc(*aOutAncestor);
/* Combine the raw transform with a translation to our parent. */
result.PostTranslate(NSAppUnitsToFloatPixels(delta.x, scaleFactor),
@ -7082,7 +7082,7 @@ Matrix4x4Flagged nsIFrame::GetTransformMatrix(ViewportType aViewportType,
}
}
*aOutAncestor = nsLayoutUtils::GetCrossDocParentFrame(this);
*aOutAncestor = nsLayoutUtils::GetCrossDocParentFrameInProcess(this);
/* Otherwise, we're not transformed. In that case, we'll walk up the frame
* tree until we either hit the root frame or something that may be
@ -7107,7 +7107,8 @@ Matrix4x4Flagged nsIFrame::GetTransformMatrix(ViewportType aViewportType,
while (*aOutAncestor != aStopAtAncestor.mFrame &&
!shouldStopAt(current, *aOutAncestor, aFlags)) {
/* If no parent, stop iterating. Otherwise, update the ancestor. */
nsIFrame* parent = nsLayoutUtils::GetCrossDocParentFrame(*aOutAncestor);
nsIFrame* parent =
nsLayoutUtils::GetCrossDocParentFrameInProcess(*aOutAncestor);
if (!parent) break;
current = *aOutAncestor;