Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: dc66f2d091a96e52e1c8984c87ffedbd3f3bd4a0
      
https://github.com/WebKit/WebKit/commit/dc66f2d091a96e52e1c8984c87ffedbd3f3bd4a0
  Author: Sihui Liu <[email protected]>
  Date:   2024-10-09 (Wed, 09 Oct 2024)

  Changed paths:
    M Source/WebKit/UIProcess/API/APIPageConfiguration.cpp
    M Source/WebKit/UIProcess/API/APIPageConfiguration.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKPreferences.mm

  Log Message:
  -----------
  ApplePayEnabled set in WKPreferences is ignored
https://bugs.webkit.org/show_bug.cgi?id=281117
rdar://problem/137565662

Reviewed by Ryosuke Niwa.

Both PageConfiguration and WebPreferences have data member ApplePayEnabled. In 
existing implementation, we always
override the WebPreferences value with PageConfiguration value (see [WKWebVeiw 
_setupPageConfiguration:withPool:]), i.e.
the actual ApplePayEnabled value being used is always the value in the 
PageConfiguration. However, it's possible that
client uses WKWebPreferences SPI to set ApplePayEnabled, where we should 
actually respect that value instead of the
default value in PageConfiguration.

To fix this, we change the ApplePayEnabled in PageConfiguration to be optional. 
If client sets the value using
WKWebViewConfiguration SPI, then we would respect this value; otherwise we 
would just use the value in WebPreferences
without overriding it.

Update API test WKPreferencesPrivate.DisableRichJavaScriptFeatures to cover 
Apple Pay JS API; the test would fail if we
don't make the change (as the flag value cannot be changed via WKWebPreferences 
SPI).

* Source/WebKit/UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::applePayEnabled const):
(API::PageConfiguration::setApplePayEnabled):
* Source/WebKit/UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::applePayEnabled const): Deleted.
(API::PageConfiguration::setApplePayEnabled): Deleted.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKPreferences.mm:
(DisableRichJavaScriptFeatures)):

Canonical link: https://commits.webkit.org/284921@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to