Bug 229132 - Web Share CanShare() should be called after transient activation check
Summary: Web Share CanShare() should be called after transient activation check
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari 14
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-08-16 02:10 PDT by Marcos Caceres
Modified: 2021-08-16 21:33 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.40 KB, patch)
2021-08-16 17:32 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos Caceres 2021-08-16 02:10:42 PDT
At the moment, Navigator::Share() calls into the CanShare() checks before checking if the page has transient activation. 

According to the spec [1] - step 4, the transient activation check, and consumption of the transient activation, should happen before calling into CanShare().

[1] https://w3c.github.io/web-share/#share-method

That's causing the following test to fail:
https://wpt.live/web-share/share-consume-activation.https.html

PS: Can we have a "Web Share" component to file bugs against? 🤞
Comment 1 Devin Rousso 2021-08-16 17:32:26 PDT
Created attachment 435648 [details]
Patch
Comment 2 Marcos Caceres 2021-08-16 21:03:42 PDT
If it's not too late, this test will also pass now:

https://wpt.live/web-share/share-without-user-gesture.https.html

It's similar to the other test, but the other tests actually checks if the activation was consumed.
Comment 3 EWS 2021-08-16 21:32:32 PDT
Committed r281126 (240580@main): <https://commits.webkit.org/240580@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 435648 [details].
Comment 4 Radar WebKit Bug Importer 2021-08-16 21:33:24 PDT
<rdar://problem/82012234>