 Padding above and below the text to draw the caret and selection.
    const CARET_PADDING = 8;

    // Color of the IME composition underline.
    const COMPOSITION_STYLE_COLOR = "red";

    // Font used for rendering the text.
    const VERTICAL_MARGIN = 10;
    const FONT_SIZE = 40;
    const FONT = `${FONT_SIZE}px Arial`;

    // Text start position.
    const TEXT_ANCHOR_X = VERTICAL_MARGIN;
    const TEXT_ANCHOR_Y = FONT_SIZE + VERTICAL_MARGIN;

    let rafID = undefined;

    // Get the canvas elemen