CocoaInt WKWebView support on macOS
Original Reporter info from Mantis: zpeterson @boramis
-
Reporter name: Zoë Peterson
Original Reporter info from Mantis: zpeterson @boramis
- Reporter name: Zoë Peterson
Description:
According to Apple's documentation, WKWebView was introduced in macOS 10.10, and the current FPC Cocoa header translations are based on that version, but the WebKit definitions are all disabled on macOS (and broken on iOS?).
The attached patch makes it work, though someone who knows the header parser better than me should fix it properly.
There's 3 issues I see:
-
WKFoundation.inc has an "{$if defined(TARGET_OS_IPHONE)}" block which disables it for macOS.
-
All of the .inc files use "{
if defined(WK_API_ENABLED)}" to check whether they should include their contents, but since WK_API_ENABLED is a const rather than a DEFINEd value, they always fail. Either the checks need to be switched to {
if declared(WK_API_ENABLED)} or WK_API_ENABLED needs to be $DEFINEd too. I chose the latter to keep the patch small. Might be worth removing the existing const as well. -
WKWebView.inc has a weird garbage {
if} block (previously mentioned in issue #35995) which should be corrected, but also collapses down to {
if defined(TARGET_OS_IPHONE)} so it's likewise unnecessarily disabled on macOS.
Mantis conversion info:
- Mantis ID: 37441
- Version: 3.3.1