Bug 1567310 Part 3: Make all devtools callers of getBoxQuads include option to suppress whitespace frames. r=gl
Differential Revision: https://phabricator.services.mozilla.com/D45120
This commit is contained in:
@@ -338,7 +338,10 @@ AutocompletePopup.prototype = {
|
||||
},
|
||||
|
||||
_scrollElementIntoViewIfNeeded: function(element) {
|
||||
const quads = element.getBoxQuads({ relativeTo: this.tooltip.panel });
|
||||
const quads = element.getBoxQuads({
|
||||
relativeTo: this.tooltip.panel,
|
||||
createFramesForSuppressedWhitespace: false,
|
||||
});
|
||||
if (!quads || !quads[0]) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -974,7 +974,10 @@ AbstractCanvasGraph.prototype = {
|
||||
// not taking the document zoom factor into consideration consistently.
|
||||
if (!this._boundingBox || this._maybeDirtyBoundingBox) {
|
||||
const topDocument = this._topWindow.document;
|
||||
const boxQuad = this._canvas.getBoxQuads({ relativeTo: topDocument })[0];
|
||||
const boxQuad = this._canvas.getBoxQuads({
|
||||
relativeTo: topDocument,
|
||||
createFramesForSuppressedWhitespace: false,
|
||||
})[0];
|
||||
this._boundingBox = boxQuad;
|
||||
this._maybeDirtyBoundingBox = false;
|
||||
}
|
||||
|
||||
@@ -280,7 +280,13 @@ const calculateHorizontalPosition = (
|
||||
const getRelativeRect = function(node, relativeTo) {
|
||||
// getBoxQuads is a non-standard WebAPI which will not work on non-firefox
|
||||
// browser when running launchpad on Chrome.
|
||||
if (!node.getBoxQuads || !node.getBoxQuads({ relativeTo })[0]) {
|
||||
if (
|
||||
!node.getBoxQuads ||
|
||||
!node.getBoxQuads({
|
||||
relativeTo,
|
||||
createFramesForSuppressedWhitespace: false,
|
||||
})[0]
|
||||
) {
|
||||
const { top, left, width, height } = node.getBoundingClientRect();
|
||||
const right = left + width;
|
||||
const bottom = top + height;
|
||||
@@ -290,7 +296,9 @@ const getRelativeRect = function(node, relativeTo) {
|
||||
// Width and Height can be taken from the rect.
|
||||
const { width, height } = node.getBoundingClientRect();
|
||||
|
||||
const quadBounds = node.getBoxQuads({ relativeTo })[0].getBounds();
|
||||
const quadBounds = node
|
||||
.getBoxQuads({ relativeTo, createFramesForSuppressedWhitespace: false })[0]
|
||||
.getBounds();
|
||||
const top = quadBounds.top;
|
||||
const left = quadBounds.left;
|
||||
|
||||
|
||||
@@ -497,7 +497,10 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
||||
const nodeWin = this.currentNode.ownerGlobal;
|
||||
// Get bounding box of iframe document relative to global document.
|
||||
const bounds = nodeWin.document
|
||||
.getBoxQuads({ relativeTo: win.document })[0]
|
||||
.getBoxQuads({
|
||||
relativeTo: win.document,
|
||||
createFramesForSuppressedWhitespace: false,
|
||||
})[0]
|
||||
.getBounds();
|
||||
xOffset = bounds.left - nodeWin.scrollX + win.scrollX;
|
||||
yOffset = bounds.top - nodeWin.scrollY + win.scrollY;
|
||||
|
||||
@@ -222,7 +222,9 @@ function nodeHasSize(node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const quads = node.getBoxQuads();
|
||||
const quads = node.getBoxQuads({
|
||||
createFramesForSuppressedWhitespace: false,
|
||||
});
|
||||
return quads.some(quad => {
|
||||
const bounds = quad.getBounds();
|
||||
return bounds.width && bounds.height;
|
||||
|
||||
@@ -164,6 +164,7 @@ function getAdjustedQuads(boundaryWindow, node, region, { ignoreZoom } = {}) {
|
||||
const quads = node.getBoxQuads({
|
||||
box: region,
|
||||
relativeTo: boundaryWindow.document,
|
||||
createFramesForSuppressedWhitespace: false,
|
||||
});
|
||||
|
||||
if (!quads.length) {
|
||||
|
||||
Reference in New Issue
Block a user