v143 · javascript
EditContext: TextFormat underlineStyle and underlineThickness
Chromium shipped https://developer.mozilla.org/en-US/docs/Web/API/EditContext with a bug where the https://developer.mozilla.org/en-US/docs/Web/API/TextFormat object supplied by the https://developer.mozilla.org/en-US/docs/Web/API/EditContext/textformatupdate_event provides incorrect values for the underlineStyle and underlineThickness properties. In Chromiu
concepts
-
EditContext Underline
Live editor attached to an EditContext. Compose text (or click Simulate) and watch the
textformatupdateevent report the correctedunderlineStyleandunderlineThickness. -
IME style painter
What the corrected values are actually for: IME composition presets (Japanese / Chinese / Korean / grammar / spell-check) rendered with the appropriate underline style and thickness.
-
Underline gallery
The full 6×3 matrix of
underlineStyle×underlineThicknessvalues from the spec, rendered side by side with a picker for live comparison and a notes panel mapping each pair to its conventional editor use. -
Custom Input Method
An
EditContext-wired editable div with a simulated IME panel: type to compose, choose from five preset suggestions, and commit. Underlines are rendered via inline CSS matchingTextFormatAPI values. A style picker lets you chooseunderlineStyleandunderlineThicknesswith live preview, and a format log timestamps every format event with range and style values.
why it shipped
The TextFormatUpdateEvent is fired when the formatting attributes of text content change within an EditContext. It provides a structured interface to access formatting information such as underline style, underline thickness, and other visual characteristics through the getTextFormats() method.