Closed Bug 1728999 Opened 4 years ago Closed 3 years ago

Support of CanvasRenderingContext2D.direction

Categories

(Core :: Graphics: Canvas2D, enhancement)

Firefox 93
enhancement

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: mistriela, Assigned: jfkthame)

References

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36

Steps to reproduce:

Currently RTL support in HTML Canvas is not supported.
This causes corrupted RTL text rending in Firefox & GeckoView for the Hebrew & Arabic languages.

According to the MDN docs:
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/direction

This is not supported.

Yet this has a huge impact on the web for users of RTL languages.

Actual results:

Open the following jsFiddle in Chrome and the in Firefox:

https://jsfiddle.net/mistriel/4mu386t5/

On FF the sentence is getting cropped and not displayed properly
See attached screen shots as well

Expected results:

The fiddle should have been displayed the same on both browsers.

Are you planning to support this feature ?
This is also highly required for my Company that relies on fabric.js library that is a High Level API for the Canvas.

We are currently facing this issue cannot find any alternative.
Please advise.

The Bugbug bot thinks this bug should belong to the 'Core::Canvas: 2D' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Canvas: 2D
Product: Firefox → Core

(In reply to Release mgmt bot [:sylvestre / :calixte / :marco for bugbug] from comment #1)

The Bugbug bot thinks this bug should belong to the 'Core::Canvas: 2D' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Was not aware for this component - you are right :-)

Guys any thoughts about this ?

Flags: needinfo?(lsalzman)
Flags: needinfo?(lsalzman) → needinfo?(jfkthame)
Assignee: nobody → jfkthame
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

And remove failure annotations for a couple of existing tests that we now pass.

Depends on D142701

Flags: needinfo?(jfkthame)
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/970ec2a9f31a Implement the CanvasRenderingContext2D.direction property. r=lsalzman,emilio https://hg.mozilla.org/integration/autoland/rev/7b0db7136784 Add simple WPT testcases for the CanvasRenderingContext2D.direction property. r=lsalzman
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/33511 for changes under testing/web-platform/tests

How can i test this ?

(In reply to mistriela from comment #8)

How can i test this ?

It should work in Firefox Nightly (https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly) starting from tomorrow's update (2022-04-06), I expect, as the fix is just going into the source code today.

(In reply to Jonathan Kew (:jfkthame) from comment #9)

(In reply to mistriela from comment #8)

How can i test this ?

It should work in Firefox Nightly (https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly) starting from tomorrow's update (2022-04-06), I expect, as the fix is just going into the source code today.

Awesome !
Will update

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
Upstream PR merged by moz-wptsync-bot

Awesome issue is resolved !
Tnx Jonathan Kew (:jfkthame) highly appreciated :-)

Regressions: 1801789
Duplicate of this bug: 1095497
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: