Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #75 from facebook/cssposition

Adding cssposition test.
NOTE: much more is needed
  • Loading branch information...
commit dfd98fc53e335c38af0be1ca2024bf71e0a64eb0 2 parents cd9f49b + 731dfc9
@darobin darobin authored
View
4 tests/cssposition/config.yml
@@ -0,0 +1,4 @@
+---
+ r: 1
+ spec: "http://www.w3.org/TR/CSS21/visuren.html#choose-position"
+ title: "CSS Position Fixed"
View
1  tests/cssposition/fixture.html
@@ -0,0 +1 @@
+<iframe id="cssposition" src="/tests/cssposition/iframe.html"></iframe>
View
32 tests/cssposition/iframe.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <!--
+ Android requires this to work correctly,
+ but still doesn't report this test correctly
+ -->
+ <meta name="viewport" content="width=device-width, user-scalable=no">
+</head>
+<body style="height:10000px">
+<script>
+scrollTo(0,0);
+
+window.setTimeout(function() {
+ scrollTo(1000, 1000);
+
+ // Undectable, so we have to cheat a little.
+ // This will be replaced when a more
+ // thorough test is completed
+ var isFixed,
+ iOS = /iPad/i.test(navigator.userAgent) ||
+ /iPod/i.test(navigator.userAgent) ||
+ /iPhone/i.test(navigator.userAgent);
+
+ // A supporting result will be 1000
+ isFixed = document.documentElement.scrollTop || document.body.scrollTop || iOS;
+
+ top.postMessage( isFixed, "*" );
+}, 100);
+</script>
+</body>
+</html>
View
9 tests/cssposition/test.js
@@ -0,0 +1,9 @@
+asyncTest("CSS Fixed Position", function( async ) {
+ window.onmessage = function( event ) {
+ async.step(function() {
+ assert( event.data, "Fixed Position supported" );
+ window.onmessage = null;
+ async.done();
+ });
+ };
+});
Please sign in to comment.
Something went wrong with that request. Please try again.