зеркало из https://github.com/mozilla/gecko-dev.git
Bug 772679. Make test_offsets.js handle the viewport being transformed. r=tnikkel
This commit is contained in:
Родитель
65fc24b3ac
Коммит
3fe838d0e8
|
@ -119,11 +119,15 @@ function checkScrolledElement(element, child)
|
|||
element.scrollTop = 20;
|
||||
is(element.scrollLeft, 0, element.id + " scrollLeft after vertical scroll");
|
||||
is(element.scrollTop, 20, element.id + " scrollTop after vertical scroll");
|
||||
is(child.getBoundingClientRect().top, childrect.top - 20, "child position after vertical scroll");
|
||||
// If the viewport has been transformed, then we might have scrolled to a subpixel value
|
||||
// that's slightly different from what we requested. After rounding, however, it should
|
||||
// be the same.
|
||||
is(Math.round(childrect.top - child.getBoundingClientRect().top), 20, "child position after vertical scroll");
|
||||
|
||||
element.scrollTop = 0;
|
||||
is(element.scrollLeft, 0, element.id + " scrollLeft after vertical scroll reset");
|
||||
is(element.scrollTop, 0, element.id + " scrollTop after vertical scroll reset");
|
||||
// Scrolling back to the top should work precisely.
|
||||
is(child.getBoundingClientRect().top, childrect.top, "child position after vertical scroll reset");
|
||||
|
||||
element.scrollTop = 10;
|
||||
|
@ -135,7 +139,7 @@ function checkScrolledElement(element, child)
|
|||
element.scrollLeft = 18;
|
||||
is(element.scrollLeft, 18, element.id + " scrollLeft after horizontal scroll");
|
||||
is(element.scrollTop, 0, element.id + " scrollTop after horizontal scroll");
|
||||
is(child.getBoundingClientRect().left, childrect.left - 18, "child position after horizontal scroll");
|
||||
is(Math.round(childrect.left - child.getBoundingClientRect().left), 18, "child position after horizontal scroll");
|
||||
|
||||
element.scrollLeft = -30;
|
||||
is(element.scrollLeft, 0, element.id + " scrollLeft after horizontal scroll reset");
|
||||
|
|
Загрузка…
Ссылка в новой задаче