Bug 1655398 - Don't move the client area rect for the root scroll frame. r=mats
The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
https://github.com/w3c/csswg-drafts/issues/5363.
Differential Revision: https://phabricator.services.mozilla.com/D84959
This commit is contained in:
@@ -860,8 +860,10 @@ nsRect Element::GetClientAreaRect() {
|
||||
MOZ_ASSERT(frame);
|
||||
nsRect scrollPort = sf->GetScrollPortRect();
|
||||
nsIFrame* scrollableAsFrame = do_QueryFrame(sf);
|
||||
if (frame != scrollableAsFrame) {
|
||||
// We want the offset to be relative to `frame`, not `sf`.
|
||||
// We want the offset to be relative to `frame`, not `sf`... Except for the
|
||||
// root scroll frame, which is an ancestor of frame rather than a descendant
|
||||
// and thus this wouldn't particularly make sense.
|
||||
if (frame != scrollableAsFrame && !sf->IsRootScrollFrameOfDocument()) {
|
||||
scrollPort.MoveBy(scrollableAsFrame->GetOffsetTo(frame));
|
||||
}
|
||||
// The scroll port value might be expanded to the minimum scale size, we
|
||||
|
||||
Reference in New Issue
Block a user