Bug 1386777 - Interpret autoscroll anchor coordinates correctly when there is a device scale. r=kats

MozReview-Commit-ID: 6caXxWjuqxm

--HG--
extra : rebase_source : 4052dd05a4c05cc8fc4effe0f7911179aa8005d0
This commit is contained in:
Botond Ballo 2017-08-02 20:11:07 -04:00
Родитель 165e4a9eef
Коммит 61926bc8e4
2 изменённых файлов: 3 добавлений и 2 удалений

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

@ -81,7 +81,7 @@ interface nsITabParent : nsISupports
/**
* Notify APZ to start autoscrolling.
* (aAnchorX, aAnchorY) are the coordinates of the autoscroll anchor,
* in LayoutDevice coordinates relative to the screen. aScrollId and
* in CSS coordinates relative to the screen. aScrollId and
* aPresShellId identify the scroll frame that content chose to scroll.
*/
void startApzAutoscroll(in float aAnchorX, in float aAnchorY,

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

@ -3283,7 +3283,8 @@ TabParent::StartApzAutoscroll(float aAnchorX, float aAnchorY,
// The anchor coordinates that are passed in are relative to the origin
// of the screen, but we are sending them to APZ which only knows about
// coordinates relative to the widget, so convert them accordingly.
LayoutDeviceIntPoint anchor = RoundedToInt(LayoutDevicePoint{aAnchorX, aAnchorY});
CSSPoint anchorCss{aAnchorX, aAnchorY};
LayoutDeviceIntPoint anchor = RoundedToInt(anchorCss * widget->GetDefaultScale());
anchor -= widget->WidgetToScreenOffset();
widget->StartAsyncAutoscroll(