Skip to content

Commit

Permalink
makeOpportunisticTaskDeferralScopeIfPossible has a wrong early exit l…
Browse files Browse the repository at this point in the history
…ogic

https://bugs.webkit.org/show_bug.cgi?id=259857

Reviewed by Yusuke Suzuki and Wenson Hsieh.

We want to defer opportunistic task whenever we have a timer firing in the next 1ms,
not whenever we have a timer firing in 1ms or later.

* Source/WebCore/page/DOMTimer.cpp:
(WebCore::DOMTimer::makeOpportunisticTaskDeferralScopeIfPossible):

Canonical link: https://commits.webkit.org/266621@main
  • Loading branch information
rniwa committed Aug 6, 2023
1 parent a68a8b8 commit 38e5de2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/WebCore/page/DOMTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ std::optional<MonotonicTime> DOMTimer::alignedFireTime(MonotonicTime fireTime) c

void DOMTimer::makeOpportunisticTaskDeferralScopeIfPossible(ScriptExecutionContext& context)
{
if (!m_oneShot || m_currentTimerInterval <= 1_ms) {
if (!m_oneShot || m_currentTimerInterval > 1_ms) {
// FIXME: This should eventually account for repeating timers and one-shot timers that were
// previously scheduled, and are about to fire.
return;
Expand Down

0 comments on commit 38e5de2

Please sign in to comment.