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

Unified Diff: LayoutTests/animations/interpolation/viewport-unit-interpolation.html

Issue 228063006: Remove special cases for viewport units, and add tests for viewport units in calc(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Convert to interpolation test. Created 6 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
« no previous file with comments | « no previous file | LayoutTests/animations/interpolation/viewport-unit-interpolation-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/animations/interpolation/viewport-unit-interpolation.html
diff --git a/LayoutTests/animations/interpolation/viewport-unit-interpolation.html b/LayoutTests/animations/interpolation/viewport-unit-interpolation.html
new file mode 100644
index 0000000000000000000000000000000000000000..ea03961db48b2023ee19ad5d4ca4cfc56a5ab7be
--- /dev/null
+++ b/LayoutTests/animations/interpolation/viewport-unit-interpolation.html
@@ -0,0 +1,43 @@
+<!doctype html>
+<style>
+
+.target {
+ font-size: 16px;
+ width: 60px;
+ height: 60px;
+ display: inline-block;
+ border: 2px solid black;
+ margin-right: 2px;
+}
+.replica {
+ background-color: green;
+ margin-right: 15px;
+}
+
+</style>
+<body>
+<script src="resources/interpolation-test.js"></script>
+<script>
+
+function vw(x) {
+ return (x * window.innerWidth / 100);
+}
+
+function calc(x) {
+ return Math.max(16 + (vw(10) - 16) * x, 0).toFixed(2) + "px";
+}
+
+assertInterpolation({
+ property: 'width',
+ from: '1em',
+ to: '10vw'
+}, [
+ {at: -0.3, is: calc(-0.3)},
+ {at: 0, is: calc(0)},
+ {at: 0.3, is: calc(0.3)},
+ {at: 0.6, is: calc(0.6)},
+ {at: 1, is: calc(1)},
+ {at: 1.5, is: calc(1.5)}
+]);
+</script>
+</body>
« no previous file with comments | « no previous file | LayoutTests/animations/interpolation/viewport-unit-interpolation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698