Bug 191379 - WKWebView doesn’t respond to -copyFont: and -pasteFont:
Summary: WKWebView doesn’t respond to -copyFont: and -pasteFont:
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on: 233938 233939 233940 234065
Blocks: 234185
  Show dependency treegraph
 
Reported: 2018-11-07 09:50 PST by mitz
Modified: 2021-12-10 18:08 PST (History)
13 users (show)

See Also:


Attachments
Patch (34.93 KB, patch)
2021-12-07 15:25 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (34.92 KB, patch)
2021-12-07 17:01 PST, Devin Rousso
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (34.95 KB, patch)
2021-12-08 20:50 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (34.94 KB, patch)
2021-12-10 13:21 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (34.29 KB, patch)
2021-12-10 16:07 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (34.29 KB, patch)
2021-12-10 16:24 PST, Devin Rousso
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-11-07 09:50:52 PST
WKWebView doesn’t respond to -copyFont: and -pasteFont:
Comment 1 mitz 2018-11-07 09:59:05 PST
<rdar://problem/45878659>.
Comment 2 Devin Rousso 2021-12-07 15:25:29 PST
Created attachment 446245 [details]
Patch
Comment 3 Devin Rousso 2021-12-07 17:01:05 PST
Created attachment 446257 [details]
Patch

rebase
Comment 4 Devin Rousso 2021-12-08 20:50:41 PST
Created attachment 446498 [details]
Patch
Comment 5 Devin Rousso 2021-12-10 13:21:46 PST
Created attachment 446795 [details]
Patch
Comment 6 Wenson Hsieh 2021-12-10 14:46:48 PST
Comment on attachment 446795 [details]
Patch

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

r=mews

> Source/WebCore/editing/mac/EditorMac.mm:109
> +void Editor::platformCopyFont()

We should file a followup to unify this code with the WebKitLegacy implementation in WebHTMLView.

> Source/WebCore/editing/mac/EditorMac.mm:125
> +void Editor::platformPasteFont()

Same, for this.

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:4174
> +        // FIXME: Does iOS have a different pasteboard for fonts?

iOS does not support a dedicated font pasteboard, no. Falling back to the general pasteboard is probably okay here (and we can remove the FIXME).

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:4186
> +        // FIXME: Does iOS have a different pasteboard for fonts?

Ditto.

> Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:1555
> +        // FIXME: Does iOS have a different pasteboard for fonts?

Ditto.

> Source/WebKit/UIProcess/mac/WebPageProxyMac.mm:663
> +        grantAccessToCurrentPasteboardData(NSFontPboard);

Can you use `NSPasteboardNameFont` instead of suppressing deprecation warnings?
Comment 7 Wenson Hsieh 2021-12-10 14:48:00 PST
Comment on attachment 446795 [details]
Patch

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

> LayoutTests/editing/execCommand/mac/copyFont-pasteFont-expected.html:4
> +#copy {

Nit - indentation is a bit off in a few places in this file.

> LayoutTests/editing/execCommand/mac/copyFont-pasteFont.html:3
> +    <script src=../../editing.js></script>

Ditto, re: indentation.
Comment 8 Devin Rousso 2021-12-10 16:04:30 PST
Comment on attachment 446795 [details]
Patch

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

>> LayoutTests/editing/execCommand/mac/copyFont-pasteFont-expected.html:4
>> +#copy {
> 
> Nit - indentation is a bit off in a few places in this file.

Oh lol that's just my personal preference.  I find that indenting inline CSS/JS to match the indentation of the surrounding DOM is odd because if you then did `style.textContent` there'd be all this extra indentation for seemingly no reason.
Comment 9 Devin Rousso 2021-12-10 16:07:37 PST
Created attachment 446837 [details]
Patch
Comment 10 Devin Rousso 2021-12-10 16:24:28 PST
Created attachment 446842 [details]
Patch
Comment 11 EWS 2021-12-10 18:08:09 PST
Committed r286894 (245122@main): <https://commits.webkit.org/245122@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 446842 [details].