FF151 CanvasRenderingContext2D.lang - minor tidy#44071
Merged
chrisdavidmills merged 1 commit intoMay 11, 2026
Merged
Conversation
Contributor
|
Preview URLs (1 page) (comment last updated: 2026-05-11 08:04:27) |
hamishwillee
commented
May 11, 2026
Comment on lines
+39
to
+40
| - For off-screen canvases, the `lang` value is inherited when the associated `OffscreenCanvasRenderingContext2D` object is first created "as a snapshot"; subsequent updates to the `lang` attribute from which the offscreen context inherited its value do not change its `lang` attribute. | ||
| For this reason, the language of an off-screen canvas can only be changed by setting its `lang` value explicitly. |
Collaborator
Author
There was a problem hiding this comment.
FYI I found the previous text confusing as it sounded like "you can't change the lang attribute at all, but you can change the attribute using the lang value. This makes it clear that the inheritence is a snapshot, but you can still set the lang attribute on the context itself.
2670f96 to
395f5b9
Compare
8 tasks
chrisdavidmills
approved these changes
May 11, 2026
Contributor
chrisdavidmills
left a comment
There was a problem hiding this comment.
@hamishwillee yeah, that reads well. Bit of a tricky one, this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FF151 adds support for
CanvasRenderingContext2D.lang.This allows the rendering language of an offscreen canvas to be changed after the context is created.
Without this the
langis inherited as a snapshot, and can't be changed. Further, since an offscreen canvas might be created without an element in the DOM the value that is inherited is likely thelangof the document itself, which might well not be what you want. NOte for an onscreen canvas this is not a problem since the value can be inherited from the canvas element itself.This adds a minor update - see #44071 (comment)
Related docs work can be tracked in #43865