-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an optional lang argument to OffscreenCanvas constructor #10862
Comments
Why not follow the same setup as for direction here? Would other context types also need this? Also it'd probably be great if all such inherited properties could be specced clearly. |
Are you saying that instead of using an HTML attribute on the element, use an IDL attribute on CanvasTextDrawingStyles? I'd be fine with that but it would need some statement of how the "lang" attribute on The spec text you linked to also seems to imply that the workers |
I suspect we want a nullable string attribute. When it's null it defers to the language of the canvas element. Otherwise it's the given value. And if there is no canvas element it acts as if it's the unknown language. We should probably also tidy up the language for |
Shall I take a stab at my first significant PR and plan to discuss at this week's WHATNOT meeting? |
Sounds good to me! |
cc @whatwg/canvas |
I'm saying that if it only concerns the 2d context it shouldn't be an option on the OffscreenCanvas constructor but a 2d context attribute instead.
I don't see no mention of the lang attribute in the current texts. But note that the direction is actually computed in the text preparation steps, you'd probably want to take inspiration from that. |
What is the issue with the HTML Standard?
The
<canvas>
DOM element, like all DOM elements, accepts alang
attribute that is used to define location specific treatment for font selection (when fonts have locale specific glyphs). Browsers respect this attribute. However, when an OffscreenCanvas is created in JS, 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.I propose adding an
optional string lang
parameter to the OffscreenCanvas constructor, and spec text indicating how offscreen canvases created from canvas elements should inherit the lang.Both Chrome and Firefox on linux always use the system language settings for offscreen canvas, even when transferred from a canvas element, as far as I can tell.
The text was updated successfully, but these errors were encountered: