From e37c15a8da6f484f9ce32f8e76fd3c04dca6cbf6 Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Thu, 27 Feb 2025 09:53:28 +0000 Subject: [PATCH] Bug 1950674 [wpt PR 50969] - Cleanup Canvas text direction tests, a=testonly Automatic update from web-platform-tests Cleanup Canvas text direction tests Fix various style issues. And add tests for default, valid and invalid values. The tests for valid and default values fail because we never report `inherit`, but report the computed value instead. A spec issue was filed for the round-tripping of `direction` and it was resolved to return "inherit" rather than the computed value. See https://github.com/whatwg/html/issues/10884 and the spec PR at https://github.com/whatwg/html/pull/10873. The code will not be changed to pass these tests until the results of UseCounters have been reviewed to identify how often this change might affect sites. A search of HTTP Archive did not find failure cases, mostly because Firefox already returns "inherit" so sites check for that. Change-Id: I39645acd997786c22d4983f84a9d17c7b976797b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6277644 Reviewed-by: Andres Ricardo Perez Commit-Queue: Stephen Chenney Cr-Commit-Position: refs/heads/main@{#1425228} -- wpt-commits: e0a8cfa0bbb879d889e2ddf8b2b4161feb6a2204 wpt-pr: 50969 --- .../manual/text/canvas.2d.direction-ref.html | 40 ++++++------ .../text/canvas.2d.direction.dynamic-ref.html | 44 ++++++------- .../canvas.2d.direction.inherit.canvas.html | 33 +++++----- ...direction.inherit.disconnected.canvas.html | 63 +++++++++---------- .../canvas.2d.direction.inherit.document.html | 45 +++++++------ ...s.2d.direction.inherit.dynamic.canvas.html | 35 +++++------ .../canvas.2d.direction.inherit.style.html | 55 ++++++++-------- .../2d.text.direction.default.tentative.html | 27 ++++++++ .../text/2d.text.direction.invalid.html | 45 +++++++++++++ .../2d.text.direction.valid.tentative.html | 34 ++++++++++ .../canvas.2d.offscreen.direction-ref.html | 36 +++++------ .../text/canvas.2d.offscreen.direction.html | 43 ++++++------- ...ransferred.direction.inherit.document.html | 50 +++++++-------- ...fscreen.transferred.direction.inherit.html | 33 +++++----- ...vas.2d.offscreen.worker.direction-ref.html | 43 ++++++------- .../canvas.2d.offscreen.worker.direction.html | 59 +++++++++-------- ...2d.offscreen.worker.direction.inherit.html | 61 +++++++++--------- .../2d.text.direction.default.tentative.html | 28 +++++++++ ...text.direction.default.tentative.worker.js | 22 +++++++ .../text/2d.text.direction.invalid.html | 46 ++++++++++++++ .../text/2d.text.direction.invalid.worker.js | 40 ++++++++++++ .../2d.text.direction.valid.tentative.html | 35 +++++++++++ ...d.text.direction.valid.tentative.worker.js | 29 +++++++++ .../tests/html/canvas/tools/yaml/text.yaml | 37 +++++++++++ 24 files changed, 637 insertions(+), 346 deletions(-) create mode 100644 testing/web-platform/tests/html/canvas/element/text/2d.text.direction.default.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/element/text/2d.text.direction.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/element/text/2d.text.direction.valid.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.default.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.default.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.valid.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.valid.tentative.worker.js diff --git a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction-ref.html b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction-ref.html index e7f685244d9a5b..c7c43120709b5c 100644 --- a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction-ref.html +++ b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction-ref.html @@ -1,24 +1,20 @@ - - - - HTML5 Canvas Test Reference: The direction attribute. - - - - - - Browser does not support HTML5 Canvas. - - - + ctx.font = "25px serif"; + ctx.direction = "rtl"; + ctx.fillText("ABC!", 60, 50); + } + + + + Browser does not support HTML5 Canvas. + + diff --git a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.dynamic-ref.html b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.dynamic-ref.html index 2df2f127d09381..65a5b27f7263be 100644 --- a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.dynamic-ref.html +++ b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.dynamic-ref.html @@ -1,27 +1,23 @@ - - - - HTML5 Canvas Test Reference: The direction attribute. - - - - - - Browser does not support HTML5 Canvas. - - - + ctx.direction = "ltr"; + ctx.fillText("ABC!", 60, 100); + } + + + + Browser does not support HTML5 Canvas. + + diff --git a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.canvas.html b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.canvas.html index c6eee5d9a8c13b..14da877fa23f8a 100644 --- a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.canvas.html +++ b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.canvas.html @@ -1,25 +1,22 @@ - - HTML5 Canvas Test: The direction attribute inherits from the canvas - - - - - - + // The default for direction is inherit + ctx.font = "25px serif"; + ctx.fillText("ABC!", 60, 50); + } + Browser does not support HTML5 Canvas. diff --git a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.disconnected.canvas.html b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.disconnected.canvas.html index 0499563763a8ee..7848e6e030f871 100644 --- a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.disconnected.canvas.html +++ b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.disconnected.canvas.html @@ -1,38 +1,31 @@ - - - - HTML5 Canvas Test: The direction attribute inherits from a disconnected canvas element - - - - - - - - - Browser does not support HTML5 Canvas. - - - - + // The default for direction is inherit. + ctx.font = "25px serif"; + ctx.fillText("ABC!", 60, 50); + document.body.appendChild(canvas); + diff --git a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.document.html b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.document.html index c9a3e3bdfd0a56..42f7718b0acefa 100644 --- a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.document.html +++ b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.document.html @@ -1,31 +1,28 @@ - - HTML5 Canvas Test: The direction attribute inherits correctly - - - - - - - + // The default for direction is inherit, so no need to set any text styles, + ctx.font = "25px serif"; + ctx.fillText("ABC!", 60, 50); + } + + Browser does not support HTML5 Canvas. diff --git a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.dynamic.canvas.html b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.dynamic.canvas.html index 7762680f9ac45e..881855039543b5 100644 --- a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.dynamic.canvas.html +++ b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.dynamic.canvas.html @@ -1,27 +1,24 @@ - - HTML5 Canvas Test: The direction attribute dynamically updates - - - - - - + canvas.setAttribute("dir", "ltr"); + ctx.fillText("ABC!", 60, 100); + } + Browser does not support HTML5 Canvas. diff --git a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.style.html b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.style.html index 8405f56443ea0b..10ec25bb5f00c5 100644 --- a/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.style.html +++ b/testing/web-platform/tests/html/canvas/element/manual/text/canvas.2d.direction.inherit.style.html @@ -1,33 +1,28 @@ - - - - HTML5 Canvas Test: The direction attribute inherits from the canvas style - - - - - - - - - - Browser does not support HTML5 Canvas. - - - + // The default for direction is inherit + ctx.font = "25px serif"; + ctx.fillText("ABC!", 60, 50); + } + + + + + Browser does not support HTML5 Canvas. + + diff --git a/testing/web-platform/tests/html/canvas/element/text/2d.text.direction.default.tentative.html b/testing/web-platform/tests/html/canvas/element/text/2d.text.direction.default.tentative.html new file mode 100644 index 00000000000000..7c7a47148be1a4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/text/2d.text.direction.default.tentative.html @@ -0,0 +1,27 @@ + + + +Canvas test: 2d.text.direction.default.tentative + + + + + + +

2d.text.direction.default.tentative

+

+ + +

Actual output:

+

FAIL (fallback content)

+ +
    + + diff --git a/testing/web-platform/tests/html/canvas/element/text/2d.text.direction.invalid.html b/testing/web-platform/tests/html/canvas/element/text/2d.text.direction.invalid.html new file mode 100644 index 00000000000000..d8d903517f02f0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/text/2d.text.direction.invalid.html @@ -0,0 +1,45 @@ + + + +Canvas test: 2d.text.direction.invalid + + + + + + +

    2d.text.direction.invalid

    +

    + + +

    Actual output:

    +

    FAIL (fallback content)

    + +
      + + diff --git a/testing/web-platform/tests/html/canvas/element/text/2d.text.direction.valid.tentative.html b/testing/web-platform/tests/html/canvas/element/text/2d.text.direction.valid.tentative.html new file mode 100644 index 00000000000000..26593374e47d22 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/text/2d.text.direction.valid.tentative.html @@ -0,0 +1,34 @@ + + + +Canvas test: 2d.text.direction.valid.tentative + + + + + + +

      2d.text.direction.valid.tentative

      +

      + + +

      Actual output:

      +

      FAIL (fallback content)

      + +
        + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.direction-ref.html b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.direction-ref.html index 8949caa8486848..49cb8125c996e1 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.direction-ref.html +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.direction-ref.html @@ -1,22 +1,18 @@ - - - - HTML5 Canvas Test Reference: The direction attribute in an offscreen canvas - - - - - Browser does not support HTML5 Canvas. - - + ctx.font = "25px serif"; + ctx.direction = "rtl"; + ctx.fillText("ABC!", 60, 50); + } + + + Browser does not support HTML5 Canvas. + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.direction.html b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.direction.html index e3787cc7191c5f..e41a7666f75bee 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.direction.html +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.direction.html @@ -1,33 +1,30 @@ - - HTML5 Canvas Test: The direction attribute in offscreen canvas - - - - - - + - + requestAnimationFrame(() => requestAnimationFrame(() => takeScreenshot())); + } + Browser does not support HTML5 Canvas. diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.transferred.direction.inherit.document.html b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.transferred.direction.inherit.document.html index 1655ddc83e3a72..7099412d0b4fad 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.transferred.direction.inherit.document.html +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.transferred.direction.inherit.document.html @@ -1,34 +1,32 @@ - - HTML5 Canvas Test: The direction attribute inherits from the document - - - - - - + - - + requestAnimationFrame(() => requestAnimationFrame(() => takeScreenshot())); + } + + Browser does not support HTML5 Canvas. diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.transferred.direction.inherit.html b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.transferred.direction.inherit.html index fc2511a6b8835d..71b06c556d43d5 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.transferred.direction.inherit.html +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.transferred.direction.inherit.html @@ -1,26 +1,23 @@ - - HTML5 Canvas Test: Direction inherit in a transferred offscreen - - - - - - + - + requestAnimationFrame(() => requestAnimationFrame(() => takeScreenshot())); + } + Browser does not support HTML5 Canvas. diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.direction-ref.html b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.direction-ref.html index 23e70313cdbfd6..837f07fa1771ed 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.direction-ref.html +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.direction-ref.html @@ -1,27 +1,22 @@ - - - - HTML5 Canvas Test Reference: The direction attribute in an offscreen canvas - - - - - - Browser does not support HTML5 Canvas. - - - + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 1, 1); + } + + + + Browser does not support HTML5 Canvas. + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.direction.html b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.direction.html index 56c7dc00f2174f..c8835ee421cfff 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.direction.html +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.direction.html @@ -1,42 +1,39 @@ - - HTML5 Canvas Test: The direction attribute is respected in offscreen worker canvas - - - - - - + - + requestAnimationFrame(checkResult); + } + Browser does not support HTML5 Canvas. diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.direction.inherit.html b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.direction.inherit.html index a7b7ec66e17ec8..527d38fe1202ee 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.direction.inherit.html +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/text/canvas.2d.offscreen.worker.direction.inherit.html @@ -1,43 +1,40 @@ - - HTML5 Canvas Test: The direction attribute is inherited in offscreen worker canvas - - - - - - + - + requestAnimationFrame(checkResult); + } + Browser does not support HTML5 Canvas. diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.default.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.default.tentative.html new file mode 100644 index 00000000000000..900ed14aaac80a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.default.tentative.html @@ -0,0 +1,28 @@ + + + +OffscreenCanvas test: 2d.text.direction.default.tentative + + + + +

        2d.text.direction.default.tentative

        +

        + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.default.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.default.tentative.worker.js new file mode 100644 index 00000000000000..98e96d948d7bed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.default.tentative.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.direction.default.tentative +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.direction, 'inherit', "ctx.direction", "'inherit'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.invalid.html new file mode 100644 index 00000000000000..9d1507b06df5fb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.invalid.html @@ -0,0 +1,46 @@ + + + +OffscreenCanvas test: 2d.text.direction.invalid + + + + +

        2d.text.direction.invalid

        +

        + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.invalid.worker.js new file mode 100644 index 00000000000000..a5d4701df99554 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.invalid.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.direction.invalid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.direction = 'ltr'; + ctx.direction = 'rtl '; + _assertSame(ctx.direction, 'ltr', "ctx.direction", "'ltr'"); + + ctx.direction = 'rtl'; + ctx.direction = 'LTR'; + _assertSame(ctx.direction, 'rtl', "ctx.direction", "'rtl'"); + + ctx.direction = 'ltr'; + ctx.direction = 'rtl\0'; + _assertSame(ctx.direction, 'ltr', "ctx.direction", "'ltr'"); + + ctx.direction = 'ltr'; + ctx.direction = 'bogus'; + _assertSame(ctx.direction, 'ltr', "ctx.direction", "'ltr'"); + + ctx.direction = 'ltr'; + ctx.direction = 'inheri'; + _assertSame(ctx.direction, 'ltr', "ctx.direction", "'ltr'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.valid.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.valid.tentative.html new file mode 100644 index 00000000000000..3a85e775aaffb0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.valid.tentative.html @@ -0,0 +1,35 @@ + + + +OffscreenCanvas test: 2d.text.direction.valid.tentative + + + + +

        2d.text.direction.valid.tentative

        +

        + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.valid.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.valid.tentative.worker.js new file mode 100644 index 00000000000000..840f2527007d21 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.direction.valid.tentative.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.direction.valid.tentative +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.direction = 'ltr'; + _assertSame(ctx.direction, 'ltr', "ctx.direction", "'ltr'"); + + ctx.direction = 'rtl'; + _assertSame(ctx.direction, 'rtl', "ctx.direction", "'rtl'"); + + ctx.direction = 'inherit'; + _assertSame(ctx.direction, 'inherit', "ctx.direction", "'inherit'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/tools/yaml/text.yaml b/testing/web-platform/tests/html/canvas/tools/yaml/text.yaml index d0c608739a0043..8be18ee3cdf8fc 100644 --- a/testing/web-platform/tests/html/canvas/tools/yaml/text.yaml +++ b/testing/web-platform/tests/html/canvas/tools/yaml/text.yaml @@ -233,6 +233,43 @@ code: | @assert ctx.textBaseline === 'alphabetic'; +- name: 2d.text.direction.default.tentative + code: | + @assert ctx.direction === 'inherit'; + +- name: 2d.text.direction.valid.tentative + code: | + ctx.direction = 'ltr'; + @assert ctx.direction === 'ltr'; + + ctx.direction = 'rtl'; + @assert ctx.direction === 'rtl'; + + ctx.direction = 'inherit'; + @assert ctx.direction === 'inherit'; + +- name: 2d.text.direction.invalid + code: | + ctx.direction = 'ltr'; + ctx.direction = 'rtl '; + @assert ctx.direction === 'ltr'; + + ctx.direction = 'rtl'; + ctx.direction = 'LTR'; + @assert ctx.direction === 'rtl'; + + ctx.direction = 'ltr'; + ctx.direction = 'rtl\0'; + @assert ctx.direction === 'ltr'; + + ctx.direction = 'ltr'; + ctx.direction = 'bogus'; + @assert ctx.direction === 'ltr'; + + ctx.direction = 'ltr'; + ctx.direction = 'inheri'; + @assert ctx.direction === 'ltr'; + - name: 2d.text.draw.baseline.top desc: textBaseline top is the top of the em square (not the bounding box) test_type: promise