Bug 1296822 - ignore the scrollbar size when nsIDOMWindowUtils.getRootBounds is used when fetching the page size for the findbar. r?jaws
MozReview-Commit-ID: 8chEDzgNVsL
--- a/toolkit/modules/FinderHighlighter.jsm
+++ b/toolkit/modules/FinderHighlighter.jsm
@@ -625,24 +625,24 @@ FinderHighlighter.prototype = {
// First we'll try without flushing layout, because it's way faster.
let dwu = this._getDWU(window);
let { width, height } = dwu.getRootBounds();
if (!width || !height) {
// We need a flush after all :'(
width = window.innerWidth + window.scrollMaxX - window.scrollMinX;
height = window.innerHeight + window.scrollMaxY - window.scrollMinY;
+
+ let scrollbarHeight = {};
+ let scrollbarWidth = {};
+ dwu.getScrollbarSize(false, scrollbarWidth, scrollbarHeight);
+ width -= scrollbarWidth.value;
+ height -= scrollbarHeight.value;
}
- let scrollbarHeight = {};
- let scrollbarWidth = {};
- dwu.getScrollbarSize(false, scrollbarWidth, scrollbarHeight);
- width -= scrollbarWidth.value;
- height -= scrollbarHeight.value;
-
return { width, height };
},
/**
* Utility; fetch the current text contents of a given range.
*
* @param {nsIDOMRange} range Range object to extract the contents from.
* @return {Array} Snippets of text.