Closed
Bug 503957
Opened 16 years ago
Closed 16 years ago
RTL mixing hebrew & ascii characters + display:inline = weird layout
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jbalogh, Assigned: smontagu)
Details
Attachments
(3 files)
The attached page shows 4 list items; one with mixed Hebrew and ascii characters, the rest all ascii (we get this sort of thing on AMO). The three all-ascii items are displayed *inside* of the mixed item.
Webkit does the same thing, but it still seems like a bug to me.
Assignee | ||
Comment 1•16 years ago
|
||
For "display: inline" this is the expected result. To avoid the issue, you can use "unicode-bidi: embed" as in this example.
Reporter | ||
Comment 2•16 years ago
|
||
Awesome, thanks Simon!
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
Note that http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi says:
Because the Unicode algorithm has a limit of 61 levels of embedding, care should be taken not to use 'unicode-bidi' with a value other than 'normal' unless appropriate. In particular, a value of 'inherit' should be used with extreme caution. However, for elements that are, in general, intended to be displayed as blocks, a setting of 'unicode-bidi: embed' is preferred to keep the element together in case display is changed to inline (see example below).
Assignee | ||
Comment 4•16 years ago
|
||
David, are you suggesting that we should add "unicode-bidi: embed" to elements with "display: block" in html.css?
Probably not, although possibly. I can imagine authors doing things that lead to lots of nesting, though.
Assignee | ||
Comment 6•16 years ago
|
||
I'm not so sure this is invalid after all: see http://www.w3.org/TR/REC-html40/struct/dirlang.html#style-bidi:
"When a block element that does not have a dir attribute is transformed to the style of an inline element by a style sheet, the resulting presentation should be equivalent, in terms of bidirectional formatting, to the formatting obtained by explicitly adding a dir attribute (assigned the inherited value) to the transformed element."
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Assignee | ||
Comment 7•16 years ago
|
||
So I tried to solve this by forcing unicode-bidi: embed in the bidi resolution code, but I wasn't convinced. The first problem with that approach is that it would be impossible to override in a style sheet. Secondly, I didn't succeed in finding a sane way to identify elements that have display: block by default, other than a hard-coded list (ewww) or adding an IsNodeOfType bit in nsINode.h, which seems like overkill.
So, assuming that we want to fix this at all (and AFAICT no other user agent conforms to the standard that I quoted in the previous comment), I don't see any way other than adding an html.css rule.
Assignee | ||
Comment 8•16 years ago
|
||
Comment on attachment 393492 [details] [diff] [review]
html.css patch
Looks good, except I'd suggest adding the following tags to the list:
body
html
isindex
listing
map
marquee
plaintext
xmp
(marquee is inline-block)
And I think you can remove:
col
colgroup
hr
since they can't contain anything.
Attachment #393492 -
Flags: review?(dbaron) → review+
Comment 10•16 years ago
|
||
This seems like the right approach to me.
Assignee | ||
Comment 11•16 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 16 years ago → 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•