diff --git a/source b/source index 13ac7862d0c..44958edf80c 100644 --- a/source +++ b/source @@ -65332,13 +65332,21 @@ 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 offscreenCanvas's inherited language to the language of this canvas element.

  • + +
  • Set the offscreenCanvas's inherited direction to the directionality of this canvas element.

  • +
  • Return offscreenCanvas.

  • @@ -65549,6 +65557,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") @@ -66022,6 +66031,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, or the + value "inherit" which is described + below.

    + +

    The default is "inherit".

    +
    +
    context.font [ = value ]
    styles.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.

    @@ -66694,15 +66718,53 @@ 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 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. 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.

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

    Treat input to the text preparation algorithm as right-to-left text.

    - +

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

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

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

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

    3. +
    +

    The fontKerning attribute's allowed keywords @@ -67033,32 +67109,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.
    @@ -71268,6 +71323,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 @@ -71288,9 +71348,37 @@ 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 OffscreenCanvas's inherited language to the + Document's language.

      4. + +
      5. Set the OffscreenCanvas's 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 @@ -146999,6 +147087,7 @@ INSERT INTERFACES HERE Ştefan Vargyas, Stefan Weiss, Steffen Meschkat, + Stephen Chenney, Stephen Ma, Stephen Stewart, Stephen White,