зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1200870, allow -1 as a value to popup.moveTo, r=tn
This commit is contained in:
Родитель
463eafe643
Коммит
79a594a069
|
@ -2183,8 +2183,7 @@ nsMenuPopupFrame::MoveTo(const CSSIntPoint& aPos, bool aUpdateAttrs)
|
|||
}
|
||||
|
||||
nsPresContext* presContext = PresContext();
|
||||
mAnchorType = aPos.x == -1 || aPos.y == -1 ?
|
||||
MenuPopupAnchorType_Node : MenuPopupAnchorType_Point;
|
||||
mAnchorType = MenuPopupAnchorType_Point;
|
||||
mScreenRect.x = aPos.x - presContext->AppUnitsToIntCSSPixels(margin.left);
|
||||
mScreenRect.y = aPos.y - presContext->AppUnitsToIntCSSPixels(margin.top);
|
||||
|
||||
|
|
|
@ -376,9 +376,14 @@ function testPopupMovement()
|
|||
|
||||
popup.moveTo(-1, -1);
|
||||
[screenX, screenY] = getScreenXY(popup);
|
||||
[buttonScreenX, buttonScreenY] = getScreenXY(button);
|
||||
is(screenX, buttonScreenX, gTests[gTestIndex] + " original x");
|
||||
is(screenY, buttonScreenY + Math.round(button.getBoundingClientRect().height), gTests[gTestIndex] + " original y");
|
||||
|
||||
expectedx = (overlapOSChrome ? screen.left : screen.availLeft);
|
||||
expectedy = (overlapOSChrome ? screen.top : screen.availTop);
|
||||
|
||||
is(screenX, expectedx, gTests[gTestIndex] + " move after set left and top x to -1");
|
||||
is(screenY, expectedy, gTests[gTestIndex] + " move after set left and top y to -1");
|
||||
is(popup.left, "", gTests[gTestIndex] + " left is not set after moving to -1");
|
||||
is(popup.top, "", gTests[gTestIndex] + " top is not set after moving to -1");
|
||||
|
||||
popup.hidePopup();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче