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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/animations/interpolation/viewport-unit-interpolation-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <style>
3
4 .target {
5 font-size: 16px;
6 width: 60px;
7 height: 60px;
8 display: inline-block;
9 border: 2px solid black;
10 margin-right: 2px;
11 }
12 .replica {
13 background-color: green;
14 margin-right: 15px;
15 }
16
17 </style>
18 <body>
19 <script src="resources/interpolation-test.js"></script>
20 <script>
21
22 function vw(x) {
23 return (x * window.innerWidth / 100);
24 }
25
26 function calc(x) {
27 return Math.max(16 + (vw(10) - 16) * x, 0).toFixed(2) + "px";
28 }
29
30 assertInterpolation({
31 property: 'width',
32 from: '1em',
33 to: '10vw'
34 }, [
35 {at: -0.3, is: calc(-0.3)},
36 {at: 0, is: calc(0)},
37 {at: 0.3, is: calc(0.3)},
38 {at: 0.6, is: calc(0.6)},
39 {at: 1, is: calc(1)},
40 {at: 1.5, is: calc(1.5)}
41 ]);
42 </script>
43 </body>
OLDNEW
« 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