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

Unified Diff: LayoutTests/animations/viewport-unit.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: 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/viewport-unit-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/animations/viewport-unit.html
diff --git a/LayoutTests/animations/viewport-unit.html b/LayoutTests/animations/viewport-unit.html
new file mode 100644
index 0000000000000000000000000000000000000000..8fbe66a0ce10c55c6d84920700cb8ea7ab576dd4
--- /dev/null
+++ b/LayoutTests/animations/viewport-unit.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<style>
+ #test {
+ height: 100px;
+ width: 10%;
+ background-color: green;
+ }
+
+ .animating {
+ animation: resize 1s linear;
+ }
+
+ @keyframes resize {
+ to { width: 80vw; }
+ }
+
+ #result {
+ margin-top: 130px;
+ }
+
+ body { margin: 0; }
+</style>
+<script src="resources/animation-test-helpers.js"></script>
+<script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ // vw: The size of 1vw in pixels.
+ function expectedValues(vw)
+ {
+ return [
+ // [time, element-id, property, expected-value, tolerance]
+ [0.5, "test", "width", Math.round((10 + 70 * 0.5) * vw), 100]
+ ];
+ };
+
+ function setupTest()
+ {
+ var width = document.querySelector("html").clientWidth;
+ var vw = width / 100;
+ document.getElementById('test').className = 'animating';
+ runAnimationTest(expectedValues(vw));
alancutter (OOO until 2018) 2014/04/15 05:34:08 We prefer not to introduce these types of time dep
+ }
+
+ window.addEventListener('load', function() {
+ window.setTimeout(setupTest, 0);
+ }, false);
+</script>
+
+<p>Width should animate from 10% to 80vw.</p>
+<div id="test"></div>
+<div id="result"></div>
« no previous file with comments | « no previous file | LayoutTests/animations/viewport-unit-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698