Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2023-05-15 09:19:37 +08:00
commit a7a525c65e
49 changed files with 1519 additions and 539 deletions

View file

@ -283,7 +283,7 @@ AutocompletePopup.prototype = {
return;
}
let {top, height} = quads[0].bounds;
let {top, height} = quads[0].getBounds();
let containerHeight = this._tooltip.panel.getBoundingClientRect().height;
if (top < 0) {
// Element is above container.

View file

@ -85,9 +85,9 @@ function* runTests(doc) {
ok(arrow, "Tooltip has an arrow");
// Get the geometry of the anchor, the tooltip panel & arrow.
let arrowBounds = arrow.getBoxQuads({relativeTo: doc})[0].bounds;
let panelBounds = tooltip.panel.getBoxQuads({relativeTo: doc})[0].bounds;
let anchorBounds = el.getBoxQuads({relativeTo: doc})[0].bounds;
let arrowBounds = arrow.getBoxQuads({relativeTo: doc})[0].getBounds();
let panelBounds = tooltip.panel.getBoxQuads({relativeTo: doc})[0].getBounds();
let anchorBounds = el.getBoxQuads({relativeTo: doc})[0].getBounds();
let intersects = arrowBounds.left <= anchorBounds.right &&
arrowBounds.right >= anchorBounds.left;

View file

@ -78,9 +78,9 @@ function* runTests(doc) {
ok(arrow, "Tooltip has an arrow");
// Get the geometry of the anchor, the tooltip panel & arrow.
let arrowBounds = arrow.getBoxQuads({relativeTo: doc})[0].bounds;
let panelBounds = tooltip.panel.getBoxQuads({relativeTo: doc})[0].bounds;
let anchorBounds = el.getBoxQuads({relativeTo: doc})[0].bounds;
let arrowBounds = arrow.getBoxQuads({relativeTo: doc})[0].getBounds();
let panelBounds = tooltip.panel.getBoxQuads({relativeTo: doc})[0].getBounds();
let anchorBounds = el.getBoxQuads({relativeTo: doc})[0].getBounds();
let intersects = arrowBounds.left <= anchorBounds.right &&
arrowBounds.right >= anchorBounds.left;

View file

@ -114,5 +114,5 @@ let runAutocompletionTest = Task.async(function* (editor) {
*/
function getPopupOffset({popup, input}) {
let popupQuads = popup._panel.getBoxQuads({relativeTo: input});
return popupQuads[0].bounds.left;
return popupQuads[0].getBounds().left;
}

View file

@ -176,9 +176,9 @@ const getRelativeRect = function (node, relativeTo) {
// Width and Height can be taken from the rect.
let {width, height} = node.getBoundingClientRect();
let quads = node.getBoxQuads({relativeTo});
let top = quads[0].bounds.top;
let left = quads[0].bounds.left;
let quadBounds = node.getBoxQuads({relativeTo})[0].getBounds();
let top = quadBounds.top;
let left = quadBounds.left;
// Compute right and bottom coordinates using the rest of the data.
let right = left + width;