From 1bef4232bfa8dc340d4b937b977a1ed734351642 Mon Sep 17 00:00:00 2001 From: Matt Kelly Date: Mon, 9 Apr 2012 17:05:10 -0700 Subject: [PATCH] Adding css2-1selectors test. --- tests/css2-1selectors/config.yml | 4 +++ tests/css2-1selectors/fixture.html | 1 + tests/css2-1selectors/iframe.html | 53 ++++++++++++++++++++++++++++++ tests/css2-1selectors/test.js | 33 +++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 tests/css2-1selectors/config.yml create mode 100644 tests/css2-1selectors/fixture.html create mode 100644 tests/css2-1selectors/iframe.html create mode 100644 tests/css2-1selectors/test.js diff --git a/tests/css2-1selectors/config.yml b/tests/css2-1selectors/config.yml new file mode 100644 index 0000000..e503dea --- /dev/null +++ b/tests/css2-1selectors/config.yml @@ -0,0 +1,4 @@ +--- + r: 0 + spec: "http://www.w3.org/TR/CSS2/selector.html" + title: "CSS 2.1" diff --git a/tests/css2-1selectors/fixture.html b/tests/css2-1selectors/fixture.html new file mode 100644 index 0000000..8dfb1a3 --- /dev/null +++ b/tests/css2-1selectors/fixture.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/css2-1selectors/iframe.html b/tests/css2-1selectors/iframe.html new file mode 100644 index 0000000..28c4a7d --- /dev/null +++ b/tests/css2-1selectors/iframe.html @@ -0,0 +1,53 @@ + + + + css2-1selectors + + + +
+
+
+
+

+ + + + diff --git a/tests/css2-1selectors/test.js b/tests/css2-1selectors/test.js new file mode 100644 index 0000000..980ad12 --- /dev/null +++ b/tests/css2-1selectors/test.js @@ -0,0 +1,33 @@ +// TODO: Rewrite to work correctly in opera +// @Mike, @Divya: I promise this is only temporary +if ( !window.opera ) { + + asyncTest("CSS 2.1 Selectors", function( async ) { + var iframe = document.getElementById("css2-1selectors").contentWindow; + + window.onmessage = function( event ) { + async.step(function() { + assert( event.data === "truetruetruetrue", + "CSS 2.1 Selectors are supported" + ); + window.onmessage = null; + async.done(); + }); + }; + }); + + asyncTest("CSS Generated Content", function( async ) { + var iframe = document.getElementById("css2-1selectors"); + + iframe.contentWindow.onload = function(e) { + var elem; + + async.step(function() { + elem = iframe.contentDocument.getElementById("generated"); + assert( elem.offsetHeight >= 1, "CSS generated content modifies the offsetHeight as expected" ); + async.done(); + }); + }; + }); + +}