Bug 258068 - transient activation duration of Clipboard.readText is not 5 secs
Summary: transient activation duration of Clipboard.readText is not 5 secs
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: iPhone / iPad iOS 16
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-06-14 02:15 PDT by Wen Huang
Modified: 2023-06-21 02:16 PDT (History)
3 users (show)

See Also:


Attachments
iOS Safari log of the use case in description (4.50 KB, application/octet-stream)
2023-06-14 02:15 PDT, Wen Huang
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wen Huang 2023-06-14 02:15:37 PDT
Created attachment 466690 [details]
iOS Safari log of the use case in description

Use Case: During our testing of the Clipboard.readText WebAPI on iOS Safari with TouchEnd events, we observed that the Promise would be rejected by iOS Safari if the duration between the TouchStart and TouchEnd events exceeded approximately 750ms.

According to a relevant discussion on the W3C Github thread, the WebKit team has indicated that they will consider increasing the transient activation duration to 5 seconds.
- https://github.com/w3c/clipboard-apis/issues/75#issuecomment-1125155111

There is a related WebKit bug that has been closed, which addresses increasing the transient activation duration to 5 seconds.
- https://bugs.webkit.org/show_bug.cgi?id=239832 - increase transient activation duration to 5s

Based on our testing of the UserActivation WebAPI on iOS 16.4, which is the version that officially supports this API, we observed that the UserActivation.isActive sometimes would be false in the above use case, and event it sometimes would be true, the Promise from Clipboard.readText was still being rejected.

Considering the validity of the 5-second fix, shouldn't the Clipboard.readText WebAPI set isActive to true when the last user activation has not expired within 5 seconds? 

Refer to the relevant section of the HTML specification for more details on transient activation: 
- https://html.spec.whatwg.org/multipage/interaction.html#transient-activation
- "The transient activation state is considered expired if it becomes false because the transient activation duration time has elapsed since the last user activation. Note that it can become false even before the expiry time through an activation consumption."

I have attached the log from the ground test for checking the Clipboard API on iOS 16.4.
Comment 1 Radar WebKit Bug Importer 2023-06-21 02:16:14 PDT
<rdar://problem/111089598>