From eba506c96f8fe9abe96db35818c60fe8b66ef547 Mon Sep 17 00:00:00 2001
From: Stephen Chenney Returns the current language setting. Can be set, to change the language used when resolving fonts. The syntax and valid values
+ are the same as those for the lang element attribute. Values
+ that are not valid are ignored. The default is the lang of the shadowOffsetY
, shadowBlur
, lang
, font
, textAlign
, textBaseline
,
Notice that the font is only loaded inside the worker, and not in the document context.Text styles
+
context.lang [ = value ]
styles.lang [ = value ]
canvas
element
+ or the unknown language when there is no canvas
element.context.font [ = value ]
styles.font [ = value ]
The choice of fonts and glyphs within a font may vary according to the lang
+ IDL attribute. On setting, lang
must be
+ a valid BCP 47 language tag or the string "inherit".
+ To determine the used value
+ for lang
, use the following steps:
If object's lang
value is
+ "inherit", then
If object's font style source object is a canvas
+ element, then return the element's lang atribute
+ value.
Otherwise, object's font style source object is an
+ OffscreenCanvas
object:
Let global be object's relevant global + object.
If global is a Window
object, then return the
+ lang attribute from global's
+ associated Document
.
Otherwise, return a user-agent-defined default lang.
Otherwise, the used value is the lang
+ value.
The lang
IDL attribute, on getting, must return
+ the current value.
The font
IDL attribute, on setting, must be parsed as a CSS <'font'> value (but
without supporting property-independent style sheet syntax like 'inherit'), and the resulting font
- must be assigned to the context, with the 'line-height' component forced to 'normal',
- with the 'font-size' component converted to CSS pixels,
- and with system fonts being computed to explicit values. If the new value is syntactically
- incorrect (including using property-independent style sheet syntax like 'inherit' or 'initial'),
- then it must be ignored, without assigning a new font value. CSS
lang
, with the 'line-height'
+ component forced to 'normal', with the 'font-size' component converted to CSS pixels, and with system fonts being computed to explicit values. If the
+ new value is syntactically incorrect (including using property-independent style sheet syntax
+ like 'inherit' or 'initial'), then it must be ignored, without assigning a new font value.
+ CSS
Font family names must be interpreted in the context of the font style source
object when the font is to be used; any fonts embedded using Default to the directionality of the Use the following process to determine which direction to treat input to the text preparation algorithm If object's font style source object is a If dir attribute of the element is
+ Otherwise, use the value of the dir attribute of the element
+ as the direction. Otherwise, object's font style source object is an
+ Let global be object's relevant global
+ object. If global is a Let Document be the global's
+ associated If the value of the dir attribute from
+ Document is Otherwise, use the value of the dir attribute from
+ Document as the direction. Otherwise, treat input to the text preparation algorithm as left-to-right text. The Returns the current language setting. Can be set, to change the language used when resolving fonts. The syntax and valid values
- are the same as those for the lang element attribute. Values
- that are not valid are ignored. The default is the lang of the The default is "inherit", which uses the lang of the
+ Can be set, to change the language used when resolving fonts. The syntax and valid values
are the same as those for the lang element attribute, or the
- value "inherit".
inherit
- canvas
element or Document
- as appropriate.
+
+ canvas
+ element:
+
+
+ auto
then use the element's computed value of
+ 'direction' as the direction.OffscreenCanvas
object:
+
+ Window
object:
+
+ Document
.auto
then use the
+ Document's computed value of 'direction'
+ as the direction.fontKerning
attribute's allowed keywords
@@ -146511,6 +146608,7 @@ INSERT INTERFACES HERE
Ştefan Vargyas,
Stefan Weiss,
Steffen Meschkat,
+ Stephen Chenney,
Stephen Ma,
Stephen Stewart,
Stephen White,
From 488b95b63d487a309a726ff6f55c40efa296a4bf Mon Sep 17 00:00:00 2001
From: Stephen Chenney canvas
element
- or the unknown language when there is no canvas
element.canvas
element, or the Document associated with a Worker when there is no
+ canvas
element, or a user-agent default language when neither source exists.context.font [ = value ]
inherit
" which is described
+ below.
The default is "inherit", which uses the lang of the
- canvas
element, or the Document associated with a Worker when there is no
- canvas
element, or a user-agent default language when neither source exists.
The default is "inherit
".
context.font [ = value ]
Returns the current font settings.
Can be set, to change the font. The syntax is the same as for the CSS 'font' - property; values that cannot be parsed as CSS font values are ignored.
+ property; values that cannot be parsed as CSS font values are ignored. The default is "10px sans-serif".Relative keywords and lengths are computed relative to the font of the canvas
element.
lang
IDL attribute. On setting, lang
must be
a valid BCP 47 language tag or the string "inherit".
- To determine the used value
- for lang
, use the following steps:
+ To determine the language for the font from
+ the lang
IDL attribute, use the following steps:
If object's lang
value is
"inherit", then
If object's font style source object is a canvas
- element, then return the element's lang atribute
- value.
lang
attribute is
+ set to "inherit" (not on all changes to the element's language).Otherwise, if object's font style source object is an
+ OffscreenCanvas
object created via transferControlToOffscreen,
+ then set the language for the font to
+ the source canvas element's language. The source
+ canvas's language should be snapshot at the time of transfer and the value used
+ whenever the lang
value is "inherit".
Otherwise, object's font style source object is an
OffscreenCanvas
object:
Let global be object's relevant global object.
If global is a Window
object, then return the
- lang attribute from global's
- associated Document
.
Otherwise, return a user-agent-defined default lang.
If global is a Window
object, then set the language for the font to the
+ language from global's
+ associated Document
.
+ The associated Document
's
+ language should be snapshot when the OffscreenCanvas
is
+ created and the value used whenever the lang
+ value is "inherit".
Otherwise, the language for the + font is explicitly unknown.
Otherwise, the used value is the lang
- value.
Otherwise, the language for the font is the lang
value.
The lang
IDL attribute, on getting, must return
@@ -66752,9 +66768,8 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
data-x="dom-context-2d-font">font IDL attribute, on setting, must be parsed as a CSS <'font'> value (but
without supporting property-independent style sheet syntax like 'inherit'), and the resulting font
- must be assigned to the context, with the primary language set to the used-value for lang
, with the 'line-height'
+ must be assigned to the context, with the language
+ for the font as determined above, with the 'line-height'
component forced to 'normal', with the 'font-size' component converted to CSS pixels, and with system fonts being computed to explicit values. If the
new value is syntactically incorrect (including using property-independent style sheet syntax
@@ -66957,53 +66972,50 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
Treat input to the text preparation algorithm as right-to-left text.
inherit
- Use the following process to determine which direction to treat input to the text preparation algorithm
+Use the following process to determine the value for the
+ inherited direction
referred to in the text preparation algorithm
If object's font style source object is a canvas
element:
If dir attribute of the element is
- auto
then use the element's computed value of
- 'direction' as the direction.
If the element has a computed value for + 'direction' use that as the inherited direction.
Otherwise, use the value of the dir attribute of the element - as the direction.
Otherwise, use the directionality + of the element as the inherited direction.
Otherwise, object's font style source object is an
- OffscreenCanvas
object:
OffscreenCanvas
object, set the
+ inherited direction when
+ the OffscreenCanvas
is created and use the same value through the
+ life of the OffscreenCanvas
:
Let global be object's relevant global - object.
If the OffscreenCanvas
was created via transferControlToOffscreen,
+ then set the inherited direction
+ to that of source canvas element's as described in the case above.
If global is a Window
object:
Otherwise, if global is a Window
object:
Let Document be the global's
associated Document
.
If the value of the dir attribute from
- Document is auto
then use the
- Document's computed value of 'direction'
- as the direction.
Otherwise, use the value of the dir attribute from - Document as the direction.
Use the directionality of the + Document as the inherited direction.
Otherwise, treat input to the text preparation algorithm as left-to-right text.
Otherwise, set the inherited direction to + "ltr".
Document
with a non-null document elementSet this canvas
element's context
mode to placeholder.
Set the inherited language of
+ offscreenCanvas to the language of this
+ canvas
element.
Set the inherited direction of
+ offscreenCanvas to the directionality of this
+ canvas
element.
Return offscreenCanvas.
If object's font style source object is a canvas
element, then set the language for the
- font to the element's language. The language for the font must be updated when the
- rendering context is created and each time the
- lang
attribute is
- set to "inherit" (not on all changes to the element's language).
Otherwise, if object's font style source object is an
- OffscreenCanvas
object created via transferControlToOffscreen,
- then set the language for the font to
- the source canvas element's language. The source
- canvas's language should be snapshot at the time of transfer and the value used
- whenever the lang
value is "inherit".
Otherwise, object's font style source object is an
- OffscreenCanvas
object:
Let global be object's relevant global - object.
If global is a Window
object, then set the language for the font to the
- language from global's
- associated Document
.
- The associated Document
's
- language should be snapshot when the OffscreenCanvas
is
- created and the value used whenever the lang
- value is "inherit".
Otherwise, the language for the - font is explicitly unknown.
Otherwise, object's font style source object is an
+ OffscreenCanvas
object/ Set the
+ language for the font to the OffscreenCanvas
's internal
+ inherited language.
Otherwise, the language for the font is the lang
value.
If object's font style source object is a canvas
element:
If the element has a computed value for 'direction' use that as the inherited direction.
Otherwise, object's font style source object is an
- OffscreenCanvas
object, set the
- inherited direction when
- the OffscreenCanvas
is created and use the same value through the
- life of the OffscreenCanvas
:
If the OffscreenCanvas
was created via transferControlToOffscreen,
- then set the inherited direction
- to that of source canvas element's as described in the case above.
Otherwise, if global is a Window
object:
Let Document be the global's
- associated Document
.
Use the directionality of the - Document as the inherited direction.
Otherwise, set the inherited direction to - "ltr".
Otherwise, object's font style source object is an
+ OffscreenCanvas
object. Set the inherited direction to the
+ OffscreenCanvas
's internal inherited
+ direction.
OffscreenCanvas
object. Initially, all the bitmap's pixels are transparent black.
+ An OffscreenCanvas
object has an internal inherited language and inherited direction set when
+ the OffscreenCanvas
is created.
An OffscreenCanvas
object can have a rendering context bound to it. Initially,
it does not have a bound rendering context. To keep track of whether it has a rendering context
or not, and what kind of rendering context it is, an OffscreenCanvas
object also
@@ -71377,9 +71337,35 @@ interface OffscreenCanvas : EventTarget {
array of transparent black pixels of the dimensions specified by width and
height; and its width
and height
attributes initialized to width and
- height respectively.
Let global be the OffscreenCanvas
's relevant global
+ object.
If global is a Window
object:
Let Document be the global's
+ associated Document
.
Set the inherited language + to the Document's language.
Set the inherited direction + to the Document's directionality.
Otherwise:
+Set the inherited language + to explicitly unknown.
Set the inherited direction + to "ltr".
OffscreenCanvas
objects are transferable. Their transfer steps, given value and
From 60a59711005d2ba6888ef91bb545a7af7d4076c0 Mon Sep 17 00:00:00 2001
From: Stephen Chenney
The choice of fonts and glyphs within a font may vary according to the lang
- IDL attribute. On setting, lang
must be
- a valid BCP 47 language tag or the string "inherit".
- To determine the language for the font from
- the lang
IDL attribute, use the following steps:
Objects that implement the CanvasTextDrawingStyles
interface have a lang
attribute
+ that controls localization of the font. The lang
IDL
+ attribute, on getting, must return the current value. The lang
setter steps are:
If object's lang
value is
- "inherit", then
If object's font style source object is a canvas
- element, then set the language for the
- font to the element's language.
Otherwise, object's font style source object is an
- OffscreenCanvas
object/ Set the
- language for the font to the OffscreenCanvas
's internal
- inherited language.
Otherwise, the language for the font is the lang
value.
Change the current value to the new value.
Set the language for the font using the + following steps:
+If the value is "inherit
", then
If object's font style source object is a canvas
+ element, then set the language for the
+ font to the element's language.
Otherwise, object's font style source object is an
+ OffscreenCanvas
object/ Set the
+ language for the font to the OffscreenCanvas
's internal
+ inherited language.
Otherwise, the language for the font + is the value.
The lang
IDL attribute, on getting, must return
- the current value.
When the object implementing the CanvasTextDrawingStyles
interface is created,
+ the lang
attribute must initially have the value
+ "inherit
" and the
+ language for the font must be set as above.
The font
IDL attribute, on setting, must be
Date: Thu, 23 Jan 2025 17:46:19 -0500
Subject: [PATCH 6/6] Next round of edits.
---
source | 85 +++++++++++++++++++++++++++++++---------------------------
1 file changed, 45 insertions(+), 40 deletions(-)
diff --git a/source b/source
index 444a147871e..44958edf80c 100644
--- a/source
+++ b/source
@@ -65332,20 +65332,20 @@ callback BlobCallback = undefined (Blob? blob);
and height
content attributes of this
canvas
element.
Set the placeholder canvas
- element of offscreenCanvas to a weak reference to this canvas
- element.
Set the offscreenCanvas's placeholder canvas
element of
+ offscreenCanvas to a weak reference to this canvas
element.
Set this canvas
element's context
mode to placeholder.
Set the inherited language of
- offscreenCanvas to the language of this
- canvas
element.
Set the offscreenCanvas's inherited language to the language of this canvas
element.
Set the inherited direction of
- offscreenCanvas to the directionality of this
- canvas
element.
Set the offscreenCanvas's inherited direction to the directionality of this canvas
element.
Return offscreenCanvas.
Returns the current font settings.
Can be set, to change the font. The syntax is the same as for the CSS 'font' - property; values that cannot be parsed as CSS font values are ignored. The default is "10px sans-serif".
+ property; values that cannot be parsed as CSS font values are ignored. The default is "10px + sans-serif".Relative keywords and lengths are computed relative to the font of the canvas
element.
Objects that implement the CanvasTextDrawingStyles
interface have a lang
attribute
- that controls localization of the font. The lang
IDL
- attribute, on getting, must return the current value. The lang
setter steps are:
font
attribute.
+
+ The lang
getter steps are to return the current
+ value.
The lang
setter steps are:
Change the current value to the new value.
Set the language for the font using the - following steps:
+If the value is "inherit
", then
If the value is "inherit
", then
If object's font style source object is a canvas
- element, then set the language for the
- font to the element's language.
Otherwise, object's font style source object is an
- OffscreenCanvas
object/ Set the
- language for the font to the OffscreenCanvas
's internal
- inherited language.
Otherwise, the language for the font - is the value.
If object's font style source object is a canvas
+ element, then set the font
+ language to the element's language.
Otherwise, object's font style source object is an
+ OffscreenCanvas
object. Set the
+ font language to the OffscreenCanvas
's internal
+ inherited language.
Otherwise, the font + language is the value.
When the object implementing the CanvasTextDrawingStyles
interface is created,
the lang
attribute must initially have the value
"inherit
" and the
- language for the font must be set as above.
The font
IDL attribute, on setting, must be parsed as a CSS <'font'> value (but
without supporting property-independent style sheet syntax like 'inherit'), and the resulting font
- must be assigned to the context, with the language
- for the font as determined above, with the 'line-height'
- component forced to 'normal', with the 'font-size' component converted to CSS pixels, and with system fonts being computed to explicit values. If the
- new value is syntactically incorrect (including using property-independent style sheet syntax
- like 'inherit' or 'initial'), then it must be ignored, without assigning a new font value.
- CSS
Font family names must be interpreted in the context of the font style source
object when the font is to be used; any fonts embedded using Let Document be the global's
associated Set the inherited language
- to the Document's language. Set the Set the inherited direction
+ Set the OffscreenCanvas : EventTarget {
Document
.OffscreenCanvas
's inherited language to the
+ Document's language.OffscreenCanvas
's inherited direction
to the Document's directionality.