[webkit-changes] [WebKit/WebKit] e49305: REGRESSION(266828 at main): Nested setTimeout not bei...

Ryosuke Niwa noreply at github.com
Tue Sep 26 10:27:01 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e49305511b1aee7144154ad1530454b0970ac515
      https://github.com/WebKit/WebKit/commit/e49305511b1aee7144154ad1530454b0970ac515
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2023-09-26 (Tue, 26 Sep 2023)

  Changed paths:
    A LayoutTests/fast/dom/timer-throttling-hidden-page-2-expected.txt
    A LayoutTests/fast/dom/timer-throttling-hidden-page-2.html
    M LayoutTests/platform/ios/TestExpectations
    M LayoutTests/platform/wpe/TestExpectations
    M Source/WebCore/dom/EventLoop.cpp
    M Source/WebCore/dom/EventLoop.h
    M Source/WebCore/page/DOMTimer.cpp

  Log Message:
  -----------
  REGRESSION(266828 at main): Nested setTimeout not being throttled in the background
https://bugs.webkit.org/show_bug.cgi?id=262086
<rdar://115902836>

Reviewed by Chris Dumez.

The bug was caused by TimerAlignment and hasReachedMaxNestingLevel state getting set after
the timer had already been scheduled. We need to update these states before we schedule it.

To do this, new variants of scheduleTask and scheduleRepeatingTask which takes TimerAlignment
and hasReachedMaxNestingLevel boolean as arguments are added and deployed them in DOMTimer.

* LayoutTests/fast/dom/timer-throttling-hidden-page-2-expected.txt: Added.
* LayoutTests/fast/dom/timer-throttling-hidden-page-2.html: Added.
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/wpe/TestExpectations:
* Source/WebCore/dom/EventLoop.cpp:
(WebCore::EventLoop::scheduleTask):
(WebCore::EventLoop::scheduleRepeatingTask):
(WebCore::EventLoopTaskGroup::scheduleTask):
(WebCore::EventLoopTaskGroup::scheduleRepeatingTask):
(WebCore::EventLoopTaskGroup::setTimerAlignment): Deleted.
* Source/WebCore/dom/EventLoop.h:
* Source/WebCore/page/DOMTimer.cpp:
(WebCore::DOMTimer::DOMTimer):

Canonical link: https://commits.webkit.org/268460@main




More information about the webkit-changes mailing list