YouTube search field shows RTL text outside its border on iPadOS
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jul 2019 01:50:58 +0000 (01:50 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jul 2019 01:50:58 +0000 (01:50 +0000)
commit5a1b1b60f2f0b0ac9f3e00ed69b3142fb5f45044
tree30aba5a5a0317ecc47b2f3319e6d1d7da07dc1d0
parentf7500e998fc099c19635ac27a6aca877f06c44a4
YouTube search field shows RTL text outside its border on iPadOS
https://bugs.webkit.org/show_bug.cgi?id=200253
<rdar://problem/53680603>

Reviewed by Beth Dakin.

Source/WebKit:

Limits code added in r238939 to respect the current keyboard's writing mode to only editable web views. This
behavior was only intended for Mail, and isn't generally compatible with web content.

While the call to -setInitialDirection is correctly gated on an web view editability check, it appears that
other changes in iOS 13 now cause -setBaseWritingDirection:forRange: to be invoked directly from keyboards code.
This means that -setBaseWritingDirection:forRange: should additionally be guarded with the same check.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setBaseWritingDirection:forRange:]):

LayoutTests:

* editing/input/ios/rtl-keyboard-input-on-focus-in-editable-page-expected.txt: Renamed from LayoutTests/editing/input/ios/rtl-keyboard-input-on-focus-expected.txt.
* editing/input/ios/rtl-keyboard-input-on-focus-in-editable-page.html: Renamed from LayoutTests/editing/input/ios/rtl-keyboard-input-on-focus.html.

Rename an existing test, rtl-keyboard-input-on-focus.html, to rtl-keyboard-input-on-focus-in-editable-page.html
to emphasize the fact that it requires an editable web view.

* editing/input/ios/rtl-keyboard-input-on-focus-in-non-editable-page-expected.txt: Added.
* editing/input/ios/rtl-keyboard-input-on-focus-in-non-editable-page.html: Added.

Add a new layout test to ensure that we don't automatically apply an RTL attribute when focusing fields in a
non-editable web view.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/input/ios/rtl-keyboard-input-on-focus-in-editable-page-expected.txt [moved from LayoutTests/editing/input/ios/rtl-keyboard-input-on-focus-expected.txt with 100% similarity]
LayoutTests/editing/input/ios/rtl-keyboard-input-on-focus-in-editable-page.html [moved from LayoutTests/editing/input/ios/rtl-keyboard-input-on-focus.html with 99% similarity]
LayoutTests/editing/input/ios/rtl-keyboard-input-on-focus-in-non-editable-page-expected.txt [new file with mode: 0644]
LayoutTests/editing/input/ios/rtl-keyboard-input-on-focus-in-non-editable-page.html [new file with mode: 0644]
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm