Closed Bug 1302734 Opened 8 years ago Closed 8 years ago

unicode-bidi:plaintext is not supported in vertical writing modes

Categories

(Core :: Layout: Block and Inline, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

Details

(Keywords: dev-doc-complete)

Attachments

(2 files)

When an element has the CSS property unicode-bidi:plaintext, its directionality is supposed to be "calculated without considering its parent bidirectional state or the value of the direction property"[1,2].

We support this for bidi content in horizontal writing mode; however, in vertical modes we seem to ignore unicode-bidi:plaintext, and the element's 'direction' property continues to be used.

Testcases coming....


[1] https://developer.mozilla.org/en/docs/Web/CSS/unicode-bidi#Values
[2] https://drafts.csswg.org/css-writing-modes-3/#valdef-unicode-bidi-plaintext
Here are some reftests for this; 4 of the 6 testcases currently fail, because of unicode-bidi:plaintext being ignored. (The other two are just sanity-tests to check that explicitly setting the direction has the expected effect.)
Attachment #8791211 - Flags: review?(dholbert)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
In nsIFrame::GetWritingMode, we have a special case to handle unicode-bidi:plaintext, but this is used only for horizontal writing mode:
https://dxr.mozilla.org/mozilla-central/rev/82d0a583a9a39bf0b0000bccbf6d5c9ec2596bcc/layout/generic/nsFrame.cpp#1118-1122

I can't see any good reason for this restriction, so I'm going to try simply removing it and see what breaks.......
AFAICS, there's no good reason for this limitation. I think it dates from the early days of writing-mode support, when we didn't implement bidi reordering for vertical modes, but that's no longer the case. Try run, to check for unexpected side-effects: https://treeherder.mozilla.org/#/jobs?repo=try&revision=76cd41615fe3.
Attachment #8791219 - Flags: review?(dholbert)
Comment on attachment 8791211 [details] [diff] [review]
Add reftests for unicode-bidi:plaintext in vertical writing mode

Review of attachment 8791211 [details] [diff] [review]:
-----------------------------------------------------------------

r=me on the tests, with one typo (I think) fixed

::: layout/reftests/writing-mode/1302734-bidi-plaintext-2d.html
@@ +8,5 @@
> +  writing-mode: vertical-rl;
> +}
> +</style>
> +<!-- unicode-bidi:plaintext should resolve to LTR, ignoring the direction property -->
> +<div style="direction:ltr; unicode-bidi:plaintext;">&rlm;x</div>

Nit: in the comment here, I believe you meant to say RTL (not LTR).
Attachment #8791211 - Flags: review?(dholbert) → review+
Comment on attachment 8791219 [details] [diff] [review]
Don't restrict unicode-bidi:plaintext support to horizontal writing mode

Review of attachment 8791219 [details] [diff] [review]:
-----------------------------------------------------------------

r=me
Attachment #8791219 - Flags: review?(dholbert) → review+
(In reply to Daniel Holbert [:dholbert] from comment #4)
> Nit: in the comment here, I believe you meant to say RTL (not LTR).

Indeed, thanks for catching!
https://hg.mozilla.org/integration/mozilla-inbound/rev/1aff840555e1a2a05accb90eee2739a75fb7b9b0
Bug 1302734 - Add reftests for unicode-bidi:plaintext in vertical writing mode. r=dholbert

https://hg.mozilla.org/integration/mozilla-inbound/rev/726bf8b82211f088f64a750edf7cfc4a7199f162
Bug 1302734 - Don't restrict unicode-bidi:plaintext support to horizontal writing mode. r=dholbert
https://hg.mozilla.org/mozilla-central/rev/1aff840555e1
https://hg.mozilla.org/mozilla-central/rev/726bf8b82211
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: