Adlam text displayed in a block element with 'dir' set to 'auto' should be automatically right-aligned, unless the base direction is set to LTR. See https://github.com/w3c/afrlreq/issues/13 for more info.
Can you please attach a test html file as well? Thanks
<rdar://problem/73688496>
Actually it looks like this page may work: http://adlamtesting.appspot.com
On second thought that page is showing it in a <textarea> but at least it provides some test text.
Created attachment 418695 [details] WebKit doesn't automatically right-align Adlam Here's a test HTML file.
The content has dir="auto"
If the text is moved out from the intermediate <p> element, it becomes right aligned. Somehow the <p> element is causing the problem.
(In reply to Myles C. Maxfield from comment #7) > If the text is moved out from the intermediate <p> element, it becomes right > aligned. Somehow the <p> element is causing the problem. Whoops, this is only true if you insert some RTL text like Arabic at the beginning of the string.
(In reply to Myles C. Maxfield from comment #8) > (In reply to Myles C. Maxfield from comment #7) > > If the text is moved out from the intermediate <p> element, it becomes right > > aligned. Somehow the <p> element is causing the problem. > > Whoops, this is only true if you insert some RTL text like Arabic at the > beginning of the string. Yeah, ignore what I said about the <p> element. The <p> element has nothing to do with this.
The first place to check would be StringImpl::defaultWritingDirection()
oh hahahaha we're terrible auto charDirection = u_charDirection(is8Bit() ? m_data8[i] : m_data16[i]); super broken
Created attachment 418778 [details] Patch
Committed r272084: <https://trac.webkit.org/changeset/272084> All reviewed patches have been landed. Closing bug and clearing flags on attachment 418778 [details].
Comment on attachment 418778 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=418778&action=review > Source/WTF/wtf/text/StringImpl.cpp:1672 > UCharDirection StringImpl::defaultWritingDirection(bool* hasStrongDirectionality) Some day to clean up: Feels to me like we should move this function to StringView or make it a non-member function that takes a StringView, in some place where we have code about writing direction and bidirectional algorithms. And give it a better interface with return values instead of an out argument. And add a fast path so we aren’t calling u_charDirection in common cases.
(In reply to Darin Adler from comment #15) > Comment on attachment 418778 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=418778&action=review > > > Source/WTF/wtf/text/StringImpl.cpp:1672 > > UCharDirection StringImpl::defaultWritingDirection(bool* hasStrongDirectionality) > > Some day to clean up: Feels to me like we should move this function to > StringView or make it a non-member function that takes a StringView, in some > place where we have code about writing direction and bidirectional > algorithms. And give it a better interface with return values instead of an > out argument. And add a fast path so we aren’t calling u_charDirection in > common cases. Yeah, Alex and I had a conversation about the direction to move this class. Sounds like we all agree :)
Thanks for fixing this.