RESOLVED FIXED 218393
Add SwiftUI MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=218393
Summary Add SwiftUI MiniBrowser
Adam Roben (:aroben)
Reported 2020-10-30 10:07:19 PDT
Created attachment 412762 [details] Patch This change provides a SwiftUI MiniBrowser implementation as well as a very preliminary SwiftUI wrapper for WKWebView, originally authored by James Savage. This only exposes a subset of the WKWebView API, and is definitely not production ready yet, but will give us a place to experiment with ways to make WebKit and SwiftUI work together better.
Attachments
Patch (113.75 KB, patch)
2020-10-30 10:07 PDT, Adam Roben (:aroben)
no flags
Patch (113.77 KB, patch)
2020-10-30 10:09 PDT, Adam Roben (:aroben)
no flags
Patch for landing (116.64 KB, patch)
2020-11-03 11:28 PST, Adam Roben (:aroben)
no flags
Adam Roben (:aroben)
Comment 1 2020-10-30 10:09:47 PDT
Tim Horton
Comment 2 2020-10-30 12:18:18 PDT
Comment on attachment 412765 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=412765&action=review I haven't looked deeply at the Swift, at all, but since it's a tool and meant for iteration, I think this is fine. rs=me > Tools/MiniBrowserSwiftUI/Shared/URLField.swift:74 > + #if os(macOS) does Swift not let you outdent these like we usually do? (applies to many places) > Tools/MiniBrowserSwiftUI/Shared/URLField.swift:139 > + // FIXME: In real Safari, this is actually a material not a solid color. Probably OK to elide this
Adam Roben (:aroben)
Comment 3 2020-10-30 12:46:25 PDT
(In reply to Tim Horton from comment #2) Thanks for the review! > > Tools/MiniBrowserSwiftUI/Shared/URLField.swift:74 > > + #if os(macOS) > > does Swift not let you outdent these like we usually do? (applies to many > places) Swift does let you outdent them. Xcode's default is to keep them at the same indentation level, unlike its default for ObjC/C++ code. I did some quick searching around on GitHub and saw a mix of styles, even within a single project. I checked SwiftLint but couldn't find a rule to enforce this either way. I'm fine with outdenting even though it will mean fighting Xcode a little bit. > > Tools/MiniBrowserSwiftUI/Shared/URLField.swift:139 > > + // FIXME: In real Safari, this is actually a material not a solid color. > > Probably OK to elide this Agreed, I'll remove it.
Adam Roben (:aroben)
Comment 4 2020-11-03 11:28:06 PST
Created attachment 413082 [details] Patch for landing
EWS
Comment 5 2020-11-03 12:16:19 PST
Committed r269326: <https://trac.webkit.org/changeset/269326> All reviewed patches have been landed. Closing bug and clearing flags on attachment 413082 [details].
Radar WebKit Bug Importer
Comment 6 2020-11-03 12:17:22 PST
Note You need to log in before you can comment on or make changes to this bug.