const DEFAULT_FONT_SCALE = 1;
// refers to the default font size of a browser window
const DEFAULT_WINDOW_FONT_SIZE = 16;
// to-do: the height of an initial layout is 0. can this be the requested post
// height instead? we have the skinny post DX bundle.
export function buildDimensions(entry, window, element) {
    const { width, height } = entry.contentRect;
    const windowFontSize = window.getComputedStyle(element).fontSize;
    const parsedFontSize = windowFontSize.split('px')[0];
    const fontScale = parsedFontSize
        ? parseFloat(parsedFontSize) / DEFAULT_WINDOW_FONT_SIZE
        : DEFAULT_FONT_SCALE;
    return {
        width: Math.round(width),
        height: Math.round(height),
        scale: window.devicePixelRatio,
        fontScale,
    };
}
//# sourceMappingURL=dimensions.js.map