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 06/10] 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.
Otherwise, the font - language is the value.
lang
attribute.
When the object implementing the CanvasTextDrawingStyles
interface is created,
@@ -71409,11 +71410,18 @@ interface OffscreenCanvas : EventTarget {
Let width and height be the dimensions of value's bitmap.
Let language and direction be the values of value's + inherited language and + inherited direction.
Unset value's bitmap.
Set dataHolder.[[Width]] to width and dataHolder.[[Height]] to height.
Set dataHolder.[[Language]] to language and + dataHolder.[[Direction]] to direction.
Set dataHolder.[[PlaceholderCanvas]] to be a weak reference to
value's placeholder canvas
element, if value has one, or null if it does not.
Set value's inherited + language to dataHolder.[[Language]] and inherited direction to + dataHolder.[[Direction]].
If dataHolder.[[PlaceholderCanvas]] is not null, set value's placeholder 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 " The default is " Objects that implement the canvas
element to
dataHolder.[[PlaceholderCanvas]] (while maintaining the weak reference
From 25efd43f4e15648911ce647ed0c6ae61640d0063 Mon Sep 17 00:00:00 2001
From: Stephen Chenney inherit
" which is described
+ value "inherit
" with meaning given
below.inherit
".CanvasTextDrawingStyles
interface have a lang
attribute
that controls localization of the font. It is used to set the internal font language used when setting the
- font
attribute.font
.
The lang
getter steps are to return the current
value.
lang
setter steps,
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
From 369688c6713e4393291a34427a4018ee8bb734b8 Mon Sep 17 00:00:00 2001
From: Stephen Chenney 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
" with meaning given
+ value "inherit" with meaning given
below.
The default is "inherit
".
The default is "inherit".
context.font [ = value ]
Objects that implement the CanvasTextDrawingStyles
interface have a lang
attribute
- that controls localization of the font. It is used to set the internal font language for localizing the
- font
.
The lang
getter steps are to return the current
- value.
The lang
setter steps are:
Change the current value to the new value.
If the value is "inherit
", then
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, with the semantics of the global lang
attribute.
When the object implementing the CanvasTextDrawingStyles
interface is created,
- the lang
attribute must initially have the value
- "inherit
" and the
- font language 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, localized with the font language as determined by the
- lang
setter steps,
- 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
data-x="dom-context-2d-textBaseline">textBaseline
attribute must initially have the value
alphabetic
.
Objects that implement the CanvasTextDrawingStyles
interface have a
+ lang
+ attribute to localize font rendering.
The lang
IDL attribute, on getting, must return
+ the current value. On setting, the current value must be changed to the new value. When the object
+ implementing the CanvasTextDrawingStyles
interface is created, the lang
attribute must initially have the value
+ "inherit".
The direction
IDL attribute, on getting, must return
the current value. On setting, the current value must be changed to the new value. When the object
@@ -66966,6 +66937,27 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
The lang
attribute's allowed values are either
+ a value that is valid for the lang
element attribute, or the value
+ "inherit".
+
+
If the value is "inherit", use the
+ following process to determine the value for the inherited language
referred to in the
+ text preparation algorithm:
If object's font style source object is a canvas
+ element, then set the inherited
+ language
to the element's language.
Otherwise, object's font style source object is an
+ OffscreenCanvas
object. Set the inherited language
to the
+ OffscreenCanvas
's internal
+ inherited language.
The direction
attribute's allowed keywords are
as follows:
inherit
Use the following process to determine the value for the
- inherited direction
referred to in the text preparation algorithm
inherited
+ direction
referred to in the text preparation algorithm:
If object's font style source object is a canvas
@@ -67110,6 +67103,24 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
Let font be the current font of target, as given
by that object's font
attribute.
Apply the appropriate step from the following list to determine the value of language:
+ +lang
attribute has the value "inherit"lang
attribute with the semantics of the lang
element attribute.Apply the appropriate step from the following list to determine the value of direction:
@@ -67146,6 +67157,10 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); +The following features are defined in CSS Text: CSSTEXT