Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1f6aecd2d6505d6ffb9bc1c379f806c1f76698c7
      
https://github.com/WebKit/WebKit/commit/1f6aecd2d6505d6ffb9bc1c379f806c1f76698c7
  Author: Wenson Hsieh <[email protected]>
  Date:   2024-01-03 (Wed, 03 Jan 2024)

  Changed paths:
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    M Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm

  Log Message:
  -----------
  [UIAsyncTextInput] Fix several failing iOS API tests when async text input is 
enabled
https://bugs.webkit.org/show_bug.cgi?id=267064
rdar://120438466

Reviewed by Megan Gardner.

Fix 4 failing API tests, when async text input is enabled:

• DragAndDropTests.ContentEditableToContentEditable
• DragAndDropTests.ContentEditableToTextarea

These two tests are failing because they expect WebKit to write RTF and/or 
FlatRTFD upon starting a
drag. This is no longer the case when this feature is enabled, since the system 
now takes care of
lazily coercing web archive and HTML data to RTF/FlatRTFD/`NSAttributedString` 
as needed.

As such, we simply adjust this test to pass as long as HTML data is placed at a 
higher type fidelity
than plain text.

• KeyboardInputTests.IsSingleLineDocument

This actually caught a real bug, where we're failing to actually set the 
`singleLineDocument`
property on the extended traits delegate (`WKSEExtendedTextInputTraits`), since 
the call site is
guarded by a `-respondsToSelector:` check for `-setIsSingleLineDocument:` (the 
legacy name on
private text input traits) instead of `-setSingleLineDocument:` (the new 
property name on the
extended traits).

Fix the test by fixing `-_updateTextInputTraits:`.

• KeyboardInputTests.EditableWebViewRequiresKeyboardWhenFirstResponder

This test failure is due to the fact that, for a fully-editable web view (i.e. 
if the embedder sets
`-[WKWebView _editable]` to `YES`), `-_requiresKeyboardWhenFirstResponder` now 
returns `YES` instead
of `NO` when focusing a `readonly` text field.

Address this and restore shipping behavior by only reverting to the superclass 
implementation in the
case where the web view is not fully editable.

* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _requiresKeyboardWhenFirstResponder]):
(-[WKContentView _updateTextInputTraits:]):
* Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(checkRichTextTypePrecedesPlainTextType):

Canonical link: https://commits.webkit.org/272638@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to