Bug 1755521 - Don't lose track of anchor rect width on popup position change. r=stransky

Differential Revision: https://phabricator.services.mozilla.com/D138827
This commit is contained in:
stransky 2022-03-02 12:33:27 +00:00
parent d825fb6d4c
commit 52970abaec

View File

@ -2411,8 +2411,14 @@ void nsMenuPopupFrame::MoveTo(const CSSPoint& aPos, bool aUpdateAttrs) {
return;
}
mAnchorType = MenuPopupAnchorType_Point;
mScreenRect.MoveTo(appUnitsPos);
if (mAnchorType == MenuPopupAnchorType_Rect) {
// This ensures that the anchor width is still honored, to prevent it from
// changing spuriously.
mScreenRect.height = 0;
} else {
mAnchorType = MenuPopupAnchorType_Point;
}
SetPopupPosition(nullptr, true, mSizedToPopup);