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

Unified Diff: third_party/WebKit/LayoutTests/animations/big-number-clamping.html

Issue 1457623003: Clamp animated numbers according to ComputedStyle data type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: var Created 5 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/NumberPropertyFunctions.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/animations/big-number-clamping.html
diff --git a/third_party/WebKit/LayoutTests/animations/big-number-clamping.html b/third_party/WebKit/LayoutTests/animations/big-number-clamping.html
new file mode 100644
index 0000000000000000000000000000000000000000..3830f90bf2c55dda69e2ed2232c46e0f1ac9e240
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/animations/big-number-clamping.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<style>
+div {
+ /* This is required so that z-index doesn't compute as auto. */
+ position: relative;
+}
+</style>
+
+<div id="animated"></div>
+<div id="reference"></div>
+
+<script>
+var numberProperties = [
dstockwell 2015/11/18 23:52:00 I wonder if there's a way to test all properties.
alancutter (OOO until 2018) 2015/11/19 00:10:07 CSSOM2 would be good for this case.
+ 'flex-grow',
+ 'flex-shrink',
+ 'font-size-adjust',
+ 'line-height',
+ 'orphans',
+ 'stroke-miterlimit',
+ 'widows',
+ 'z-index',
+];
+
+var bigNumber = 1e20;
+
+for (var property of numberProperties) {
+ test(() => {
+ animated.animate({[property]: bigNumber}, {fill: 'forwards'});
+ reference.style[property] = bigNumber;
+ assert_equals(getComputedStyle(animated)[property], getComputedStyle(reference)[property]);
+ }, `Animations on ${property} should clamp identically to setting inline style`);
+}
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/NumberPropertyFunctions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698