src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts/Widget/_layoutBoxInPage
class Widget:	private _layoutBoxInPage(topLeft: Coordinate, bottomLeft: Coordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult | null {
		const aboveTop = topLeft.top - height;
		const belowTop = bottomLeft.top + this._lineHeight;

		const domNodePosition = dom.getDomNodePagePosition(this._viewDomNode.domNode);
		const absoluteAboveTop = domNodePosition.top + aboveTop - dom.StandardWindow.scrollY;
		const absoluteBelowTop = domNodePosition.top + belowTop - dom.StandardWindow.scrollY;

		const windowSize = dom.getClientArea(document.body);
		const [aboveLeft, absoluteAboveLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, topLeft.left - ctx.scrollLeft + this._contentLeft, width);
		const [belowLeft, absoluteBelowLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, bottomLeft.left - ctx.scrollLeft + this._contentLeft, width);

		// Leave some clearance to the top/bottom
		const TOP_PADDING = 22;
		const BOTTOM_PADDING = 22;

		const fitsAbove = (absoluteAboveTop >= TOP_PADDING);
		const fitsBelow = (absoluteBelowTop + height <= windowSize.height - BOTTOM_PADDING);

		if (this._fixedOverflowWidgets) {
			return {
				fitsAbove,
				aboveTop: Math.max(absoluteAboveTop, TOP_PADDING),
				aboveLeft: absoluteAboveLeft,
				fitsBelow,
				belowTop: absoluteBelowTop,
				belowLeft: absoluteBelowLeft
			};
		}

		return {
			fitsAbove,
			aboveTop: aboveTop,
			aboveLeft,
			fitsBelow,
			belowTop,
			belowLeft
		};
	}