getRect(element, size) {
    const box = element.getBoundingClientRect();
    const offsetX = box.left + window.pageXOffset;
    const offsetY = box.top + window.pageYOffset;
    return [offsetX, offsetY, offsetX + size[0], offsetY + size[1]];
  }
Get the extent of an element relative to the document
@param {HTMLElement} element The element.
@param {import("./size.js").Size} size The size of the element.
@return {import("./extent.js").Extent} The extent.
@protected