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 Chromium the possible values are {“None”, “Solid”, “Dotted”, “Dashed”, “Squiggle”} and {“None”, “Thin”, “Thick”}, when per https://w3c.github.io/edit-context/#dom-underlinestyle they should be {“none”, “solid”, “dotted”, “dashed”, “wavy”} and {“none”, “thin”, “thick”}. This Intent covers switching TextFormat.underlineStyle and TextFormat.underlineThickness to use the spec values. This change is valuable because it aligns these attributes with existing CSS https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration-style and the https://www.w3.org/TR/design-principles/#casing-rules. Since the purpose of the TextFormat properties is to be used in applying these text styles to text being composed on behalf of an IME, it will be more convenient for developers if the underlineStyle value can be applied directly from the event to CSS without need for a remapping. For both underlineStyle and underlineThickness, matching the platform lower-case convention will reduce the likelihood of developer confusion.
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. Currently, Chrome's implementation of underline style and thickness values in TextFormatUpdateEvent doesn't align with the Edit Context API specification. This misalignment can cause: 1. Inconsistent rendering of underlines across different browsers. 2. Difficulty in implementing cross-platform text editors that need to interpret underline styles. The primary motivation is to enhance cross-browser consistency and provide developers with reliable, predictable formatting behavior that works identically across all compliant browsers.