WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
236254
Permit simultaneous Apple Pay and script injection
https://bugs.webkit.org/show_bug.cgi?id=236254
Summary
Permit simultaneous Apple Pay and script injection
Devin Rousso
Reported
2022-02-07 13:16:14 PST
.
Attachments
Patch
(52.51 KB, patch)
2022-02-07 13:19 PST
,
Devin Rousso
no flags
Details
Formatted Diff
Diff
[fast-cq] Patch
(55.38 KB, patch)
2022-02-08 15:15 PST
,
Devin Rousso
katherine_cheney
: review+
hi
: commit-queue+
Details
Formatted Diff
Diff
[fast-cq] Patch
(55.36 KB, patch)
2022-02-10 11:17 PST
,
Devin Rousso
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Devin Rousso
Comment 1
2022-02-07 13:16:31 PST
<
rdar://problem/87736727
>
Radar WebKit Bug Importer
Comment 2
2022-02-07 13:18:02 PST
<
rdar://problem/88590628
>
Devin Rousso
Comment 3
2022-02-07 13:19:53 PST
Created
attachment 451143
[details]
Patch
Devin Rousso
Comment 4
2022-02-07 13:21:24 PST
<
rdar://problem/87736727
>
Kate Cheney
Comment 5
2022-02-08 13:42:52 PST
Comment on
attachment 451143
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=451143&action=review
code change looks good, only concern is about dropping the weakThis in PaymentCoordinator::canMakePaymentsWithActiveCard
> Source/WebCore/Modules/applepay/PaymentCoordinator.cpp:69 > +bool PaymentCoordinator::canMakePayments(Document&)
Why keep Document around?
> Source/WebCore/Modules/applepay/PaymentCoordinator.cpp:78 > + m_client.canMakePaymentsWithActiveCard(merchantIdentifier, document.domain(), [this, completionHandler = WTFMove(completionHandler)](bool canMakePayments) {
Seems like we shouldn't drop weakThis, unless I'm missing something
> Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h:69 > virtual String userAgentScriptsBlockedErrorMessage() const { return { }; }
I think this can be removed too
> Tools/TestWebKitAPI/Tests/WebKitCocoa/ApplePay.mm:-243 > -TEST(ApplePay, ActiveSessionBlocksUserAgentScripts)
Is there a reason we got rid of the ActiveSession test instead if changing it to ActiveSessionDoesNotBlockUserAgentScripts? Might be useful to include in the ChangeLog if so.
> Tools/TestWebKitAPI/Tests/WebKitCocoa/apple-pay-availability-existing-object.html:17 > + window.wkPaymentRequest ??= new PaymentRequest([applePayMethod()], applePayDetails);
getting fancy with some nullish coalescing operators :P
Devin Rousso
Comment 6
2022-02-08 14:00:10 PST
Comment on
attachment 451143
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=451143&action=review
>> Source/WebCore/Modules/applepay/PaymentCoordinator.cpp:69 >> +bool PaymentCoordinator::canMakePayments(Document&) > > Why keep Document around?
I figured just in case it was needed in the future (just like how `supportsVersion` has it). I'll remove it.
>> Source/WebCore/Modules/applepay/PaymentCoordinator.cpp:78 >> + m_client.canMakePaymentsWithActiveCard(merchantIdentifier, document.domain(), [this, completionHandler = WTFMove(completionHandler)](bool canMakePayments) { > > Seems like we shouldn't drop weakThis, unless I'm missing something
Eh, yeah probably. The only reason we capture `this` is cause `PAYMENT_COORDINATOR_RELEASE_LOG` uses it, and it just logs the raw pointer value (i.e. location). Nothing actually dereferences `this` inside here. But probably couldn't hurt to keep it :)
>> Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h:69 >> virtual String userAgentScriptsBlockedErrorMessage() const { return { }; } > > I think this can be removed too
Oh oops good catch!
>> Tools/TestWebKitAPI/Tests/WebKitCocoa/ApplePay.mm:-243 >> -TEST(ApplePay, ActiveSessionBlocksUserAgentScripts) > > Is there a reason we got rid of the ActiveSession test instead if changing it to ActiveSessionDoesNotBlockUserAgentScripts? Might be useful to include in the ChangeLog if so.
`apple-pay-active-session.html` only simulated that an active session actually took place (via `Internals.prototype.setApplePayIsActive`). The rest of the tests actually create an active session, so there's not really a benefit to keeping it (it would basically just be a copy of the other tests).
>> Tools/TestWebKitAPI/Tests/WebKitCocoa/apple-pay-availability-existing-object.html:17 >> + window.wkPaymentRequest ??= new PaymentRequest([applePayMethod()], applePayDetails); > > getting fancy with some nullish coalescing operators :P
(☞゚ヮ゚)☞
Devin Rousso
Comment 7
2022-02-08 15:15:18 PST
Created
attachment 451312
[details]
[fast-cq] Patch
Devin Rousso
Comment 8
2022-02-10 11:17:05 PST
Created
attachment 451580
[details]
[fast-cq] Patch
EWS
Comment 9
2022-02-10 14:24:37 PST
Committed
r289578
(
247095@main
): <
https://commits.webkit.org/247095@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 451580
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug