mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +00:00
LibWeb: Increase the transient activation duration from 5ms to 5s
It seems we were errantly mixing seconds and milliseconds in this transient activation timeout. Increase it to 5 seconds, and be explicit about its type - DOMHighResTimeStamp is by definition milliseconds.
This commit is contained in:
parent
83128d093e
commit
8d7a5afe58
1 changed files with 2 additions and 2 deletions
|
@ -604,7 +604,7 @@ bool Window::has_transient_activation() const
|
||||||
{
|
{
|
||||||
// The transient activation duration is expected be at most a few seconds, so that the user can possibly
|
// The transient activation duration is expected be at most a few seconds, so that the user can possibly
|
||||||
// perceive the link between an interaction with the page and the page calling the activation-gated API.
|
// perceive the link between an interaction with the page and the page calling the activation-gated API.
|
||||||
auto transient_activation_duration = 5;
|
static constexpr HighResolutionTime::DOMHighResTimeStamp transient_activation_duration_ms = 5000;
|
||||||
|
|
||||||
// AD-HOC: Due to resource limitations on CI, we cannot rely on the time between the activation timestamp and the
|
// AD-HOC: Due to resource limitations on CI, we cannot rely on the time between the activation timestamp and the
|
||||||
// transient activation timeout being predictable. So we allow tests to indicate when they want the next
|
// transient activation timeout being predictable. So we allow tests to indicate when they want the next
|
||||||
|
@ -621,7 +621,7 @@ bool Window::has_transient_activation() const
|
||||||
// is greater than or equal to the last activation timestamp in W
|
// is greater than or equal to the last activation timestamp in W
|
||||||
if (current_time >= m_last_activation_timestamp) {
|
if (current_time >= m_last_activation_timestamp) {
|
||||||
// and less than the last activation timestamp in W plus the transient activation duration
|
// and less than the last activation timestamp in W plus the transient activation duration
|
||||||
if (current_time < m_last_activation_timestamp + transient_activation_duration) {
|
if (current_time < m_last_activation_timestamp + transient_activation_duration_ms) {
|
||||||
// then W is said to have transient activation.
|
// then W is said to have transient activation.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue