I am working to update the
underlineStyle
and underlineThickness
attributes of
TextFormat object
in EditContext as per the
spec. Sharing the I2S, please let me know if there are any concerns.
Contact emails
Specification
Summary
Chromium shipped
EditContext with a bug where the
TextFormat object supplied by the
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
spec: EditContext API 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
text-decoration-style and the
platform convention that enumeration values are lower-cased. 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.
Blink component
Web Feature ID
Search tags
TAG review
None – this change fixes a bug where Chromium is out of alignment with the EditContext spec, for which the TAG is
already
reviewed.
TAG review status
Not applicable
Risks
Interoperability and Compatibility
This change presents compatibility risk for web applications that currently rely on Chrome's non-standardized implementation of underlineStyle and underlineThickness values in TextFormatUpdateEvent.
TextFormatUpdateEvent usage telemetry data from May 2025 onward are:
1. 0.0171% of page loads register a TextFormatUpdateEvent listener.
2. 0.0002% of page loads fire the event for registered listeners.
3. 0.0002% of page loads include underlineStyle or underlineThickness values other than "None" in the fired events.
Some sites using EditContext such as Google Docs do not use these properties, instead electing to apply a consistent underline style to the entire active composition. These sites will not be affected.
EditContext sites that do use these properties (reflected in the above use counters) will need to migrate to the new values, feature-detecting the change. Sites using the old non-standard values will experience broken underlineStyle
or underlineThickness in composition until they update to the spec-compliant values. We will reach out to known affected customers prior to shipping this change to provide migration guidance.
Gecko: Positive with concerns for EditContext overall. (https://github.com/mozilla/standards-positions/issues/199)
WebKit: Neutral for EditContext overall. (https://github.com/WebKit/standards-positions/issues/243)
Web developers: No signals
Other signals:
WebView application risks
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
WebView-based applications are expected to have consistent behavior with standard web applications. Therefore, the risks for WebView applications are similar to web applications.
Debuggability
DevTools already supports TextFormats, so no additional debugging support is required for this feature.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?
Yes
Flag name on about://flags
None
Finch feature name
UseSpecValuesInTextFormatUpdateEventStyles
Rollout plan
Will ship enabled for all users
Requires code in //chrome?
False
Tracking bug
Estimated milestones
Shipping on desktop
|
143
|
Shipping on Android
|
143
|
Shipping on WebView
|
143
|
Shipping on iOS
|
143
|
Anticipated spec changes
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g.,
changing to naming or structure of the API in a non-backward-compatible way).
None
Link to entry on the Chrome Platform Status
Thanks,
Ashish