In the following spots a "MouseUp" eventName is being used, which does look inconsistent considering that the "Mouse Down"/"Mouse Enter"/"Mouse Exit" eventNames all have a space in them.
Is this inconsistency actually expected, or is it a simple typo? If the former, then a comment explaining *why* would be appropriate; otherwise we should just fix this :-)

 - https://github.com/mozilla/pdf.js/blob/25b84ce84c95ba06d1ee57e578672048269c39c1/src/display/annotation_layer.js#L806

 - https://github.com/mozilla/pdf.js/blob/25b84ce84c95ba06d1ee57e578672048269c39c1/src/display/annotation_layer.js#L945

 - https://github.com/mozilla/pdf.js/blob/25b84ce84c95ba06d1ee57e578672048269c39c1/src/display/annotation_layer.js#L1034

 - https://github.com/mozilla/pdf.js/blob/25b84ce84c95ba06d1ee57e578672048269c39c1/src/display/annotation_layer.js#L1168

/cc @calixteman 
stringToPDFString,
  unreachable,
  Util,
  warn,
} from "../shared/util.js";
import { AnnotationStorage } from "./annotation_storage.js";
import { ColorConverters } from "../shared/scripting_utils.js";
/**
 * @typedef {Object} AnnotationElementParameters
 * @property {Object} data
 * @property {HTMLDivElement} layer
 * @property {PDFPage} page
 * @property {PageViewport} viewport
 * @property {IPDFLinkService} linkService
 * @property {DownloadManager} downloadManager
 * @property {AnnotationStorage} [annotationStorage]
 * @property {string} [imageResourcesPath] - Path for image resources, mainly
 *   for annotation icons. Include trailing slash.
 * @property {boolean} renderInteractiveForms
 * @property {Object} svgFactory
 * @property {boolean} [enableScripting]
 * @property {boolean} [hasJSActions]
 * @property {Object} [mouseState]
 */
class AnnotationElementFactory {
  /**
   * @param {AnnotationElementParameters} parameters
   * @returns {AnnotationElement}
   */
  static create(parameters) {