sCtx.strokeStyle = COMPOSITION_STYLE_COLOR;

      // Japanese IME returns 'Squiggle' while Chinese returns 'Dotted' for active composition.
      // For simplicity we draw dotted line for both.
      if (underlineStyle == 'Squiggle' || underlineStyle == 'Dotted') {
        canvasCtx.setLineDash([1, 1]); // dotted line pattern
        canvasCtx.beginPath();
        canvasCtx.moveTo(lineStartX, lineY);
        canvasCtx.lineTo(lineEndX, lineY);
        canvasCtx.stroke();
      } else if (underlineStyle == '