    line.style.borderBottomWidth = makeEm(line.height);
    line.maxFontSize = 1.0;
    return line;
};

/**
 * Makes an anchor with the given href, list of classes, list of children,
 * and options.
 */
export const makeAnchor = function(
    href: string,
    classes: string[],
    children: HtmlDomNode[],
    options: Options,
): Anchor {
    const anchor = new Anchor(href, classes, children, options);

    sizeElementFromChildren(anchor);

    return anchor;
};

/**
 * Makes a document fragment with the given list of children.
 */
export const makeFragment = function(
    children: HtmlDomNode[],
): HtmlDocumentFragment {
    const fragment = new DocumentFragment(children);

    sizeElementFromChildren(fragment);

    return fragment;
};

/**
 * Wraps group in a span if it's a document fragment, allowing to apply classes
 * and styles
 */
export const wrapFragment = function(
    group: HtmlDomNode,
    options: Options,
): HtmlDomNode {
    if (group instanceof DocumentFragment) {
        return makeSpan([], [group], options);
    }
    return group;
};

export type VListElem = {
    type: "elem";
    elem: HtmlDomNode;
    marginLeft?: string | null | undefined;
    marginRight?: string;
    wrapperClasses?: string[];
    wrapperStyle?: CssStyle;
};
type VListElemAndShift = {
    type: "elem";
    elem: HtmlDomNode;
    shift: number;
    marginLeft?: string | null | undefined;
    marginRight?: string;
    wrapperClasses?: string[];
    wrapperStyle?: CssStyle;
};
type VListKern = {
    type: "kern";
    size: number;
};

// A list of child or kern nodes to be stacked on top of each other (i.e. the
// first element will be at the bottom, and the last at the top).
type VListChild = VListElem | VListKern;
type VListParam = {
    // Each child contains how much it should be shifted downward.
    positionType: "individualShift";
    children: VListElemAndShift[];
} | {
    // "top": The positionData specifies the topmost point of the vlist (note this
    //        is expected to be a height, so positive values move up).
    // "bottom": The positionData specifies the bottommost point of the vlist (note
    //           this is expected to be a depth, so positive values move down).
    // "shift": The vlist will be positioned such that its baseline is positionData
    //          away from the baseline of the first child which MUST be an
    //          "elem". Positive values move downwards.
    positionType: "top" | "bottom" | "shift";
    positionData: number;
    children: VListChild[];
} | {
    // The vlist is positioned so that its baseline is aligned with the baseline
    // of the first child which MUST be an "elem". This is equivalent to "shift"
    // with positionData=0.
    positionType: "firstBaseline";
    children: VListChild[];
};

// Computes the updated `children` list and the overall depth.
//
