зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1476221 - Keep the bounding client rect of the 'FormAssist:AutoCompleteResults' message relative to the visual viewport. r=mstange
Depends on D6090 Differential Revision: https://phabricator.services.mozilla.com/D6091 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
08d328e92e
Коммит
022d2224d5
|
@ -378,9 +378,17 @@ var FormAssistant = {
|
|||
scrollY += rect.top + parseInt(top);
|
||||
}
|
||||
|
||||
// The rect computed above is relative to the origin of the viewport frame,
|
||||
// i.e. the layout viewport origin, but the consumer of the
|
||||
// FormAssist::AutoCompleteResult messaage expects a rect relative to
|
||||
// the visual viewport origin, so translate between the two.
|
||||
let offsetX = {}, offsetY = {};
|
||||
aElement.ownerGlobal.windowUtils
|
||||
.getVisualViewportOffsetRelativeToLayoutViewport(offsetX, offsetY);
|
||||
|
||||
return {
|
||||
x: r.left + scrollX,
|
||||
y: r.top + scrollY,
|
||||
x: r.left + scrollX - offsetX.value,
|
||||
y: r.top + scrollY - offsetY.value,
|
||||
w: r.width,
|
||||
h: r.height,
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче