Skip to content

FF151 CanvasRenderingContext2D.lang - minor tidy#44071

Merged
chrisdavidmills merged 1 commit into
mdn:mainfrom
hamishwillee:ff151relnote_offscreen_lang
May 11, 2026
Merged

FF151 CanvasRenderingContext2D.lang - minor tidy#44071
chrisdavidmills merged 1 commit into
mdn:mainfrom
hamishwillee:ff151relnote_offscreen_lang

Conversation

@hamishwillee
Copy link
Copy Markdown
Collaborator

@hamishwillee hamishwillee commented May 11, 2026

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 lang is 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 the lang of 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

@hamishwillee hamishwillee requested review from a team as code owners May 11, 2026 07:56
@hamishwillee hamishwillee requested review from chrisdavidmills and dipikabh and removed request for a team May 11, 2026 07:56
@github-actions github-actions Bot added Content:WebAPI Web API docs Content:Firefox Content in the Mozilla/Firefox subtree size/s [PR only] 6-50 LoC changed labels May 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

Preview URLs (1 page)

(comment last updated: 2026-05-11 08:04:27)

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.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@hamishwillee hamishwillee marked this pull request as draft May 11, 2026 07:59
@hamishwillee hamishwillee force-pushed the ff151relnote_offscreen_lang branch from 2670f96 to 395f5b9 Compare May 11, 2026 08:00
@github-actions github-actions Bot removed the Content:Firefox Content in the Mozilla/Firefox subtree label May 11, 2026
@hamishwillee hamishwillee changed the title FF151 Relnote: CanvasRenderingContext2D.lang FF151 CanvasRenderingContext2D.lang - minor tidy May 11, 2026
@hamishwillee hamishwillee marked this pull request as ready for review May 11, 2026 08:01
Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hamishwillee yeah, that reads well. Bit of a tricky one, this.

@chrisdavidmills chrisdavidmills merged commit f993d9f into mdn:main May 11, 2026
9 checks passed
@hamishwillee hamishwillee deleted the ff151relnote_offscreen_lang branch May 11, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants