LGTM3
On 3/12/25 12:47 PM, Alex Russell wrote:
LGTM2
On Wednesday, March 12, 2025 at 12:02:05 PM UTC-4 Chris Harrelson wrote:
LGTM1
On Wed, Mar 5, 2025 at 6:38 AM Stephen Chenney
<schen...@chromium.org> wrote:
Thanks Vlad. Answers inline.
On Tue, Mar 4, 2025 at 10:34 PM Vladimir Levin
<vmp...@chromium.org> wrote:
On Tuesday, March 4, 2025 at 11:17:42 AM UTC-5
Chromestatus wrote:
Contact emails schen...@chromium.org
Explainer https://github.com/whatwg/html/pull/10873
<https://github.com/whatwg/html/pull/10873>
Specification
https://github.com/whatwg/html/pull/10873
<https://github.com/whatwg/html/pull/10873>
Summary
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.
Blink component Blink>Canvas
<https://issues.chromium.org/issues?q=customfield1222907:%22Blink%3ECanvas%22>
TAG review None
TAG review status Not applicable
Is there a reason for no TAG review? I'm not sure if
there's an exception that applies here.
I didn't consider TAG review because the discussion in WHATWG
viewed this as fixing an oversite in the canvas spec, and from
a technical/ergonomics perspective it seems pretty straight
forward. Happy to see if the TAG have any opinions though so
I'll file an issue.
Risks
Interoperability and Compatibility
None
/Gecko/: No signal
(https://github.com/mozilla/standards-positions/issues/1150
<https://github.com/mozilla/standards-positions/issues/1150>)
Non official support in WHATWG meetings.
/WebKit/: Support
(https://github.com/WebKit/standards-positions/issues/439
<https://github.com/WebKit/standards-positions/issues/439>)
/Web developers/: No signals
Although 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?
Finding reports of developers having problems is a bit tricky,
in part because "canvas" is also a very widely used online
learning framework with lots of people who care about
language. Anyways, this is one report of offscreen canvas
giving the wrong metrics
<https://forum.nwoods.com/t/html-lang-set-to-ja-or-zh-the-text-will-exceed-the-frame/16450>
for text due to the lack of offscreen language support
(exactly what this intent is expected to fix). Hitting the
problem of offscreen/DOM inconsistency that we are trying to
fix here would require a localized application using a common
font for multiple locales with developers/users attentive
enough to notice problems and report them.
Another way of looking at Web Developer signals is that this
is a prerequisite spec addition for the highly demanded
Extended Text Metrics feature set. Without this we don't get
better canvas text in general.
/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?
Pure addition of functionality.
Debuggability
None
Will this feature be supported on all six Blink
platforms (Windows, Mac, Linux, ChromeOS, Android, and
Android WebView)? Yes
Feature is useful on all platforms and important for
localization.
Is this feature fully tested by web-platform-tests
<https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md>?
Yes
https://wpt.fyi/results/html/canvas/element/manual/text?label=master&label=experimental
<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
<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
<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
<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 justification
This 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
<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?
Default is "inherit", the behavior of which matches DOM canvas
right now, and would make offscreen canvas match DOM canvas.
Adoption plan The feature is publicized at
https://blogs.igalia.com/schenney/canvas-localization-support/
<https://blogs.igalia.com/schenney/canvas-localization-support/>
and will have an MDN page.
Non-OSS dependencies
Does the feature depend on any code or APIs outside
the Chromium open source repository and its
open-source dependencies to function?
None.
Sample links
https://blogs.igalia.com/schenney/canvas-localization-support
<https://blogs.igalia.com/schenney/canvas-localization-support>
Estimated milestones Shipping on desktop 136 DevTrial
on desktop 135 Shipping on Android 136 DevTrial on
Android 135 Shipping on WebView 136
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
https://chromestatus.com/feature/5066778773028864?gate=5145440662847488
<https://chromestatus.com/feature/5066778773028864?gate=5145440662847488>
Links to previous Intent discussions Intent to
Prototype:
https://groups.google.com/a/chromium.org/g/blink-dev/c/WEjhPwI6lLc
<https://groups.google.com/a/chromium.org/g/blink-dev/c/WEjhPwI6lLc>
This intent message was generated by Chrome Platform
Status <https://chromestatus.com>.
--
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+unsubscr...@chromium.org
<mailto:blink-dev+unsubscr...@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
<https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGsbWzSYuQJfmu_MWGOCOOWufKqk6zH1miOqJ_B6E%3DOx9-2RnA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
--
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+unsubscr...@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
<https://groups.google.com/a/chromium.org/d/msgid/blink-dev/a1d57bf1-0761-4128-95be-acc43c30c612n%40chromium.org?utm_medium=email&utm_source=footer>.
--
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+unsubscr...@chromium.org.
To view this discussion visit
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/b8a2a819-5118-4ea8-a840-e79f7d911024%40chromium.org.