Bug 1924277. nsIFrame::IsScrolledOutOfView should intersect the rect with scroll frames that clip it. r=hiro,layout-reviewers,jwatt,emilio

Seems like we should be doing this as a frame that is clipped out fully but requires two scroll frames to fully clip it is just as visible as a frame where one scroll frame fully clips it.

Differential Revision: https://phabricator.services.mozilla.com/D225442
This commit is contained in:
Timothy Nikkel 2024-10-17 08:43:37 +00:00
parent b6e1f6ec3a
commit 15ff5d04a1

View File

@ -11320,18 +11320,12 @@ static bool IsFrameRectScrolledOutOfView(const nsIFrame* aTarget,
nsRect transformedRect = nsLayoutUtils::TransformFrameRectToAncestor(
aTarget, aTargetRect, clipParent);
if (transformedRect.IsEmpty()) {
// If the transformed rect is empty it represents a line or a point that we
// should check is outside the the scrollable rect.
if (transformedRect.x > clipRect.XMost() ||
transformedRect.y > clipRect.YMost() ||
clipRect.x > transformedRect.XMost() ||
clipRect.y > transformedRect.YMost()) {
return true;
}
} else if (!transformedRect.Intersects(clipRect)) {
Maybe<nsRect> intersection =
transformedRect.EdgeInclusiveIntersection(clipRect);
if (intersection.isNothing()) {
return true;
}
transformedRect = *intersection;
nsIFrame* parent = clipParent->GetParent();
if (!parent) {