Repository navigation
Move web views onto PureSwift/WebKit - #20
Merged
Merged
Conversation
WPEWebKit for LinuxWebKit, CacaoWebKit for the player on Linux, and WEBKIT_PATH for a local checkout, which Scripts/docker.sh mounts.
LinuxWebContent makes PureSwift/WebKit's page and relays its delegate to the guest's. WPE.swift goes: the engine runs on the main loop when it says its pages have work, after the guest's call returns.
Its input replaces the drag gesture and the keysym table: the wheel, touches and every button now reach the page.
What moved there is tested there. Here: a page found by its identifier draws, and a WebView node attaches the page it names and lets it go.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves web views onto PureSwift/WebKit: its
WPEWebKitdrives the engine, and itsCacaoWebKitshows the pages. That's phase 1 of PureSwift/WebKit's plan.Builds on PureSwift/WebKit#7 (
WebView(content:)), now merged into WebKit'smaster, which this depends on.LinuxWebKit
LinuxWebContentmakes aWPEWebContentand relays its delegate to the guest's. The delegate methods and their numbers (WebNavigationKind,WebError.Code) are already the contract's.network, before anything starts, with or without WPE.loadResourcestill loads from the bundle'sresources/.WPE.swiftgoes, along with the GError mapping, the policy decisions, the SHM backend and the event structs, which PureSwift/WebKit now has and tests.WPEEngine.onReadypostsWPEEngine.pump()to theMainLoop, so nothing polls. The 8 ms GLib timer is gone. A guest's call schedules a pump for the loop's next turn, so the guest doesn't hear from a page while it's still calling it.HostLog, and the app'snetworkcapability setsWPEEngine.isNetworkAllowed.The player
HostWebViewis nowCacaoWebKit.WebView(content:)over the page its node names. Frames go to Cacao'sExternalSurfaceas BGRA, with one copy and no conversion to RGBA. The view's input replaces the drag gesture and the keysym table: the wheel, touch, every button, typed text with the keyboard's layout, and focus now reach the page.Package
WPEWebKitforLinuxWebKit, andCacaoWebKitfor the player on Linux.WEBKIT_PATHpoints at a local checkout, andScripts/docker.shmounts it, as it does forAPPRUNTIME_PATHandCACAO_PATH.Docs
§8 of the plan describes the new layering and drops the wheel, touch and buttons from "Not yet". The readme's module table and its section on local checkouts are updated.
Testing
On aarch64 Debian 13, Swift 6.4.2, WPE 2.48.3 (the development image), with
WEBKIT_PATHat PureSwift/WebKit#7's branch, as merged:swift build --build-testssucceeds, and every test target passes.WebContentTests(9 tests, all run in WPE) and the newRenderingTests.aWebViewNodeShowsItsPagepassed three runs in a row.WebViewrender node attaches the page it names at its size, and detaches it when the node goes, leaving the page alive.ExampleWebunderScripts/run-app.sh, including scrolling with the wheel. Bundling a guest needs the wasm Swift SDK, which the image doesn't have.