Bug 190015 - [iOS] WKWebView callout bar is missing Change Writing Direction item
Summary: [iOS] WKWebView callout bar is missing Change Writing Direction item
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-09-26 15:26 PDT by mitz
Modified: 2019-02-15 13:36 PST (History)
4 users (show)

See Also:


Attachments
Patch (14.61 KB, patch)
2019-02-15 11:45 PST, Wenson Hsieh
thorton: review+
Details | Formatted Diff | Diff
Patch for landing (14.84 KB, patch)
2019-02-15 12:44 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2018-09-26 15:26:46 PDT
When the insertion point, or a selection, is in editable text, and the paragraph writing direction is left-to-right and/or a left-to-right keyboard is active, then the callout bar should contain one of the actions {makeTextWritingDirectionRightToLeft:, makeTextWritingDirectionLeftToRight:} (depending on which is the current direction). This works in UIWebView but apparently not implemented at all in WKWebView.
Comment 1 mitz 2018-09-26 15:28:09 PDT
<rdar://problem/44810366>
Comment 2 mitz 2018-09-26 15:32:45 PDT
(In reply to mitz from comment #0)
> and/or a left-to-right keyboard is active

This should have said “right-to-left keyboard”.
Comment 3 Wenson Hsieh 2019-02-15 11:45:35 PST
Created attachment 362138 [details]
Patch
Comment 4 Tim Horton 2019-02-15 11:54:00 PST
Comment on attachment 362138 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=362138&action=review

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2827
> +        if (baseWritingDirection == WebCore::WritingDirection::LeftToRight && !UIKeyboardIsRightToLeftInputModeActive())

This confused me, you explained it ("active" should read "available" or something), it might need a comment.
Comment 5 Wenson Hsieh 2019-02-15 11:54:30 PST
(In reply to Tim Horton from comment #4)
> Comment on attachment 362138 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=362138&action=review
> 
> > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2827
> > +        if (baseWritingDirection == WebCore::WritingDirection::LeftToRight && !UIKeyboardIsRightToLeftInputModeActive())
> 
> This confused me, you explained it ("active" should read "available" or
> something), it might need a comment.

👍
Comment 6 Wenson Hsieh 2019-02-15 12:44:36 PST
Created attachment 362147 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2019-02-15 13:35:09 PST
The commit-queue encountered the following flaky tests while processing attachment 362147 [details]:

media/modern-media-controls/compact-media-controls/compact-media-controls-layout.html bug 194720 (author: graouts@apple.com)
The commit-queue is continuing to process your patch.
Comment 8 WebKit Commit Bot 2019-02-15 13:35:57 PST
Comment on attachment 362147 [details]
Patch for landing

Clearing flags on attachment: 362147

Committed r241614: <https://trac.webkit.org/changeset/241614>