Bug 229132

Summary: Web Share CanShare() should be called after transient activation check
Product: WebKit Reporter: Marcos Caceres <marcos>
Component: New BugsAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, hi, megan_gardner, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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>