From eba506c96f8fe9abe96db35818c60fe8b66ef547 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Tue, 17 Dec 2024 22:00:53 -0500 Subject: [PATCH 01/19] Add the lang IDL attribute to CanvasTextDrawingStyles Also clean up what "inherit" means for direction. --- source | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 105 insertions(+), 7 deletions(-) diff --git a/source b/source index 0553c000382..e03fac401e7 100644 --- a/source +++ b/source @@ -65271,6 +65271,7 @@ interface mixin CanvasPathDrawingStyles { interface mixin CanvasTextDrawingStyles { // text + attribute DOMString lang; // (default: "inherit") attribute DOMString font; // (default 10px sans-serif) attribute CanvasTextAlign textAlign; // (default: "start") attribute CanvasTextBaseline textBaseline; // (default: "alphabetic") @@ -65735,6 +65736,7 @@ context.fillRect(100,0,50,50); // only this square remains data-x="dom-context-2d-shadowOffsetX">shadowOffsetX, shadowOffsetY, shadowBlur, lang, font, textAlign, textBaseline,
Text styles
+
context.lang [ = value ]
+
styles.lang [ = value ]
+
+

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 canvas element + or the unknown language when there is no canvas element.

+
+
context.font [ = value ]
styles.font [ = value ]
@@ -66407,15 +66422,56 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); Notice that the font is only loaded inside the worker, and not in the document context.

+

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:

+ +
    +
  1. If object's lang value is + "inherit", then

    +
      +
    1. If object's font style source object is a canvas + element, then return the element's lang atribute + value.

    2. + +
    3. +

      Otherwise, object's font style source object is an + OffscreenCanvas object:

      + +
        +
      1. Let global be object's relevant global + object.

      2. + +
      3. If global is a Window object, then return the + lang attribute from global's + associated Document.

      4. + +
      5. Otherwise, return a user-agent-defined default lang.

      6. +
      +
    4. +
    +
  2. Otherwise, the used value is the lang + value.

  3. +
+ +

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

+ must be assigned to the context, with the primary language set to the used-value for 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

inherit -

Default to the directionality of the canvas element or Document - as appropriate.

+

Use the following process to determine which direction to treat input to the text preparation algorithm

+ +
    +
  1. If object's font style source object is a canvas + element:

    + +
      +
    1. If dir attribute of the element is + auto then use the element's computed value of + 'direction' as the direction.

    2. + +
    3. Otherwise, use the value of the dir attribute of the element + as the direction.

    4. +
    + +
  2. +

    Otherwise, object's font style source object is an + OffscreenCanvas object:

    + +
      +
    1. Let global be object's relevant global + object.

    2. + +
    3. If global is a Window object:

      +
        +
      1. Let Document be the global's + associated Document.

      2. + +
      3. If the value of the dir attribute from + Document is auto then use the + Document's computed value of 'direction' + as the direction.

      4. + +
      5. Otherwise, use the value of the dir attribute from + Document as the direction.

      6. +
      +
    4. + +
    5. Otherwise, treat input to the text preparation algorithm as left-to-right text.

    6. +
    +
  3. +
+

The 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 Date: Tue, 17 Dec 2024 22:12:45 -0500 Subject: [PATCH 02/19] Fix Developer info --- source | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source b/source index 37bf63603fe..d03ada738ef 100644 --- a/source +++ b/source @@ -66240,11 +66240,12 @@ transform. ack Shaun Morris. -->

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.

+ are the same as those for the lang element attribute, or the + value "inherit".

-

The default is the lang of the canvas element - or the unknown language when there is no canvas element.

+

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.

context.font [ = value ]
From 1b5a1df95a0e30abe6d50cddefa5c9935e5121ca Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Tue, 21 Jan 2025 22:20:25 -0500 Subject: [PATCH 03/19] Post review revisions --- source | 127 +++++++++++++++++++++++++++------------------------------ 1 file changed, 59 insertions(+), 68 deletions(-) diff --git a/source b/source index 14cc24498f9..3f28bc62cd6 100644 --- a/source +++ b/source @@ -66525,11 +66525,10 @@ transform. ack Shaun Morris. -->

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".

+ 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 ]
@@ -66538,7 +66537,7 @@ transform. ack Shaun Morris. -->

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.

@@ -66714,35 +66713,52 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
attribute for="CanvasTextDrawingStyles">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:

  1. If object's lang value is "inherit", then

    1. If object's font style source object is a canvas - element, then return the element's lang atribute - value.

    2. + 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).

      + +
    3. 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".

    4. Otherwise, object's font style source object is an OffscreenCanvas object:

      -
      1. Let global be object's relevant global object.

      2. -
      3. If global is a Window object, then return the - lang attribute from global's - associated Document.

      4. - -
      5. Otherwise, return a user-agent-defined default lang.

      6. +
      7. 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".

      8. + +
      9. Otherwise, the language for the + font is explicitly unknown.

    -
  2. Otherwise, the used value is the lang - value.

  3. +
  4. 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

  1. If object's font style source object is a canvas element:

      -
    1. If dir attribute of the element is - auto then use the element's computed value of - 'direction' as the direction.

    2. +
    3. If the element has a computed value for + 'direction' use that as the inherited direction.

    4. -
    5. Otherwise, use the value of the dir attribute of the element - as the direction.

    6. +
    7. Otherwise, use the directionality + of the element as the inherited direction.

  2. 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:

      -
    1. Let global be object's relevant global - object.

    2. +
    3. 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.

    4. -
    5. If global is a Window object:

      +
    6. Otherwise, if global is a Window object:

      1. Let Document be the global's associated Document.

      2. -
      3. If the value of the dir attribute from - Document is auto then use the - Document's computed value of 'direction' - as the direction.

      4. - -
      5. Otherwise, use the value of the dir attribute from - Document as the direction.

      6. +
      7. Use the directionality of the + Document as the inherited direction.

    7. -
    8. Otherwise, treat input to the text preparation algorithm as left-to-right text.

    9. +
    10. Otherwise, set the inherited direction to + "ltr".

@@ -67131,32 +67143,11 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); data-x="dom-context-2d-direction-rtl">rtl"
Let direction be 'rtl'.
- - -
If the target object's font style source object is an - element
- -
Let direction be the directionality of the target object's font style source object.
- -
If the target object's font style source object is a - Document with a non-null document element
- -
Let direction be the directionality of the target - object's font style source object's document element.
- -
Otherwise
- -
Let direction be 'ltr'.
+ data-x="dom-context-2d-direction-inherit">inherit" +
Let direction be the target's inherited direction.
From 152e3a449b7142cf745e503c892bcfc12ac45d89 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Wed, 22 Jan 2025 20:18:49 -0500 Subject: [PATCH 04/19] Clean up offscreen snapshot behavior --- source | 118 +++++++++++++++++++++++++-------------------------------- 1 file changed, 52 insertions(+), 66 deletions(-) diff --git a/source b/source index 3f28bc62cd6..078aed3e121 100644 --- a/source +++ b/source @@ -65339,6 +65339,14 @@ callback BlobCallback = undefined (Blob? blob);
  • Set 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.

  • @@ -66722,41 +66730,12 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
    1. 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).

    2. - -
    3. 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".

    4. + font to the element's language.

      -
    5. -

      Otherwise, object's font style source object is an - OffscreenCanvas object:

      -
        -
      1. Let global be object's relevant global - object.

      2. - -
      3. 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".

      4. - -
      5. Otherwise, the language for the - font is explicitly unknown.

      6. -
      -
    6. +
    7. 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.

  • @@ -66980,7 +66959,6 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
    1. If object's font style source object is a canvas element:

      -
      1. If the element has a computed value for 'direction' use that as the inherited direction.

      2. @@ -66989,35 +66967,12 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); of the element as the inherited direction.

      -
    2. -

      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:

      - -
        -
      1. 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.

      2. - -
      3. Otherwise, if global is a Window object:

        -
          -
        1. Let Document be the global's - associated Document.

        2. - -
        3. Use the directionality of the - Document as the inherited direction.

        4. -
        -
      4. - -
      5. Otherwise, set the inherited direction to - "ltr".

      6. -
      -
    3. +
    4. Otherwise, object's font style source object is an + OffscreenCanvas object. Set the inherited direction to the + OffscreenCanvas's internal inherited + direction.

    @@ -71357,6 +71312,11 @@ interface OffscreenCanvas : EventTarget { data-x="dom-OffscreenCanvas-height">height attributes of the 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.

    + height respectively. The inherited + language and inherited direction + internal values must be set as follows:

    -
    +
      +
    1. Let global be the OffscreenCanvas's relevant global + object.

    2. +
    3. If global is a Window object:

      +
        +
      1. Let Document be the global's + associated Document.

      2. + +
      3. Set the inherited language + to the Document's language.

      4. + +
      5. Set the inherited direction + to the Document's directionality.

      6. +
      +
    4. +
    5. Otherwise:

      +
        +
      1. Set the inherited language + to explicitly unknown.

      2. + +
      3. Set the inherited direction + to "ltr".

      4. +
      +
    6. +

    OffscreenCanvas objects are transferable. Their transfer steps, given value and From 60a59711005d2ba6888ef91bb545a7af7d4076c0 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Wed, 22 Jan 2025 20:55:27 -0500 Subject: [PATCH 05/19] Fix the setter/getter for lang. --- source | 50 +++++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/source b/source index 078aed3e121..444a147871e 100644 --- a/source +++ b/source @@ -66717,31 +66717,39 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); Notice that the font is only loaded inside the worker, and not in the document context.

    -

    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:

      -
    1. If object's lang value is - "inherit", then

      -
        -
      1. If object's font style source object is a canvas - element, then set the language for the - font to the element's language.

      2. - -
      3. Otherwise, object's font style source object is an - OffscreenCanvas object/ Set the - language for the font to the OffscreenCanvas's internal - inherited language.

      4. -
      -
    2. Otherwise, the language for the font is the lang value.

    3. +
    4. Change the current value to the new value.

    5. +
    6. Set the language for the font using the + following steps:

      +
        +
      1. If the value is "inherit", then

        +
          +
        1. If object's font style source object is a canvas + element, then set the language for the + font to the element's language.

        2. + +
        3. Otherwise, object's font style source object is an + OffscreenCanvas object/ Set the + language for the font to the OffscreenCanvas's internal + inherited language.

        4. +
        +
      2. +
      3. Otherwise, the language for the font + is the value.

      4. +
      +
    -

    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/19] 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.

  • @@ -66545,7 +66545,8 @@ transform. ack Shaun Morris. -->

    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.

    @@ -66719,49 +66720,51 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

    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:

    + that controls localization of the font. It is used to set the internal font language used when setting the + font attribute.

    + +

    The lang getter steps are to return the current + value.

    + +

    The lang setter steps are:

    1. Change the current value to the new value.

    2. -
    3. Set the language for the font using the - following steps:

      +
    4. If the value is "inherit", then

        -
      1. If the value is "inherit", then

        -
          -
        1. If object's font style source object is a canvas - element, then set the language for the - font to the element's language.

        2. - -
        3. Otherwise, object's font style source object is an - OffscreenCanvas object/ Set the - language for the font to the OffscreenCanvas's internal - inherited language.

        4. -
        -
      2. -
      3. Otherwise, the language for the font - is the value.

      4. +
      5. If object's font style source object is a canvas + element, then set the font + language to the element's language.

      6. + +
      7. Otherwise, object's font style source object is an + OffscreenCanvas object. Set the + font language to the OffscreenCanvas's internal + inherited language.

    5. +
    6. 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.

    + 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, 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

    + must be assigned to the context, with the font language 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 OffscreenCanvas : EventTarget {

  • Let Document be the global's associated Document.

  • -
  • Set the inherited language - to the Document's language.

  • +
  • Set the OffscreenCanvas's inherited language to the + Document's language.

  • -
  • Set the inherited direction +

  • Set the OffscreenCanvas's inherited direction to the Document's directionality.

  • From 119a4c5753ab14f4373c58d429b4dfb4656e8d74 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Mon, 3 Feb 2025 14:09:21 -0500 Subject: [PATCH 07/19] Update the offscreen transfer steps, and clarify lang rules. --- source | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source b/source index 125c01d74e5..1f29e2c4a18 100644 --- a/source +++ b/source @@ -66759,7 +66759,8 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
  • Otherwise, the font - language is the value.

  • + language is the value, with the semantics of the global 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.

  • @@ -71427,6 +71435,11 @@ interface OffscreenCanvas : EventTarget { rectangular array of transparent black pixels with width given by dataHolder.[[Width]] and height given by dataHolder.[[Height]].

    +
  • Set value's inherited + language to dataHolder.[[Language]] and inherited direction to + dataHolder.[[Direction]].

  • +
  • If dataHolder.[[PlaceholderCanvas]] is not null, set value's placeholder canvas element to dataHolder.[[PlaceholderCanvas]] (while maintaining the weak reference From 25efd43f4e15648911ce647ed0c6ae61640d0063 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Tue, 4 Feb 2025 10:27:21 -0500 Subject: [PATCH 08/19] Text cleanup --- source | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source b/source index 1f29e2c4a18..bce76a4585e 100644 --- a/source +++ b/source @@ -66547,7 +66547,7 @@ transform. ack Shaun Morris. -->

    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" which is described + value "inherit" with meaning given below.

    The default is "inherit".

    @@ -66735,8 +66735,8 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

    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 used when setting the - font attribute.

    + data-x="concept-CanvasTextDrawingStyles-font-language">font language for localizing the + font.

    The lang getter steps are to return the current value.

    @@ -66773,8 +66773,9 @@ 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 font language as determined above, + 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 From 369688c6713e4393291a34427a4018ee8bb734b8 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Tue, 4 Feb 2025 22:13:04 -0500 Subject: [PATCH 09/19] Post-review update --- source | 111 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 63 insertions(+), 48 deletions(-) diff --git a/source b/source index bce76a4585e..c4f7f799daa 100644 --- a/source +++ b/source @@ -3836,6 +3836,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    • first available font
    • +
    • content language
    • The 'font-family' property
    • The 'font-weight' property
    • The 'font-size' property
    • @@ -66547,10 +66548,10 @@ transform. ack Shaun Morris. -->

      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 ]
      @@ -66732,55 +66733,15 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); Notice that the font is only loaded inside the worker, and not in the document context.

      -

      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:

      - -
        -
      1. Change the current value to the new value.

      2. -
      3. If the value is "inherit", then

        -
          -
        1. If object's font style source object is a canvas - element, then set the font - language to the element's language.

        2. - -
        3. Otherwise, object's font style source object is an - OffscreenCanvas object. Set the - font language to the OffscreenCanvas's internal - inherited language.

        4. -
        -
      4. -
      5. Otherwise, the font - language is the value, with the semantics of the global lang attribute.

      6. -
      - -

      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

      + 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

      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 em-under baseline
      +

      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:

      + +
        +
      1. If object's font style source object is a canvas + element, then set the inherited + language to the element's language.

      2. + +
      3. Otherwise, object's font style source object is an + OffscreenCanvas object. Set the inherited language to the + OffscreenCanvas's internal + inherited language.

      4. +
      +

      The direction attribute's allowed keywords are as follows:

      @@ -66981,7 +66973,8 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
      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:

      1. If object's font style source object is a canvas @@ -67110,6 +67103,24 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

      2. Let font be the current font of target, as given by that object's font attribute.

      3. +
      4. +

        Apply the appropriate step from the following list to determine the value of language:

        + +
        + +
        If the target object's lang attribute has the value "inherit"
        +
        Let language be the target's inherited language.
        + +
        Otherwise
        +
        Let language be the target's lang attribute with the semantics of the lang element attribute.
        +
        +
      5. +
      6. Apply the appropriate step from the following list to determine the value of direction:

        @@ -67146,6 +67157,10 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); + + content language + language + 'direction' direction From 7e5c880043b53357e868bd8e47c98c82d3dece0d Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Wed, 5 Feb 2025 09:54:16 -0500 Subject: [PATCH 10/19] Update link to content language --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index c4f7f799daa..227d39761e4 100644 --- a/source +++ b/source @@ -3836,7 +3836,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
        • first available font
        • -
        • content language
        • The 'font-family' property
        • The 'font-weight' property
        • The 'font-size' property
        • @@ -3957,6 +3956,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

          The following features are defined in CSS Text: CSSTEXT

            +
          • The content language concept
          • The 'text-transform' property
          • The 'white-space' property
          • The 'text-align' property
          • From 37d7233f5433ff90b15e3e8b05b9f02dfcab4611 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Fri, 14 Feb 2025 10:58:51 -0500 Subject: [PATCH 11/19] Minor cleanup --- source | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source b/source index 227d39761e4..4e9e53345ae 100644 --- a/source +++ b/source @@ -65351,15 +65351,15 @@ callback BlobCallback = undefined (Blob? blob); canvas element.

          • Set the offscreenCanvas's placeholder canvas element of - offscreenCanvas to a weak reference to this canvas element.

          • + data-x="offscreencanvas-placeholder">placeholder canvas element + to a weak reference to this canvas element.

          • Set this canvas element's context mode to placeholder.

          • Set the offscreenCanvas's inherited language to the language of this canvas element.

          • + data-x="offscreencanvas-inherited-lang">inherited language to the + language of this canvas element.

          • Set the offscreenCanvas's inherited direction to the 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

            + 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 Date: Fri, 21 Feb 2025 19:52:59 -0500 Subject: [PATCH 12/19] Next iteration --- source | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/source b/source index 8e53ebc14b5..1ad398cfaf8 100644 --- a/source +++ b/source @@ -66913,10 +66913,11 @@ transform. ack Shaun Morris. -->

            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, or the - value "inherit" with meaning given - below.

            +

            Can be set to a BCP 47 language tag, the empty string, or "inherit", to change the language used when + resolving fonts. The "inherit" string + takes the lanugage from the canvas element's language, or the associated Document when there + is no canvas element.

            The default is "inherit".

            @@ -67165,15 +67166,19 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); 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.

            +

            Objects that implement the CanvasTextDrawingStyles interface have an + associated language value + which is a BCP 47 language tag, the empty string, or "inherit", used to localize font rendering. + Initially, the language must + be "inherit".

            -

            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 lang getter step is to return + this's language.

            + +

            The lang setter step is to set this's + language to the string.

            The direction IDL attribute, on getting, must return @@ -67311,7 +67316,7 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

            If the value is "inherit", use the following process to determine the value for the inherited language referred to in the - text preparation algorithm:

            + text preparation algorithm whenever that algorithm is run:

            1. If object's font style source object is a canvas From bf760d78c0c0c03104e89fcead88cf9e6b859960 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Mon, 24 Feb 2025 17:45:01 -0500 Subject: [PATCH 13/19] Update with latest review fixes. --- source | 128 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 66 insertions(+), 62 deletions(-) diff --git a/source b/source index 1ad398cfaf8..e68cc36e91c 100644 --- a/source +++ b/source @@ -66913,13 +66913,13 @@ transform. ack Shaun Morris. -->

              Returns the current language setting.

              -

              Can be set to a BCP 47 language tag, the empty string, or "inherit", to change the language used when - resolving fonts. The "inherit" string - takes the lanugage from the canvas element's language, or the associated Document when there +

              Can be set to a BCP 47 language tag, the empty string, or "inherit", to change the language used when + resolving fonts. "inherit" + takes the language from the canvas element's language, or the associated Document when there is no canvas element.

              -

              The default is "inherit".

              +

              The default is "inherit".

              context.font [ = value ]
              @@ -67168,16 +67168,16 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

              Objects that implement the CanvasTextDrawingStyles interface have an associated language value - which is a BCP 47 language tag, the empty string, or "inherit", used to localize font rendering. + which is a BCP 47 language tag, the empty string, or "inherit", used to localize font rendering. Initially, the language must - be "inherit".

              + be "inherit".

              The lang getter step is to return + data-x="dom-context-2d-lang">lang getter steps are to return this's language.

              -

              The lang setter step is to set this's +

              The lang setter steps are to set this's language to the string.

              The

              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 whenever that algorithm is run:

              - -
                -
              1. If object's font style source object is a canvas - element, then set the inherited - language to the element's language.

              2. - -
              3. Otherwise, object's font style source object is an - OffscreenCanvas object. Set the inherited language to the - OffscreenCanvas's internal - inherited language.

              4. -
              + "inherit". If the value is "inherit", + use the process in the text preparation algorithm to obtain the + language from the canvas element, placeholder canvas, or document.

              The direction attribute's allowed keywords are as follows:

              @@ -67344,29 +67330,8 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
              inherit -

              Use the following process to determine the value for the - inherited - direction referred to in the text preparation algorithm:

              - -
                -
              1. If object's font style source object is a canvas - element:

                -
                  -
                1. If the element has a computed value for - 'direction' use that as the inherited direction.

                2. - -
                3. Otherwise, use the directionality - of the element as the inherited direction.

                4. -
                - -
              2. Otherwise, object's font style source object is an - OffscreenCanvas object. Set the inherited direction to the - OffscreenCanvas's internal inherited - direction.

              3. -
              -
              +

              Use the process in the text preparation algorithm to obtain the text + direction from the canvas element, placeholder canvas, or document.

              The fontKerning attribute's allowed keywords @@ -67481,13 +67446,26 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

              If the target object's lang attribute has the value "inherit"
              -
              Let language be the target's inherited language.
              + data-x="dom-context-2d-lang">lang attribute has the value "inherit" +
              Use the following algorithm to determine the value of language: +
                +
              1. +

                If object's font style source object is a canvas + element, set language to the element's + language.

                +
              2. +
              3. +

                Otherwise, object's font style source object is an + OffscreenCanvas object. Set language to the + OffscreenCanvas's internal + inherited language.

                +
              4. +
              +
              Otherwise
              -
              Let language be the target's Set language to the target's lang attribute with the semantics of the lang element attribute.
              @@ -67511,8 +67489,30 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
              If the target object's direction attribute has the value "inherit"
              -
              Let direction be the target's inherited direction.
              +
              Use the following algorithm to determine the direction: +
                +
              1. +

                If object's font style source object is a canvas + element:

                +
                  +
                1. If the element has a computed value for + 'direction' set the direction to the element's + computed value

                  +
                2. +
                3. +

                  Otherwise, set the direction to the directionality of the element.

                  +
                4. +
                +
              2. +
              3. +

                Otherwise, object's font style source object is an + OffscreenCanvas object. Set the direction to the + OffscreenCanvas's internal inherited direction.

                +
              4. +
              +
            2. @@ -71771,9 +71771,12 @@ interface OffscreenCanvas : EventTarget { internal values must be set as follows:

                -
              1. Let global be the OffscreenCanvas's relevant global - object.

              2. -
              3. If global is a Window object:

                +
              4. +

                Let global be the OffscreenCanvas's relevant global + object.

                +
              5. +
              6. +

                If global is a Window object:

                1. Let Document be the global's associated Document.

                2. @@ -71787,7 +71790,8 @@ interface OffscreenCanvas : EventTarget { to the Document's directionality.

              7. -
              8. Otherwise:

                +
              9. +

                Otherwise:

                1. Set the inherited language to explicitly unknown.

                2. From 12d6c1fd02558c2d03d307959bb4c015bdc9c42b Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Tue, 25 Feb 2025 13:40:03 -0500 Subject: [PATCH 14/19] Extract OffscreenCanvas constructor steps. Also remove outdated prose. Fix some quotes and definitions. --- source | 149 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 87 insertions(+), 62 deletions(-) diff --git a/source b/source index e68cc36e91c..e6715b56e9d 100644 --- a/source +++ b/source @@ -66915,8 +66915,8 @@ transform. ack Shaun Morris. -->

                  Can be set to a BCP 47 language tag, the empty string, or "inherit", to change the language used when - resolving fonts. "inherit" - takes the language from the canvas element's language, or the associated Document when there + resolving fonts. "inherit" + takes the language from the canvas element's language, or the associated document element when there is no canvas element.

                  The default is "inherit".

                  @@ -67168,10 +67168,11 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

                  Objects that implement the CanvasTextDrawingStyles interface have an associated language value - which is a BCP 47 language tag, the empty string, or "inherit", used to localize font rendering. - Initially, the language must - be "inherit".

                  + used to localize font rendering. Valid values are a BCP 47 language tag, the empty string, + or "inherit" where the language comes from the + canvas element's language, or the associated document element when there + is no canvas element. Initially, the language + must be "inherit".

                  The lang getter steps are to return @@ -67309,13 +67310,6 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

                  The em-under baseline
                  -

                  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 process in the text preparation algorithm to obtain the - language from the canvas element, placeholder canvas, or document.

                  -

                  The direction attribute's allowed keywords are as follows:

                  @@ -67441,34 +67435,45 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); by that object's font attribute.

                3. -

                  Apply the appropriate step from the following list to determine the value of language:

                  +

                  Apply the following algorithm to determine the value of language:

                  -
                  +
                    +
                  1. +

                    Set language to the target's language.

                    +
                  2. -
                    If the target object's lang attribute has the value "inherit"
                    -
                    Use the following algorithm to determine the value of language: -
                      -
                    1. -

                      If object's font style source object is a canvas - element, set language to the element's - language.

                      -
                    2. -
                    3. -

                      Otherwise, object's font style source object is an - OffscreenCanvas object. Set language to the - OffscreenCanvas's internal - inherited language.

                      -
                    4. -
                    -
                    +
                  3. +

                    If language is "inherit":

                    -
                    Otherwise
                    -
                    Set language to the target's lang attribute with the semantics of the lang element attribute.
                    -
                  +
                    +
                  1. +

                    Let sourceObject be object's + font style source object

                    +
                  2. + +
                  3. +

                    If sourceObject is a canvas + element, then set language to the sourceObject's + language.

                    +
                  4. + +
                  5. +

                    Otherwise:

                    +
                      +
                    1. +

                      Assert: sourceObject is an OffscreenCanvas object.

                      +
                    2. +
                    3. +

                      Set language to the sourceObject's internal + inherited language.

                      +
                    4. +
                    +
                  6. +
                  +
                4. +
              10. @@ -71759,45 +71764,65 @@ interface OffscreenCanvas : EventTarget { data-x="offscreencanvas-context-detached">detached by algorithms defined in this specification.

                -

                The constructor OffscreenCanvas(width, - height), when invoked, must create a new OffscreenCanvas - object with its bitmap initialized to a rectangular - 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. The inherited - language and inherited direction - internal values must be set as follows:

                +

                When the OffscreenCanvas(width, + height) constructor is invoked, the user agent must run the following + steps:

                1. -

                  Let global be the OffscreenCanvas's relevant global +

                  Let offscreen be a new OffscreenCanvas object.

                  +
                2. +
                3. +

                  Initialize offscreen's bitmap + to a rectangular array of transparent black pixels of the dimensions specified + by width and height.

                  +
                4. +
                5. +

                  Initialize offscreen's width to + width.

                  +
                6. +
                7. +

                  Initialize offscreen's height to + height.

                  +
                8. +
                9. +

                  Let global be the offscreen's relevant global object.

                10. If global is a Window object:

                    -
                  1. Let Document be the global's - associated Document.

                  2. +
                  3. +

                    Let Element be the document element of the + global's associated + Document.

                    +
                  4. -
                  5. Set the OffscreenCanvas's inherited language to the - Document's language.

                  6. +
                  7. +

                    Initialize offscreen's inherited language to the + Element's language.

                    +
                  8. -
                  9. Set the OffscreenCanvas's inherited direction - to the Document's directionality.

                  10. +
                  11. +

                    Initialize offscreen's inherited direction + to the Element's directionality.

                    +
                11. Otherwise:

                    -
                  1. Set the inherited language - to explicitly unknown.

                  2. - -
                  3. Set the inherited direction - to "ltr".

                  4. +
                  5. +

                    Initialize offscreen's inherited language to explicitly + unknown.

                    +
                  6. +
                  7. +

                    Initialize offscreen's inherited direction to "ltr".

                    +
                From 779363e54592d24132e542ac23eeb5021d9fd70f Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Wed, 26 Feb 2025 11:45:54 -0500 Subject: [PATCH 15/19] Next round of edits. --- source | 185 +++++++++++++++++++++------------------------------------ 1 file changed, 69 insertions(+), 116 deletions(-) diff --git a/source b/source index e6715b56e9d..4135644a5b6 100644 --- a/source +++ b/source @@ -67166,13 +67166,13 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); data-x="dom-context-2d-textBaseline">textBaseline attribute must initially have the value alphabetic.

                -

                Objects that implement the CanvasTextDrawingStyles interface have an - associated language value - used to localize font rendering. Valid values are a BCP 47 language tag, the empty string, - or "inherit" where the language comes from the - canvas element's language, or the associated document element when there - is no canvas element. Initially, the language - must be "inherit".

                +

                Objects that implement the CanvasTextDrawingStyles interface have an associated + language value used to localize font + rendering. Valid values are a BCP 47 language tag, the empty string, or "inherit" where the language comes from the + canvas element's language, or the associated document element when there + is no canvas element. Initially, the language must be "inherit".

                The lang getter steps are to return @@ -67325,7 +67325,7 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

                inherit

                Use the process in the text preparation algorithm to obtain the text - direction from the canvas element, placeholder canvas, or document.

                + direction from the canvas element, placeholder canvas, or document element.

      The fontKerning attribute's allowed keywords @@ -67434,43 +67434,23 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

    • Let font be the current font of target, as given by that object's font attribute.

    • -
    • -

      Apply the following algorithm to determine the value of language:

      +
    • Let language be the target's language.

    • +
    • If language is "inherit":

        -
      1. -

        Set language to the target's language.

        -
      2. +
      3. Let sourceObject be object's font style source + object

      4. -
      5. -

        If language is "inherit":

        +
      6. If sourceObject is a canvas + element, then set language to the sourceObject's + language.

      7. +
      8. Otherwise:

          -
        1. -

          Let sourceObject be object's - font style source object

          -
        2. - -
        3. -

          If sourceObject is a canvas - element, then set language to the sourceObject's - language.

          -
        4. - -
        5. -

          Otherwise:

          -
            -
          1. -

            Assert: sourceObject is an OffscreenCanvas object.

            -
          2. -
          3. -

            Set language to the sourceObject's internal - inherited language.

            -
          4. -
          -
        6. +
        7. Assert: sourceObject is an OffscreenCanvas object.

        8. +
        9. Set language to the sourceObject's + inherited language.

      @@ -67494,28 +67474,22 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
      If the target object's direction attribute has the value "inherit"
      -
      Use the following algorithm to determine the direction: +
        -
      1. -

        If object's font style source object is a canvas - element:

        +
      2. Let sourceObject be object's font style source + object

      3. + +
      4. If sourceObject is a canvas + element, then let direction be sourceObject's + directionality.

      5. + +
      6. Otherwise:

          -
        1. If the element has a computed value for - 'direction' set the direction to the element's - computed value

          -
        2. -
        3. -

          Otherwise, set the direction to the directionality of the element.

          -
        4. +
        5. Assert: sourceObject is an OffscreenCanvas object.

        6. +
        7. Let direction be sourceObject's + inherited direction.

      7. -
      8. -

        Otherwise, object's font style source object is an - OffscreenCanvas object. Set the direction to the - OffscreenCanvas's internal inherited direction.

        -
      @@ -67523,7 +67497,8 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
    • Form a hypothetical infinitely-wide CSS line box containing a single - inline box containing the text text, with its CSS properties set as + inline box containing the text text, with the CSS + content language set to language, and with its CSS properties set as follows:

      @@ -67534,10 +67509,6 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); - - - - @@ -71764,65 +71735,47 @@ interface OffscreenCanvas : EventTarget { data-x="offscreencanvas-context-detached">detached by algorithms defined in this specification.

      -

      When the OffscreenCanvas(width, - height) constructor is invoked, the user agent must run the following - steps:

      +

      The new OffscreenCanvas(width, + height) constructor steps are:

        -
      1. -

        Let offscreen be a new OffscreenCanvas object.

        -
      2. -
      3. -

        Initialize offscreen's bitmap - to a rectangular array of transparent black pixels of the dimensions specified - by width and height.

        -
      4. -
      5. -

        Initialize offscreen's width to - width.

        -
      6. -
      7. -

        Initialize offscreen's height to - height.

        -
      8. -
      9. -

        Let global be the offscreen's relevant global - object.

        -
      10. -
      11. -

        If global is a Window object:

        -
          -
        1. -

          Let Element be the document element of the - global's associated - Document.

          -
        2. +
        3. Initialize the bitmap of this + to a rectangular array of transparent black pixels of the dimensions specified + by width and height.

        4. -
        5. -

          Initialize offscreen's inherited language to the - Element's language.

          -
        6. +
        7. Initialize the width of this + to width.

        8. + +
        9. Initialize the height of + this to height.

        10. + +
        11. Initialize the inherited language + of this to explicitly unknown.

        12. + +
        13. Initialize the inherited + direction of this to "ltr".

        14. + +
        15. Let global be the relevant global object of + this.

        16. -
        17. -

          Initialize offscreen's inherited direction - to the Element's directionality.

          -
        18. -
        -
      12. -

        Otherwise:

        +

        If global is a Window object

        +
          -
        1. -

          Initialize offscreen's inherited language to explicitly - unknown.

          -
        2. -
        3. -

          Initialize offscreen's inherited direction to "ltr".

          -
        4. +
        5. Let element be the document element of the global's + associated Document.

          + +
        6. If element is not null:

          + +
            +
          1. Set the inherited language + of this to element's language.

            +
          2. + +
          3. Set the inherited + direction of this to element's directionality.

          4. +
      From cdd56dae50f6a0fb6e7a2f11482bcf5b35fb4ef3 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Wed, 26 Feb 2025 11:51:13 -0500 Subject: [PATCH 16/19] Fix annotaton of direction inherit. --- source | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source b/source index 4135644a5b6..ff6a259040c 100644 --- a/source +++ b/source @@ -67325,7 +67325,9 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
      inherit

      Use the process in the text preparation algorithm to obtain the text - direction from the canvas element, placeholder canvas, or document element.

      + direction from the canvas element, placeholder canvas element, or + document element.

      The fontKerning attribute's allowed keywords From 2e79feb02c2024456ec8bf7d16f20f8100405e89 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Wed, 26 Feb 2025 17:07:14 -0500 Subject: [PATCH 17/19] More formatting cleanup and text improvements. --- source | 55 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/source b/source index ff6a259040c..4eb3a9abdb3 100644 --- a/source +++ b/source @@ -66915,9 +66915,9 @@ transform. ack Shaun Morris. -->

      Can be set to a BCP 47 language tag, the empty string, or "inherit", to change the language used when - resolving fonts. "inherit" - takes the language from the canvas element's language, or the associated document element when there - is no canvas element.

      + resolving fonts. "inherit" takes the language + from the canvas element's language, or the associated document + element when there is no canvas element.

      The default is "inherit".

      @@ -67171,7 +67171,8 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); rendering. Valid values are a BCP 47 language tag, the empty string, or "inherit" where the language comes from the canvas element's language, or the associated document element when there - is no canvas element. Initially, the language must be "canvas element. Initially, the language must be "inherit".

      The this's language.

      The lang setter steps are to set this's - language to the string.

      + language to the given value.

      The direction IDL attribute, on getting, must return @@ -67439,7 +67440,9 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

    • Let language be the target's language.

    • -
    • If language is "inherit":

      +
    • +

      If language is "inherit":

      +
      1. Let sourceObject be object's font style source object

      2. @@ -67448,7 +67451,8 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); element, then set language to the sourceObject's language.

        -
      3. Otherwise:

        +
      4. +

        Otherwise:

        1. Assert: sourceObject is an OffscreenCanvas object.

        2. Set language to the sourceObject's @@ -67459,7 +67463,8 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]);

        3. -

          Apply the appropriate step from the following list to determine the value of direction:

          +

          Apply the appropriate step from the following list to determine the value of + direction:

          @@ -67485,9 +67490,11 @@ worker.postMessage(offscreenCanvas, [offscreenCanvas]); element, then let direction be sourceObject's directionality.

        4. -
        5. Otherwise:

          +
        6. +

          Otherwise:

          1. Assert: sourceObject is an OffscreenCanvas object.

          2. +
          3. Let direction be sourceObject's inherited direction.

          @@ -71751,11 +71758,11 @@ interface OffscreenCanvas : EventTarget {
        7. Initialize the height of this to height.

        8. -
        9. Initialize the inherited language - of this to explicitly unknown.

        10. +
        11. Set this's inherited + language to explicitly unknown.

        12. -
        13. Initialize the inherited - direction of this to "ltr".

        14. +
        15. Set this's inherited + direction to "ltr".

        16. Let global be the relevant global object of this.

        17. @@ -71765,19 +71772,21 @@ interface OffscreenCanvas : EventTarget {
          1. Let element be the document element of the global's - associated Document.

            + associated Document.

          2. -
          3. If element is not null:

            +
          4. +

            If element is not null:

            -
              -
            1. Set the inherited language - of this to element's language.

              -
            2. +
                +
              1. Set the inherited language + of this to element's language.

              2. -
              3. Set the inherited - direction of this to element's directionality.

              4. -
              +
            3. Set the inherited + direction of this to element's directionality.

            4. +
            +
        From c19feba5e1328a7266623dc86ac65eaee5f3524a Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Thu, 27 Feb 2025 09:01:03 -0500 Subject: [PATCH 18/19] More cleanup. --- source | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source b/source index 4eb3a9abdb3..0a4b07b4ce1 100644 --- a/source +++ b/source @@ -13609,7 +13609,7 @@ Transport Protocol">HTTP</abbr> today.</p>
    • content languagelanguage
      'direction' direction