Created attachment 418087 [details] actual Open data:text/html,<textarea id=textarea>a%0Ab%0Ac</textarea><button onclick="textarea.dir=textarea.dir==='rtl'?'ltr':'rtl'">Switch</button><br><textarea>a%0Ab%0Ac</textarea><br><textarea dir=rtl>a%0Ab%0Ac</textarea> Use switch button or right click switch textarea's direction from Paragraph Direction Expected: Like other browsers, not confused expand icon, to have the first like the third after switch button being hit. Actual: The used expand icon is confused when direction is changed. Also the scrollbar's animation isn't correct.
Not that impacting but hit me while using Safari on some site so will try to work on this myself but helps would be nice :)
Thanks for filing, I can reproduce this on Safari 13.1.3 and STP 118.
<rdar://problem/73475239>
Note that this appears to be specifically when the the textarea has overflow. If you expand the textarea before changing its direction such that there is no overflow, this doesn't reproduce. I think :smfr has been working on overflow-related stuff recently, so CC'ing him.
Created attachment 472494 [details] Patch
Created attachment 472497 [details] [fast-cq]Patch
Committed 283327@main (7a6719898c9a): <https://commits.webkit.org/283327@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 472497 [details].