Repository navigation
[WebKit] Preserve native defaults for unhandled policy events. Fixes #4214 - #26897
rolfbjarne wants to merge 1 commit into
Conversation
Mark the three WebPolicyDelegate decision callbacks with NoDefaultValue so the generated event delegate only responds to selectors with subscribed handlers. This lets WebKit apply its native policy when, for example, navigation is handled but MIME-type decisions are not, instead of leaving the load unresolved. Add a macOS regression test covering each selector as handlers are added and removed, while preserving the ordinary policy-failure notification. Fixes #4214 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 94248f0f-e005-4288-8334-d17603eeaf29
There was a problem hiding this comment.
🔵 Needs a closer look
Native delegate behavior still needs confirmation from macOS build and regression test results.
0 open findings
What changed in this PR
Preserves WebKit’s native policy defaults when corresponding managed events have no subscribers, addressing #4214.
Changes:
- Adds
NoDefaultValueto all three policy decision callbacks. - Adds macOS regression coverage for selector availability as handlers change, while retaining failure notifications.
| File | Description |
|---|---|
| tests/monotouch-test/WebKit/WebViewTest.cs | Tests selector availability when handlers are added and removed. |
| src/webkit.cs | Makes policy decision selectors conditional on event subscribers. |
🧠 Review effort: Balanced
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🔥 [CI Build #4b9b462] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 2 tests failed, 219 tests passed. Failures❌ monotouch tests (iOS)2 tests failed, 18 tests passed.Failed tests
Html Report (VSDrops) Download Successes✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Subscribing to a WebView policy event creates a generated delegate that also advertises unhandled decision callbacks. WebKit then calls those no-op implementations instead of applying its native defaults, leaving page loads unresolved when navigation is handled but MIME-type decisions are not.
Mark all three WebPolicyDelegate decision callbacks with NoDefaultValue so the generated delegate only responds to their selectors while the corresponding event has subscribers. Add a macOS regression test covering selector availability as handlers are added and removed, while preserving the ordinary policy-failure notification.
Fixes #4214
🤖 Pull request created by Copilot