Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Adding cssposition test. #75

Merged
merged 1 commit into from

2 participants

Matt Kelly Robin Berjon
Matt Kelly

No description provided.

Robin Berjon darobin merged commit dfd98fc into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 10, 2012
  1. Matt Kelly

    Adding cssposition test.

    mattwkelly authored
This page is out of date. Refresh to see the latest.
4 tests/cssposition/config.yml
View
@@ -0,0 +1,4 @@
+---
+ r: 1
+ spec: "http://www.w3.org/TR/CSS21/visuren.html#choose-position"
+ title: "CSS Position Fixed"
1  tests/cssposition/fixture.html
View
@@ -0,0 +1 @@
+<iframe id="cssposition" src="/tests/cssposition/iframe.html"></iframe>
32 tests/cssposition/iframe.html
View
@@ -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>
9 tests/cssposition/test.js
View
@@ -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();
+ });
+ };
+});
Something went wrong with that request. Please try again.