Intent to Ship: EditContext: TextFormat underlineStyle and underlineThickness

40 views
Skip to first unread message

ASHISH KUMAR

unread,
11:12 AM (10 hours ago) 11:12 AM
to blin...@chromium.org, Daniel Clark, Rakesh Goulikar

Hi blink-dev reviewers,

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

Is this feature fully tested by web-platform-tests?
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
This intent message was generated by Chrome Platform Status.



Thanks,
Ashish

Chris Harrelson

unread,
11:19 AM (10 hours ago) 11:19 AM
to ASHISH KUMAR, blin...@chromium.org, Daniel Clark, Rakesh Goulikar
LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/KUYP153MB1141ABC804E609666E474BE4BAE8A%40KUYP153MB1141.APCP153.PROD.OUTLOOK.COM.

Vladimir Levin

unread,
11:25 AM (10 hours ago) 11:25 AM
to blink-dev, Chris Harrelson, blin...@chromium.org, dan...@microsoft.com, Rakesh Goulikar, ASHISH KUMAR
LGTM2

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Rick Byers

unread,
11:33 AM (10 hours ago) 11:33 AM
to Vladimir Levin, blink-dev, Chris Harrelson, dan...@microsoft.com, Rakesh Goulikar, ASHISH KUMAR
In general this seems good, I just want to make sure we've done our due diligence on compat risk (below).

This looks small but non-trivial. Are these values from Edge telemetry? Would it help to have someone also check the Chrome telemetry just to double check they're consistent? Are they landed in the code as UKM-enabled UseCounters?

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/558f4f81-1be2-4522-91b8-bcef9e787f07n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages