Empty span elements interfere with bidirectional text
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox140 | --- | fixed |
People
(Reporter: NeatNit, Assigned: jfkthame)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0
Steps to reproduce:
The following HTML contains two spans with identical text, except one of them has an empty span in the middle:
<span dir="auto">1;2;3;5;12;20;22א;</span><br />
<span dir="auto">1;2;3;5;1<span></span>2;20;22א;</span>
They should both be rendered the same, as they are in Chromium. In Firefox, the "12" is rendered as "21".
The re-ordering of characters according to the Unicode Bidirectional Algorithm should not be affected by span elements.
Actual results:
Different rendering between elements
Expected results:
Identical rendering of both elements
Updated•2 months ago
|
Assignee | ||
Comment 1•2 months ago
|
||
Yes, this looks like a bug -- the empty span should have no visible effect.
It does seem to be specific to an empty span; if the span contains another digit, or a punctuation mark like .
or -
, I see the expected re-ordering.
Assignee | ||
Comment 2•2 months ago
|
||
Note that this changes the behavior of an existing reftest at
layout/reftests/bidi/588739-2.html. This is expected, because this
testcase was using an empty <span> with no other relevant properties,
and expecting it to interrupt bidi reordering, but that is exactly
the behavior reported as a bug here.
Both Chrome and Safari agree with the updated rendering of that
testcase (and the WPT version added here), so the change is both
logically correct and aligns us with the other browsers.
Updated•2 months ago
|
Wow, you're fast - I never would have imagined this would be fixed in less than a day! Thank you :)
Updated•2 months ago
|
Description
•