[gaia-fast-list] Conform to RTL list spec

RESOLVED FIXED

Status

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: wilsonpage, Assigned: wilsonpage)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Updated

3 years ago
Blocks: 1217779
(Assignee)

Comment 1

3 years ago
Sam can you think of any cases throughout the Gaia that the attached spec wouldn't be appropriate. Do we still depend on `dir=auto` or is there any way we can implement the spec with just CSS?
Flags: needinfo?(sfoster)

Comment 2

3 years ago
As I mentioned in bug 1217779, you'll need dir="auto" for fixing paren-balancing and ensuring that ellipses go on the correct side of the text. Just setting text-align isn't enough, since Gecko needs to  have boundaries for the text to know exactly what run of text should be isolated from the rest of the document. Without dir="auto", if Gecko gets to a paren at the end, then it doesn't know if it should match the directionality of the previous text (say, LTR), or the directionality of the following text (which is usually the document's directionality, say RTL).

In Unicode terms, I think dir="auto" is like wrapping the text with FSI (first strong isolate) and PDI (pop directional isolate) characters. In other words, saying, "isolate the direction of this block of text from the stuff around it."

Comment 3

3 years ago
Oh, and just as a note, there is a CSS "direction" property, but 1) it doesn't support "auto", and 2) it's only there as a convenience for styling things that can't set directionality in the content (read: not HTML). The folks who write the CSS specs would strongly advise users to set dir in their HTML and not in their CSS, since directionality is part of the content and not so much about the style of the content.
(In reply to Wilson Page [:wilsonpage] from comment #1)
> Sam can you think of any cases throughout the Gaia that the attached spec
> wouldn't be appropriate. Do we still depend on `dir=auto` or is there any
> way we can implement the spec with just CSS?

So the component should probably implement the text-align to follow the document direction - at the list component level those rules are applicable globally, and an author should have to knowingly override that behavior. But the dir="auto" and responsibility for correctly rendering potentially bi-directional content in the list falls to the content - the <li> template, and the content itself if necessary. The component isn't in a position to know how to render or hint to the bidi algorithm on how to render what goes into its list items. Does that answer the question?
Flags: needinfo?(sfoster)
(Assignee)

Updated

3 years ago
Assignee: nobody → wilsonpage
(Assignee)

Comment 5

3 years ago
Created attachment 8689497 [details]
pull-request (master)
Attachment #8689497 - Flags: review?(squibblyflabbetydoo)

Comment 6

3 years ago
Comment on attachment 8689497 [details]
pull-request (master)

Looks good to me! I have one comment on GitHub about this that might be an issue, but otherwise, I think this is the right way to handle mixed-directionality content for gaia-fast-list.

There are probably similar issues elsewhere in the gaia-components. As I see them, I'll file bugs.
Attachment #8689497 - Flags: review?(squibblyflabbetydoo) → review+
(Assignee)

Updated

3 years ago
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.