Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Adding cssposition test. #75

Merged
merged 1 commit into from

2 participants

@mattwkelly

No description provided.

@darobin darobin merged commit dfd98fc into coremob:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 10, 2012
  1. @mattwkelly

    Adding cssposition test.

    mattwkelly authored
This page is out of date. Refresh to see the latest.
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();
+ });
+ };
+});
Something went wrong with that request. Please try again.