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

Unified Diff: third_party/WebKit/Source/core/html/HTMLMarqueeElement.js

Issue 1906463002: Web Animations: Throw TypeErrors for invalid timing parameters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests Created 4 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/html/HTMLMarqueeElement.js
diff --git a/third_party/WebKit/Source/core/html/HTMLMarqueeElement.js b/third_party/WebKit/Source/core/html/HTMLMarqueeElement.js
index 5ae3e64bea5dab39151a4346b0fdc47c246dad9b..e387c671c6e37f998c38b23147b6a86f3ebf6182 100644
--- a/third_party/WebKit/Source/core/html/HTMLMarqueeElement.js
+++ b/third_party/WebKit/Source/core/html/HTMLMarqueeElement.js
@@ -355,11 +355,14 @@ privateScriptController.installClass('HTMLMarqueeElement', function(HTMLMarqueeE
var scrollDelay = this.scrollDelay;
if (scrollDelay < kMinimumScrollDelayMS && !this.trueSpeed)
scrollDelay = kDefaultScrollDelayMS;
+ var duration = 0;
+ if (this.scrollAmount && !isNaN(parameters.distance))
+ duration = parameters.distance * scrollDelay / this.scrollAmount;
var player = this.mover_.animate([
{ transform: parameters.transformBegin },
{ transform: parameters.transformEnd },
], {
- duration: this.scrollAmount == 0 ? 0 : parameters.distance * scrollDelay / this.scrollAmount,
+ duration,
fill: 'forwards',
});
player.marquee_ = this;

Powered by Google App Engine
This is Rietveld 408576698