Bug 1300784 - Follow-up: update browser_selectpopup.js to handle floating point values for bounding client rects. r=jaws

MozReview-Commit-ID: 5O2lmNOZHZD

--HG--
extra : rebase_source : 1a442500cce744c55768bdf7c2f53fb74c4404a0
This commit is contained in:
Mike Conley 2017-01-06 16:12:55 -05:00
parent 7fde7078aa
commit b3c9f9342d

View File

@ -447,9 +447,14 @@ function* performLargePopupTests(win) {
let cs = win.getComputedStyle(selectPopup);
let bpBottom = parseFloat(cs.paddingBottom) + parseFloat(cs.borderBottomWidth);
is(selectPopup.childNodes[60].getBoundingClientRect().bottom,
selectPopup.getBoundingClientRect().bottom - bpBottom,
"Popup scroll at correct position " + bpBottom);
// Some of the styles applied to the menuitems are percentages, meaning
// that the final layout calculations returned by getBoundingClientRect()
// might return floating point values. We don't care about sub-pixel
// accuracy, and only care about the final pixel value, so we add a
// fuzz-factor of 1.
SimpleTest.isfuzzy(selectPopup.childNodes[60].getBoundingClientRect().bottom,
selectPopup.getBoundingClientRect().bottom - bpBottom,
1, "Popup scroll at correct position " + bpBottom);
}
yield hideSelectPopup(selectPopup, "enter", win);