Bug 145498 - Text from attributes should be displayed in the direction of the attribute, not the element
Summary: Text from attributes should be displayed in the direction of the attribute, n...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-31 05:05 PDT by Aharon (Vladimir) Lanin
Modified: 2023-06-04 21:15 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aharon (Vladimir) Lanin 2015-05-31 05:05:30 PDT
HTML5 made a change in https://www.w3.org/Bugs/Public/show_bug.cgi?id=17829 to specify that "Text from attributes [that is exposed in user interfaces] is expected to be rendered in a manner that honours the directionality of the attribute.", instead of the directionality of the element as previously.

This makes a practical difference in the case of elements with dir="auto", where the directionality of the element is determined by its content, but the directionality of the attribute is determined independently by *its* own content.

So something like data:text/html; charset=utf-8,<p dir="auto" title="Hello!">مرحبا!</p> should be displayed with the exclamation mark on the left of the Arabic text in the body, but on the right of the English text in the tooltip. 

All the other attributes listed at https://html.spec.whatwg.org/multipage/dom.html#directionality-capable-attribute are also potentially affected.
Comment 2 Ahmad Saleem 2023-06-02 04:53:04 PDT
Chrome Canary 116 and Firefox Nightly 115 works perfectly.

While Safari 16.5 & STP171 show below text on left side rather than right and with Arabic text:

مرحبا!
Comment 3 zalan 2023-06-04 21:14:50 PDT
<meta charset="UTF-8"><p dir="auto" title="Hello!">مرحبا!</p>
looks to be working fine in shipping Safari (both tooltip and the rendered content)