[Webkit-unassigned] [Bug 221656] New: WKWebView needs to provide -[WebView applyStyle:]
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Feb 9 23:22:08 PST 2021
https://bugs.webkit.org/show_bug.cgi?id=221656
Bug ID: 221656
Summary: WKWebView needs to provide -[WebView applyStyle:]
Product: WebKit
Version: Safari 14
Hardware: Mac (Apple Silicon)
OS: macOS 11
Status: NEW
Severity: Blocker
Priority: P2
Component: WebKit API
Assignee: webkit-unassigned at lists.webkit.org
Reporter: jonathan at tumult.com
WKWebView is incomplete as a replacement for WebView. It is missing an -applyStyle, which would apply arbitrary CSS to the current selection.
There is no JavaScript-land equivalent for this API, and the closest execCommand() can only apply small portions of what it provides. I have not seen 3rd party frameworks which allow any CSS to apply to a selection either (if you know of one, let me know!).
While it is theoretically possible for this to be written in JavaScript, the logic in handling nodes/elements and existing styles is quite complex and should be handled by the framework at some level. A JavaScript API would be entirely okay for this. Beyond that, it already exists, so should be easier for you to take your existing code and port to WKWebView/JavaScript.
applyStyle is a powerful API for editing content. I'm not sure how applications like Mail's editor could adopt WKWebView without it.
I am surprised WebView was deprecated without providing this.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210210/07b0e044/attachment.htm>
More information about the webkit-unassigned
mailing list