The <canvas> DOM element, like all DOM elements, accepts a `lang` attribute that is used to define language specific treatment for font selection (when fonts have locale specific glyphs). Browsers respect this attribute. However, when an OffscreenCanvas is created there is no way to set locale information, possibly resulting in a state where an offscreen canvas produces rendered results that differ from the canvas in which it's output is used. This feature adds a `lang` IDL attribute to CanvasTextDrawingStyles to give developers direct control over the language for the text drawing and metrics.
None
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
Pure addition of functionality.
None
Feature is useful on all platforms and important for localization.
https://wpt.fyi/results/html/canvas/element/manual/text?label=master&label=experimental canvas.2d.lang.dynamic.html canvas.2d.lang.empty.canvas.html canvas.2d.lang.inherit.canvas.html canvas.2d.lang.inherit.disconnected.canvas.html canvas.2d.lang.inherit.document.disconnected.canvas.html canvas.2d.lang.inherit.document.html canvas.2d.lang.html https://wpt.fyi/results/html/canvas/offscreen/manual/text?label=master&label=experimental canvas.2d.offscreen.lang.inherit.html canvas.2d.offscreen.lang.html canvas.2d.offscreen.transferred.lang.inherit.document.html canvas.2d.offscreen.transferred.lang.inherit.html canvas.2d.offscreen.transferred.lang.html canvas.2d.offscreen.worker.lang.inherit.html canvas.2d.offscreen.worker.lang.html https://wpt.fyi/results/html/canvas/element/text?label=master&label=experimental 2d.text.lang.default.html 2d.text.lang.valid.html https://wpt.fyi/results/html/canvas/offscreen/text?label=master&label=experimental 2d.text.lang.default.html 2d.text.lang.valid.html
This is a feature addition with very very little expected impact on performance or changes in existing website functionality.
Does the feature depend on any code or APIs outside the Chromium open source repository and its open-source dependencies to function?
None.Shipping on desktop | 136 |
DevTrial on desktop | 135 |
Shipping on Android | 136 |
DevTrial on Android | 135 |
Shipping on WebView | 136 |
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.Contact emails sche...@chromium.org
Explainer https://github.com/whatwg/html/pull/10873
Specification https://github.com/whatwg/html/pull/10873
SummaryThe <canvas> DOM element, like all DOM elements, accepts a `lang` attribute that is used to define language specific treatment for font selection (when fonts have locale specific glyphs). Browsers respect this attribute. However, when an OffscreenCanvas is created there is no way to set locale information, possibly resulting in a state where an offscreen canvas produces rendered results that differ from the canvas in which it's output is used. This feature adds a `lang` IDL attribute to CanvasTextDrawingStyles to give developers direct control over the language for the text drawing and metrics.
Blink component Blink>Canvas
TAG review None
TAG review status Not applicable
Risks
Interoperability and CompatibilityNone
Gecko: No signal (https://github.com/mozilla/standards-positions/issues/1150) Non official support in WHATWG meetings.
WebKit: Support (https://github.com/WebKit/standards-positions/issues/439)
Web developers: No signals
Other signals:
WebView application risksDoes this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
Pure addition of functionality.
DebuggabilityNone
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)? YesFeature is useful on all platforms and important for localization.
Is this feature fully tested by web-platform-tests? Yeshttps://wpt.fyi/results/html/canvas/element/manual/text?label=master&label=experimental canvas.2d.lang.dynamic.html canvas.2d.lang.empty.canvas.html canvas.2d.lang.inherit.canvas.html canvas.2d.lang.inherit.disconnected.canvas.html canvas.2d.lang.inherit.document.disconnected.canvas.html canvas.2d.lang.inherit.document.html canvas.2d.lang.html https://wpt.fyi/results/html/canvas/offscreen/manual/text?label=master&label=experimental canvas.2d.offscreen.lang.inherit.html canvas.2d.offscreen.lang.html canvas.2d.offscreen.transferred.lang.inherit.document.html canvas.2d.offscreen.transferred.lang.inherit.html canvas.2d.offscreen.transferred.lang.html canvas.2d.offscreen.worker.lang.inherit.html canvas.2d.offscreen.worker.lang.html https://wpt.fyi/results/html/canvas/element/text?label=master&label=experimental 2d.text.lang.default.html 2d.text.lang.valid.html https://wpt.fyi/results/html/canvas/offscreen/text?label=master&label=experimental 2d.text.lang.default.html 2d.text.lang.valid.html
Flag name on about://flags Experimental Web Platform Features
Finch feature name CanvasTextLang
Non-finch justificationThis is a feature addition with very very little expected impact on performance or changes in existing website functionality.
Requires code in //chrome? False
Tracking bug https://issues.chromium.org/issues/385006131
Availability expectation WebKit implementation is moving forward. There is agreement that the feature is needed and implementation is not complex. I would anticipate all browsers have implemented within 2 years.
Adoption expectation I would expect that the feature is adopted by default, in that the default value for the new attribute is likely to be by far the most common. So sites will immediately "adopt" the feature and get the benefits without taking any action.
On Tuesday, March 4, 2025 at 11:17:42 AM UTC-5 Chromestatus wrote:Contact emails sche...@chromium.org
Explainer https://github.com/whatwg/html/pull/10873
Specification https://github.com/whatwg/html/pull/10873
SummaryThe <canvas> DOM element, like all DOM elements, accepts a `lang` attribute that is used to define language specific treatment for font selection (when fonts have locale specific glyphs). Browsers respect this attribute. However, when an OffscreenCanvas is created there is no way to set locale information, possibly resulting in a state where an offscreen canvas produces rendered results that differ from the canvas in which it's output is used. This feature adds a `lang` IDL attribute to CanvasTextDrawingStyles to give developers direct control over the language for the text drawing and metrics.
Blink component Blink>Canvas
TAG review None
TAG review status Not applicableIs there a reason for no TAG review? I'm not sure if there's an exception that applies here.
Risks
Interoperability and CompatibilityNone
Gecko: No signal (https://github.com/mozilla/standards-positions/issues/1150) Non official support in WHATWG meetings.
WebKit: Support (https://github.com/WebKit/standards-positions/issues/439)
Web developers: No signalsAlthough this seems like a small feature, having no web developer signals is a bit unfortunate. Do you know of any cases where this behavior is currently broken and would be fixed by the change?
Other signals:
WebView application risksDoes this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
Pure addition of functionality.
DebuggabilityNone
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)? YesFeature is useful on all platforms and important for localization.
Is this feature fully tested by web-platform-tests? Yeshttps://wpt.fyi/results/html/canvas/element/manual/text?label=master&label=experimental canvas.2d.lang.dynamic.html canvas.2d.lang.empty.canvas.html canvas.2d.lang.inherit.canvas.html canvas.2d.lang.inherit.disconnected.canvas.html canvas.2d.lang.inherit.document.disconnected.canvas.html canvas.2d.lang.inherit.document.html canvas.2d.lang.html https://wpt.fyi/results/html/canvas/offscreen/manual/text?label=master&label=experimental canvas.2d.offscreen.lang.inherit.html canvas.2d.offscreen.lang.html canvas.2d.offscreen.transferred.lang.inherit.document.html canvas.2d.offscreen.transferred.lang.inherit.html canvas.2d.offscreen.transferred.lang.html canvas.2d.offscreen.worker.lang.inherit.html canvas.2d.offscreen.worker.lang.html https://wpt.fyi/results/html/canvas/element/text?label=master&label=experimental 2d.text.lang.default.html 2d.text.lang.valid.html https://wpt.fyi/results/html/canvas/offscreen/text?label=master&label=experimental 2d.text.lang.default.html 2d.text.lang.valid.html
Flag name on about://flags Experimental Web Platform Features
Finch feature name CanvasTextLang
Non-finch justificationThis is a feature addition with very very little expected impact on performance or changes in existing website functionality.
Requires code in //chrome? False
Tracking bug https://issues.chromium.org/issues/385006131
Availability expectation WebKit implementation is moving forward. There is agreement that the feature is needed and implementation is not complex. I would anticipate all browsers have implemented within 2 years.
Adoption expectation I would expect that the feature is adopted by default, in that the default value for the new attribute is likely to be by far the most common. So sites will immediately "adopt" the feature and get the benefits without taking any action.It wasn't immediately clear: what's the default value that would be used?
--
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/CAGsbWzSYuQJfmu_MWGOCOOWufKqk6zH1miOqJ_B6E%3DOx9-2RnA%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
LGTM3
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/a1d57bf1-0761-4128-95be-acc43c30c612n%40chromium.org.