Summary: | Add SwiftUI MiniBrowser | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Adam Roben (:aroben) <aroben> | ||||||||
Component: | Tools / Tests | Assignee: | Adam Roben (:aroben) <aroben> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | dino, james.savage, mjs, sam, thorton, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Created attachment 412765 [details]
Patch
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 (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. Created attachment 413082 [details]
Patch for landing
Committed r269326: <https://trac.webkit.org/changeset/269326> All reviewed patches have been landed. Closing bug and clearing flags on attachment 413082 [details]. |
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.