Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Unified Diff: third_party/WebKit/Source/core/frame/DOMTimer.cpp

Issue 2738773004: No longer clamp setTimeout(..., 0) to 1ms. (Closed)
Patch Set: update webgl2 conformance expectations as well Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/DOMTimer.cpp
diff --git a/third_party/WebKit/Source/core/frame/DOMTimer.cpp b/third_party/WebKit/Source/core/frame/DOMTimer.cpp
index 9451ccba951849d2fe568875107a722a54d2ab29..43075460836a51f3fc8153a2a76e57c349968df6 100644
--- a/third_party/WebKit/Source/core/frame/DOMTimer.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMTimer.cpp
@@ -88,8 +88,10 @@ DOMTimer::DOMTimer(ExecutionContext* context,
user_gesture_token_ = UserGestureIndicator::CurrentToken();
}
+ // TODO(delphick): Remove the single shot guard here so that this affects
+ // setInterval as well.
double interval_milliseconds =
- std::max(kOneMillisecond, interval * kOneMillisecond);
+ std::max(single_shot ? 0.0 : kOneMillisecond, interval * kOneMillisecond);
if (interval_milliseconds < kMinimumInterval &&
nesting_level_ >= kMaxTimerNestingLevel)
interval_milliseconds = kMinimumInterval;

Powered by Google App Engine
This is Rietveld 408576698