content/base/test/file_bug416317.xhtml

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/test/file_bug416317.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,1476 @@
     1.4 +<?xml version="1.0" encoding="UTF-8"?>
     1.5 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     1.6 +<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"
     1.7 +  xml:lang="en" lang="en" dir="ltr" id="html" class="unitTest" title=":root selector">
     1.8 +<head>
     1.9 +  <title>selectorTest</title>
    1.10 +  <!-- (c) Disruptive Innovations 2008 -->
    1.11 +  <style type="text/css">
    1.12 +    /* TEST 0 : BASIC TESTS */
    1.13 +    /* element type selector */
    1.14 +    body { background-color: red; margin: 10px; padding: 10px; color: red; font-family: sans-serif }
    1.15 +    div { background-color: red; color: red; }
    1.16 +    div.header { background-color: #e0e0e0; color: black; padding: 10px; margin-bottom: 10px;}
    1.17 +    /* class selector */
    1.18 +    .unitTest { width: 10px; background-color: red; color: red; margin: 0px; margin-right: 2px; float: left; }
    1.19 +    .test { margin-bottom: 2px; background-color: green; color: green; }
    1.20 +    /* group of selectors */
    1.21 +    .unitTest, .test { height: 10px; }
    1.22 +
    1.23 +    .UI > * { float: left }
    1.24 +    .UI { clear: both; height: auto; padding-top: 6px;}
    1.25 +    .tilda { clear: both; height: auto; padding-top: 6px;}
    1.26 +    .plus { clear: both; height: auto; padding-top: 6px;}
    1.27 +
    1.28 +    h1, p { width: 500px; color: #000; }
    1.29 +    a { color: #000; }
    1.30 +    #results { background: #FFF; width: 600px; padding: 10px 40px; color: #000; font-size: 11px; line-height: 1.3em; }
    1.31 +    #root, #root2, #root3 { display: none; }
    1.32 +
    1.33 +    /* init */
    1.34 +    .blox16 { background-color: red; }
    1.35 +    .blox17 { background-color: red; }
    1.36 +    .lastChild > p { background-color: red; }
    1.37 +    .firstOfType > p { background-color: red }
    1.38 +    .lastOfType > p { background-color: red }
    1.39 +    .empty > .isEmpty { color: red; }
    1.40 +    html { background-color: red; }
    1.41 +  </style>
    1.42 +  <span type="text/test" id="test"><![CDATA[
    1.43 +    /* :target selector */
    1.44 +    .target :target { background-color: lime; }
    1.45 +
    1.46 +    /* test 1 : childhood selector */
    1.47 +    html > body { background-color: green; }
    1.48 +    .test > .blox1 { background-color: lime; }
    1.49 +
    1.50 +    /* test 2 : attribute existence selector */
    1.51 +    /* attribute with a value */
    1.52 +    .blox2[align] { background-color: lime; }
    1.53 +    /* attribute with empty value */
    1.54 +    .blox3[align] { background-color: lime; }
    1.55 +    /* attribute with almost similar name */
    1.56 +    .blox4, .blox5 { background-color: lime }
    1.57 +    .blox4[align], .blox5[align] { background-color: red; }
    1.58 +
    1.59 +    /* test3 : attribute value selector */
    1.60 +    .blox6[align="center"] { background-color: lime; }
    1.61 +    .blox6[align="c"] { background-color: red; }
    1.62 +    .blox6[align="centera"] { background-color: red; }
    1.63 +    .blox6[foo="\e9"] { background-color: lime; }
    1.64 +    .blox6[\_foo="\e9"] { background-color: lime; }
    1.65 +
    1.66 +    /* test 4 : [~=] */
    1.67 +    .blox7[class~="foo"] { background-color: lime; }
    1.68 +    .blox8, .blox9, .blox10 { background-color: lime; }
    1.69 +    .blox8[class~=""] { background-color: red; }
    1.70 +    .blox9[foo~=""] { background-color: red; }
    1.71 +    .blox10[foo~="foo"] { background-color: red; }
    1.72 +
    1.73 +    /* test5 [^=] */
    1.74 +    .attrStart > .t3 { background-color: lime; }
    1.75 +    .attrStart > .t1[class^="unit"] { background-color: lime; }
    1.76 +    .attrStart > .t2 { background-color: lime; }
    1.77 +    .attrStart > .t2[class^="nit"] { background-color: red; }
    1.78 +    .attrStart > .t3[align^=""] { background-color: red; }
    1.79 +    .attrStart > .t4[foo^="\e9"] { background-color: lime; }
    1.80 +
    1.81 +    /* test6 [$=] */
    1.82 +    .attrEnd > .t3 { background-color: lime; }
    1.83 +    .attrEnd > .t1[class$="t1"] { background-color: lime; }
    1.84 +    .attrEnd > .t2 { background-color: lime; }
    1.85 +    .attrEnd > .t2[class$="unit"] { background-color: red; }
    1.86 +    .attrEnd > .t3[align$=""] { background-color: red; }
    1.87 +    .attrEnd > .t4[foo$="\e9"] { background-color: lime; }
    1.88 +
    1.89 +    /* test7 [*=] */
    1.90 +    .attrMiddle > .t3 { background-color: lime; }
    1.91 +    .attrMiddle > .t1[class*="t t"] { background-color: lime; }
    1.92 +    .attrMiddle > .t2 { background-color: lime; }
    1.93 +    .attrMiddle > .t2[class*="a"] { background-color: red; }
    1.94 +    .attrMiddle > .t3[align*=""] { background-color: red; }
    1.95 +    .attrMiddle > .t4[foo*="\e9"] { background-color: lime; }
    1.96 +
    1.97 +    /* :first-child tests */
    1.98 +    .firstChild .unitTest:first-child { background-color: lime; }
    1.99 +    .blox12:first-child { background-color: red; }
   1.100 +    .blox13:first-child { background-color: red; }
   1.101 +    .blox12, .blox13 { background-color: lime }
   1.102 +
   1.103 +    /* :root tests */
   1.104 +    :root { background-color: green; }
   1.105 +
   1.106 +    /* :scope tests */
   1.107 +    :scope { background-color: green; }
   1.108 +
   1.109 +    /* :nth-child(n) tests */
   1.110 +    .nthchild1 > :nth-last-child(odd) { background-color: lime; }
   1.111 +    .nthchild1 > :nth-child(odd) { background-color: lime; }
   1.112 +
   1.113 +    .nthchild2 > :nth-last-child(even) { background-color: lime; }
   1.114 +    .nthchild2 > :nth-child(even) { background-color: lime; }
   1.115 +
   1.116 +    .nthchild3 > :nth-child(3n+2) { background-color: lime; }
   1.117 +    .nthchild3 > :nth-last-child(3n+1) { background-color: lime; }
   1.118 +    .nthchild3 > :nth-last-child(3n+3) { background-color: lime; }
   1.119 +
   1.120 +    .nthoftype1 > div:nth-of-type(odd) { background-color: lime; }
   1.121 +    .nthoftype1 > div:nth-last-of-type(odd) { background-color: lime; }
   1.122 +    .nthoftype1 > p { background-color: green; }
   1.123 +
   1.124 +    .nthoftype2 > div:nth-of-type(even) { background-color: lime; }
   1.125 +    .nthoftype2 > div:nth-last-of-type(even) { background-color: lime; }
   1.126 +    .nthoftype2 > p { background-color: green; }
   1.127 +
   1.128 +    .nthoftype3 > div:nth-of-type(3n+1) { background-color: lime; }
   1.129 +    .nthoftype3 > div:nth-last-of-type(3n+1) { background-color: lime; }
   1.130 +    .nthoftype3 > div:nth-last-of-type(3n+2) { background-color: lime; }
   1.131 +    .nthoftype3 > p { background-color: green; }
   1.132 +
   1.133 +    /* :not() tests */
   1.134 +    .blox14:not(span) { background-color: lime; }
   1.135 +    .blox15:not([foo="blox14"]) { background-color: lime; }
   1.136 +    .blox16:not(.blox15) { background-color: lime; }
   1.137 +
   1.138 +    /* :only-of-type tests */
   1.139 +    .blox17:only-of-type { background-color: lime; }
   1.140 +    .blox18:only-of-type { background-color: red; }
   1.141 +    .blox18:not(:only-of-type) { background-color: lime; }
   1.142 +
   1.143 +    /* :last-child tests */
   1.144 +    .lastChild > :last-child { background-color: lime }
   1.145 +    .lastChild > :not(:last-child) { background-color: lime }
   1.146 +
   1.147 +    /* :first-of-type tests */
   1.148 +    .firstOfType > *:first-of-type { background-color: lime; }
   1.149 +    *.firstOfType > :not(:first-of-type) { background-color: lime; }
   1.150 +
   1.151 +    /* :last-of-type tests */
   1.152 +    .lastOfType > *:last-of-type { background-color: lime; }
   1.153 +    *.lastOfType > :not(:last-of-type) { background-color: lime; }
   1.154 +
   1.155 +    /* :only-child tests */
   1.156 +    .onlyChild > *:not(:only-child) { background-color: lime; }
   1.157 +    .onlyChild > .unitTest > *:only-child { background-color: lime; }
   1.158 +
   1.159 +    /* :only-of-type tests */
   1.160 +    .onlyOfType *:only-of-type { background-color: lime; }
   1.161 +    .onlyOfType *:not(:only-of-type) { background-color: lime; }
   1.162 +
   1.163 +    /* :empty tests */
   1.164 +    .empty > *.isEmpty:empty { background-color: lime; color: lime; }
   1.165 +    .empty > .isNotEmpty { background-color: blue; color: blue; }
   1.166 +    .empty > .isNotEmpty:empty { background-color: red; color: red; }
   1.167 +    .empty > .isNotEmpty:not(:empty) { background-color: lime; color: lime; }
   1.168 +
   1.169 +    /* :lang() tests */
   1.170 +    .lang :lang(en) { background-color: lime; }
   1.171 +    .lang :lang(fr) { background-color: lime; }
   1.172 +    .lang .t1 { background-color: blue; }
   1.173 +    .lang .t1:lang(es) { background-color: lime; }
   1.174 +    .lang :lang(es-AR) { background-color: red; }
   1.175 +
   1.176 +    /* [|=] tests */
   1.177 +    .attrLang .t1 { background-color: lime; }
   1.178 +    .attrLang .t1[lang|="en"] { background-color: red; }
   1.179 +    .attrLang [lang|="fr"] { background-color: lime; }
   1.180 +    .attrLang .t2[lang|="en"] { background-color: lime; }
   1.181 +    .attrLang .t3 { background-color: blue; }
   1.182 +    .attrLang .t3[lang|="es"] { background-color: lime; }
   1.183 +    .attrLang [lang|="es-AR"] { background-color: red; }
   1.184 +
   1.185 +    /* UI tests */
   1.186 +    .UI .t1:enabled > .unitTest { background-color: lime; }
   1.187 +    .UI .t2:disabled > .unitTest { background-color: lime; }
   1.188 +    .UI .t3:checked + div { background-color: lime; }
   1.189 +    .UI .t4:not(:checked) + div { background-color: lime; }
   1.190 +
   1.191 +    /* ~ combinator tests */
   1.192 +    .tilda .t1 { background-color: white; }
   1.193 +    .tilda .t1 ~ .unitTest { background-color: lime; }
   1.194 +    .tilda .t1:hover ~ .unitTest { background-color: red; }
   1.195 +
   1.196 +    /* ~ combinator tests */
   1.197 +    .plus .t1, .plus .t2 { background-color: white; }
   1.198 +    .plus .t1 + .unitTest + .unitTest { background-color: lime; }
   1.199 +    .plus .t1:hover + .unitTest + .unitTest { background-color: red; }
   1.200 +  ]]></span>
   1.201 +  <span type="text/test" id="error">
   1.202 +    .blox16:not(.blox15[foo="blox14"]) { background-color: red; }
   1.203 +
   1.204 +    /* Tests from http://www.w3.org/Style/CSS/Test/CSS3/Selectors/20060307/html/index.html */
   1.205 +    div:not(:not(div)) { background-color : red }
   1.206 +
   1.207 +    div, { background: red; }
   1.208 +    .5cm { background: red; }
   1.209 +    foo &amp; address, p { background: red; }
   1.210 +    [*=test] { background: red; }
   1.211 +    [*|*=test] { background: red; }
   1.212 +
   1.213 +    div:subject { background: red; }
   1.214 +    :canvas { background: red; }
   1.215 +    :viewport { background: red; }
   1.216 +    :window { background: red; }
   1.217 +    :menu { background: red; }
   1.218 +    :table { background: red; }
   1.219 +    :select { background: red; }
   1.220 +    ::canvas { background: red; }
   1.221 +    ::viewport { background: red; }
   1.222 +    ::window { background: red; }
   1.223 +    ::menu { background: red; }
   1.224 +    ::table { background: red; }
   1.225 +    ::select { background: red; }
   1.226 +
   1.227 +    ..test { background: red; color: yellow; }
   1.228 +    .foo..quux { background: red; color: yellow; }
   1.229 +    .bar. { background: red; color: yellow; }
   1.230 +  </span>
   1.231 +  <script><![CDATA[
   1.232 +  window.onload = function() {
   1.233 +    if (window.parent && window.parent.SpecialPowers) {
   1.234 +      window.parent.SpecialPowers.pushPrefEnv(
   1.235 +        { 'set': [[ "layout.css.scope-pseudo.enabled", true]] },
   1.236 +        doTest);
   1.237 +    } else {
   1.238 +      doTest();
   1.239 +    }
   1.240 +  }
   1.241 +
   1.242 +  function doTest(){
   1.243 +    if ( window.location.hash.indexOf("target") == -1 )
   1.244 +      window.location.hash = "#target";
   1.245 +
   1.246 +    var root = document.getElementById("root");
   1.247 +    var root2 = document.getElementById("root2");
   1.248 +    var root3 = document.getElementById("root3");
   1.249 +    var results = [];
   1.250 +    var tests = 0, passed = 0;
   1.251 +    var cache = {};
   1.252 +
   1.253 +    var css = document.getElementById("test").firstChild.nodeValue.split("\n");
   1.254 +    for ( var i = 0; i < css.length; i++ ) {
   1.255 +      css[i] = css[i].replace(/\/\*.*?\*\//g, "")
   1.256 +        .replace(/^\s*|\s*$/g, "").split(/\s*{/);
   1.257 +    }
   1.258 +
   1.259 +    var ecss = document.getElementById("error").firstChild.nodeValue.split("\n");
   1.260 +    for ( var i = 0; i < ecss.length; i++ ) {
   1.261 +      ecss[i] = ecss[i].replace(/\/\*.*?\*\//g, "")
   1.262 +        .replace(/^\s*|\s*$/g, "").split(/\s*{/);
   1.263 +    }
   1.264 +
   1.265 +    var namespaceCheck = {};
   1.266 +
   1.267 +    var badNamespace = [
   1.268 +      {},
   1.269 +      null,
   1.270 +      undefined,
   1.271 +    ];
   1.272 +
   1.273 +    interfaceCheck(root, "Element");
   1.274 +    runTest( css, "Element", root, true );
   1.275 +    check( "Inside Element", root, true, false );
   1.276 +    cacheCheck( "Element", root );
   1.277 +    check( "Outside Element", root2, passed === 0 ? "autofail" : false, false );
   1.278 +    runTest( ecss, "SyntaxError: Element", root, false );
   1.279 +    jqTests("Element", root3, "querySelectorAll");
   1.280 +
   1.281 +    var root4 = root2.cloneNode(true);
   1.282 +    interfaceCheck(root4, "Disconnected Element");
   1.283 +    runTest( css, "Disconnected Element", root4, true );
   1.284 +    check( "Disconnected Element", root4, true, true );
   1.285 +    cacheCheck( "Disconnected Element", root4 );
   1.286 +    runTest( ecss, "SyntaxError: Disconnected Element", root4, false );
   1.287 +    jqTests("Disconnected Element", root3.cloneNode(true), "querySelectorAll");
   1.288 +    var newRoot = document.createElement("nosuchtag");
   1.289 +    newRoot.appendChild(root3.cloneNode(true));
   1.290 +    jqTests("Disconnected Element scoping", newRoot, "querySelectorAll");
   1.291 +
   1.292 +    var fragment = document.createDocumentFragment();
   1.293 +    fragment.appendChild( root2.cloneNode(true) );
   1.294 +
   1.295 +    interfaceCheck(fragment, "Fragment");
   1.296 +    runTest( css, "Fragment", fragment, true );
   1.297 +    check( "Fragment", fragment, true, true );
   1.298 +    runTest( ecss, "SyntaxError: Fragment", fragment, false );
   1.299 +    cacheCheck( "Fragment", fragment );
   1.300 +
   1.301 +    root.parentNode.removeChild( root );
   1.302 +    
   1.303 +    interfaceCheck(document, "Document");
   1.304 +    runTest( css, "Document", document, true );
   1.305 +    check( "Document", document, true, false );
   1.306 +    runTest( ecss, "SyntaxError: Document", document, false );
   1.307 +    jqTests("Document", document, "querySelectorAll");
   1.308 +    cacheCheck( "Document", document );
   1.309 +    
   1.310 +    done();
   1.311 +
   1.312 +    function interfaceCheck(obj, type){
   1.313 +      var q = typeof obj.querySelector === "function";
   1.314 +      assert( q, type + " supports querySelector" );
   1.315 +      var qa = typeof obj.querySelectorAll === "function";
   1.316 +      assert( qa, type + " supports querySelectorAll" );
   1.317 +      return q && qa;
   1.318 +    }
   1.319 +
   1.320 +    function done(){
   1.321 +      if (window.parent && window.parent.SimpleTest) {
   1.322 +        window.parent.SimpleTest.finish();
   1.323 +      } else {
   1.324 +        var r = document.getElementById("results");
   1.325 +        var li = document.createElement("li");
   1.326 +        var b = document.createElement("b");
   1.327 +        b.appendChild( document.createTextNode( ((passed / tests) * 100).toFixed(1) + "%" ) );
   1.328 +        li.appendChild( b );
   1.329 +        li.appendChild( document.createTextNode( ": " + passed + " passed, " + (tests - passed) + " failed" ) );
   1.330 +        r.appendChild( li );
   1.331 +
   1.332 +        for ( var i = 0; i < results.length; i++ ) {
   1.333 +              var li = document.createElement("li");
   1.334 +              var span = document.createElement("span");
   1.335 +              span.style.color = (results[i][0] === "FAIL" ? "red" : "green");
   1.336 +              span.appendChild( document.createTextNode( results[i][0] ) );
   1.337 +              li.appendChild( span );
   1.338 +              li.appendChild( document.createTextNode( " " + results[i][1] ) );
   1.339 +              r.appendChild( li );
   1.340 +        }
   1.341 +      }
   1.342 +    }
   1.343 +
   1.344 +    function cacheCheck( type, root ) {
   1.345 +      try {
   1.346 +        var pre = root.querySelectorAll( "div" ), preLength = pre.length;
   1.347 +
   1.348 +        var div = document.createElement("div");
   1.349 +        (root.body || root).appendChild( div );
   1.350 +
   1.351 +        var post = root.querySelectorAll( "div" ), postLength = post.length;
   1.352 +
   1.353 +        assert( pre.length == preLength, type + ": StaticNodeList" );
   1.354 +        assert( post.length != pre.length, type + ": StaticNodeList" );
   1.355 +      } catch(e) {
   1.356 +        assert( false, type + ": StaticNodeList" );
   1.357 +        assert( false, type + ": StaticNodeList" );
   1.358 +      }
   1.359 +
   1.360 +      if ( div )
   1.361 +        (root.body || root).removeChild( div );
   1.362 +    }
   1.363 +
   1.364 +
   1.365 +    function runTest( css, type, root, expect ) {
   1.366 +      var pass = false;
   1.367 +      try {
   1.368 +        root.querySelectorAll("");
   1.369 +      } catch(e){ pass = e.name == "SyntaxError" && e.code == DOMException.SYNTAX_ERR; }
   1.370 +      assert( pass, type + ".querySelectorAll Empty String" );
   1.371 +
   1.372 +      pass = false;
   1.373 +      try {
   1.374 +        pass = root.querySelectorAll(null).length === 0;
   1.375 +      } catch(e){ pass = false; }
   1.376 +      assert( pass, type + ".querySelectorAll null" );
   1.377 +
   1.378 +      pass = false;
   1.379 +      try {
   1.380 +         pass = root.querySelectorAll(undefined).length === 0;
   1.381 +      } catch(e){ pass = false; }
   1.382 +      assert( pass, type + ".querySelectorAll undefined" );
   1.383 +
   1.384 +      pass = false;
   1.385 +      try {
   1.386 +        if ( root.querySelectorAll )
   1.387 +          root.querySelectorAll();
   1.388 +      } catch(e){ pass = true; }
   1.389 +      assert( pass, type + ".querySelectorAll no value" );
   1.390 +
   1.391 +      pass = false;
   1.392 +      try {
   1.393 +        root.querySelector("");
   1.394 +      } catch(e){ pass = e.name == "SyntaxError" && e.code == DOMException.SYNTAX_ERR; }
   1.395 +      assert( pass, type + ".querySelector Empty String" );
   1.396 +
   1.397 +      pass = false;
   1.398 +      try {
   1.399 +        pass = root.querySelector(null) === null;
   1.400 +      } catch(e){ pass = false; }
   1.401 +      assert( pass, type + ".querySelector null" );
   1.402 +
   1.403 +      pass = false;
   1.404 +      try {
   1.405 +        pass = root.querySelector(undefined) === null;
   1.406 +      } catch(e){ pass = false; }
   1.407 +      assert( pass, type + ".querySelector undefined" );
   1.408 +
   1.409 +      pass = false;
   1.410 +      try {
   1.411 +        if ( root.querySelector )
   1.412 +          root.querySelector();
   1.413 +      } catch(e){ pass = true; }
   1.414 +      assert( pass, type + ".querySelector no value" );
   1.415 +
   1.416 +      for ( var i = 0; i < css.length; i++ ) {
   1.417 +        var test = css[i];
   1.418 +        if ( test.length == 2 ) {
   1.419 +          var query = test[0], color = test[1].match(/: ([^\s;]+)/)[1];
   1.420 +  
   1.421 +          try {
   1.422 +            var found = root.querySelectorAll(query);
   1.423 +  
   1.424 +            for ( var f = 0; f < found.length; f++ ) {
   1.425 +              found[f].style.backgroundColor = color;
   1.426 +            }
   1.427 +
   1.428 +            var pass = color != "red" || found.length === 0;
   1.429 +
   1.430 +            assert(expect && pass, type + ".querySelectorAll: " + query);
   1.431 +          } catch(e){
   1.432 +            var pass = !expect && e.name == "SyntaxError" && e.code == DOMException.SYNTAX_ERR || false;
   1.433 +            assert(pass, type + ".querySelectorAll: " + query);
   1.434 +          }
   1.435 +
   1.436 +          if ( expect ) {
   1.437 +            var pass = false;
   1.438 +
   1.439 +            try {
   1.440 +              var found2 = root.querySelectorAll( "  \t\r\n  " + query + "  \t\r\n  " );
   1.441 +              pass = found2.length == found.length;
   1.442 +            } catch(e) {}
   1.443 +
   1.444 +            assert(pass, type + ".querySelectorAll Whitespace Trim: " + query);
   1.445 +          }
   1.446 +
   1.447 +          try {
   1.448 +            var single = root.querySelector(query);
   1.449 +
   1.450 +            var pass = found.length == 0 && single === null ||
   1.451 +              found.length && found[0] == single;
   1.452 +
   1.453 +            assert(expect, type + ".querySelector: " + query);
   1.454 +          } catch(e){
   1.455 +            var pass = !expect && e.name == "SyntaxError" && e.code == DOMException.SYNTAX_ERR || false;
   1.456 +            assert(pass, type + ".querySelector: " + query);
   1.457 +          }
   1.458 +        }
   1.459 +      }
   1.460 +    }
   1.461 +
   1.462 +    function check( type, root, expect, fragment ){
   1.463 +      var walker = document.createTreeWalker( root, NodeFilter.SHOW_ELEMENT, { acceptNode: function(){ return 1; } } );
   1.464 +
   1.465 +      while ( walker.nextNode() ) {
   1.466 +        var div = walker.currentNode;
   1.467 +        if ( (div.getAttribute("class") || "").toString().indexOf("unitTest") > -1 &&
   1.468 +            (!fragment || div.getAttribute("id") !== "nofragment") ) {
   1.469 +          // If we're display:none, we need to toggle that when doing computed
   1.470 +          //  style.
   1.471 +          var needToggle =
   1.472 +            (window.frameElement &&
   1.473 +             window.frameElement.style.display == "none");
   1.474 +          if (needToggle) {
   1.475 +            if ((div.getAttribute("class") || "").toString().indexOf("skipWhenToggling") > -1) {
   1.476 +              continue;
   1.477 +            }
   1.478 +            window.frameElement.style.display = "";
   1.479 +            // make sure it kicks in immediately
   1.480 +            document.body.offsetWidth;
   1.481 +          }
   1.482 +          var view = document.defaultView.getComputedStyle(div, null);
   1.483 +          var bg = view.getPropertyValue("background-color") || div.style.backgroundColor;
   1.484 +          if (needToggle) {
   1.485 +            window.frameElement.style.display = "none";
   1.486 +            // make sure it kicks in immediately
   1.487 +            document.body.offsetWidth;
   1.488 +          }
   1.489 +
   1.490 +          var pass = bg && bg.indexOf("(255, 0, 0") == -1 && bg.indexOf("#ff0000") == -1 && bg.indexOf("red") == -1;
   1.491 +          //var pass = bg && bg.indexOf("(255, 0, 0") == -1 && bg.indexOf("#ff0000") == -1;
   1.492 +          assert(pass === expect, type + ": " + (div.title || div.parentNode.title));
   1.493 +        }
   1.494 +      }
   1.495 +    }
   1.496 +
   1.497 +    function assert(pass, title) {
   1.498 +      // Update |passed| no matter what: some tests depend on this
   1.499 +      passed += (pass ? 1 : 0);
   1.500 +
   1.501 +      if (window.parent && window.parent.SimpleTest) {
   1.502 +        window.parent.SimpleTest.ok(pass, title);
   1.503 +      } else {
   1.504 +        results.push([ (!pass ? "FAIL" : "PASS"), title ]);
   1.505 +        tests++;
   1.506 +      }
   1.507 +    }
   1.508 +
   1.509 +    function jqTests(type, root, select) {
   1.510 +
   1.511 +      function query(q, resolver){
   1.512 +        try {
   1.513 +          return root[select](q, resolver);
   1.514 +        } catch(e){
   1.515 +          if ( e.message.indexOf("ERR") > -1 ||
   1.516 +              (e.name == "SyntaxError" && e.code == DOMException.SYNTAX_ERR) )
   1.517 +            throw e;
   1.518 +        }
   1.519 +      }
   1.520 +
   1.521 +      var all = query("*");
   1.522 +
   1.523 +      function checkMatchesSelector(results, q) {
   1.524 +        var key = +new Date + ":" + Math.random();
   1.525 +
   1.526 +        function report(item, shouldMatch) {
   1.527 +          assert( item.mozMatchesSelector(q) === shouldMatch,
   1.528 +                  item + (shouldMatch ? "does not match" : "matches")
   1.529 +                       + " selector '" + q + "'" );
   1.530 +        }
   1.531 +
   1.532 +        for (var i = 0; i < results.length; i++) {
   1.533 +          var item = results.item(i);
   1.534 +          item[key] = true;
   1.535 +          report( item, true );
   1.536 +        }
   1.537 +
   1.538 +        for (var stride = 15, // reduce test spam
   1.539 +                 i = Math.round(Math.random() * stride);
   1.540 +             i < all.length; i += stride)
   1.541 +        {
   1.542 +          var item = all.item(i),
   1.543 +              shouldMatch = !!item[key];
   1.544 +          report( item, shouldMatch );
   1.545 +        }
   1.546 +
   1.547 +        for (var i = 0; i < results.length; i++)
   1.548 +          delete results.item(i)[key];
   1.549 +      }
   1.550 +
   1.551 +      function t( name, q, ids, restrict, ids2 ) {
   1.552 +        var pass = true;
   1.553 +
   1.554 +        if ( restrict === false && root != document )
   1.555 +          return;
   1.556 +
   1.557 +        var namespaced = /\|[^=]/.test( q );
   1.558 +        var prepend = namespaced ? "xHTML|*#root3 " : "#root3 ";
   1.559 +        q = (restrict === false || restrict === ":root" ||
   1.560 +             restrict === ":scope" ? "" : prepend) +
   1.561 +            q.replace(/,/g, ", " + prepend);
   1.562 +        var nq = q.replace(/>/g, "&gt;").replace(/</g, "&lt;");
   1.563 +
   1.564 +        if ( namespaced ) {
   1.565 +          for ( var i = 0; i < badNamespace.length; i++ ) {
   1.566 +            var resolver = badNamespace[i], pass = false, results = null;
   1.567 +
   1.568 +            try {
   1.569 +              results = query(q, resolver);
   1.570 +            } catch(e) {
   1.571 +              pass = (e.message === "bad ERROR" ||
   1.572 +                      (e.name == "SyntaxError" && e.code == DOMException.SYNTAX_ERR));
   1.573 +            }
   1.574 +
   1.575 +            assert( pass, type + ": " + name + " Bad Resolver #" + (i+1) + " (" + nq + ")" + 
   1.576 +              (pass ? "" : " Expected: " + extra(ids) + " Received: " + extra(results)) );
   1.577 +          }
   1.578 +        } else {
   1.579 +          var pass = false;
   1.580 +
   1.581 +          try {
   1.582 +            var results = query(q);
   1.583 +            pass = hasPassed( results, ids );
   1.584 +          } catch(e) {
   1.585 +            pass = e.name == "SyntaxError" && e.code == DOMException.SYNTAX_ERR;
   1.586 +          }
   1.587 +  
   1.588 +          assert( pass, type + ": " + name + " (" + nq + ")" +
   1.589 +            (pass ? "" : " Expected: " + extra(ids) + " Received: " + extra(results)) );
   1.590 +
   1.591 +          // For now, don't use checkMatchesSelector when
   1.592 +          // restrict === ":scope" because we have no way to hand the
   1.593 +          // right scope to it yet.
   1.594 +          if (results && restrict !== ":scope")
   1.595 +            checkMatchesSelector( results, q );
   1.596 +        }
   1.597 +
   1.598 +        function hasPassed(results, ids){
   1.599 +          var pass = (results && results.length == ids.length) || (!results && !ids);
   1.600 +  
   1.601 +          if ( ids && results ) {
   1.602 +            for ( var i = 0; ids && i < ids.length; i++ ) {
   1.603 +              if ( ids[i] !== results[i].getAttribute("id") ) {
   1.604 +                pass = false;
   1.605 +              }
   1.606 +            }
   1.607 +          } else {
   1.608 +            pass = false;
   1.609 +          }
   1.610 +
   1.611 +          return pass;
   1.612 +        }
   1.613 +
   1.614 +        function extra(results){
   1.615 +          var extra = " [";
   1.616 +          if ( results ) {
   1.617 +            for ( var i = 0; i < results.length; i++ ) {
   1.618 +              extra += (extra.length > 2 ? "," : "") + "'" + (results[i].id || results[i]) + "'";
   1.619 +            }
   1.620 +          }
   1.621 +  
   1.622 +          extra += "]";
   1.623 +          return extra;
   1.624 +        }
   1.625 +      }
   1.626 +
   1.627 +      t( "SVG", "*|svg", ["svg1","svg2","svg3"] );
   1.628 +      t( "SVG", "svg|svg", ["svg2","svg3"] );
   1.629 +      t( "SVG", "svg|svg *|circle", ["circle2","circle3"] );
   1.630 +      t( "SVG", "svg|svg svg|circle", ["circle2","circle3"] );
   1.631 +      t( "SVG", "xHTML|div *|svg", ["svg1","svg2","svg3"] );
   1.632 +      t( "SVG", "div svg|svg", ["svg2","svg3"] );
   1.633 +      t( "SVG", "xHTML|div svg|svg", ["svg2","svg3"] );
   1.634 +      t( "SVG", "xHTML|div svg|svg *|circle", ["circle2","circle3"] );
   1.635 +      t( "SVG", "xHTML|div svg *|circle", ["circle1","circle2","circle3"], true, ["circle1"] );
   1.636 +      t( "SVG", "xHTML|div svg|svg svg|circle", ["circle2","circle3"] );
   1.637 +
   1.638 +      t( "Element Selector", "xHTML|p", ["firstp","ap","sndp","en","sap","first"] );
   1.639 +      t( "Parent Element", "xHTML|div p", ["firstp","ap","sndp","en","sap","first"] );
   1.640 +      t( "Parent Element", "xHTML|div xHTML|p", ["firstp","ap","sndp","en","sap","first"] );
   1.641 +      t( "Parent Element", "*|div xHTML|p", ["firstp","ap","sndp","en","sap","first"] );
   1.642 +      t( "Parent Element", "*|div *|p", ["firstp","ap","sndp","en","sap","first"] );
   1.643 +      t( "Child", "xHTML|p > xHTML|a", ["simon1","google","groups","mark","yahoo","simon"] );
   1.644 +      t( "Adjacent", "xHTML|a + xHTML|a", ["groups"] );
   1.645 +      t( "Adjacent", "xHTML|a + a", ["groups"] );
   1.646 +      t( "Nth-child", "xHTML|*#form xHTML|*#select1 xHTML|option:nth-child(3)", ["option1c"] );
   1.647 +
   1.648 +      assert( all && all.length > 30, type + ": Select all" );
   1.649 +      var good = all && all.length;
   1.650 +      for ( var i = 0; all && i < all.length; i++ )
   1.651 +        if ( all[i].nodeType != 1 )
   1.652 +          good = false;
   1.653 +      assert( good, type + ": Select all elements, no comment nodes" );
   1.654 +
   1.655 +      if ( root == document ) {
   1.656 +        t( ":root Selector", ":root", ["html"], false );
   1.657 +        t( ":scope Selector", ":scope", ["html"], ":scope" );
   1.658 +      } else {
   1.659 +        t( ":root Selector", ":root", [], ":root" );
   1.660 +        if (root.localName != "nosuchtag") {
   1.661 +          t( ":scope Selector", ":scope > nosuchtag",
   1.662 +             [ "outerbogustag" ], ":scope");
   1.663 +        }
   1.664 +        t( ":scope Selector", ":scope nosuchtag nosuchtag",
   1.665 +           [ "innerbogustag" ], ":scope");
   1.666 +
   1.667 +        if ( !root.parentNode ) {
   1.668 +          t( ":root All Selector", ":root *", [], ":root" );
   1.669 +        }
   1.670 +      }
   1.671 +
   1.672 +      if ( root.parentNode || root == document ) {
   1.673 +        assert( query(":root *").length == query("*").length - (root == document ? 1 : 0), type + ": :root All Selector" );
   1.674 +      }
   1.675 +      assert( query(":scope *").length == query("*").length - (root == document ? 1 : 0), type + ": :scope All Selector" );
   1.676 +
   1.677 +      t( "Element Selector", "p", ["firstp","ap","sndp","en","sap","first"] );
   1.678 +      t( "Element Selector", "body", ["body"], false );
   1.679 +      t( "Element Selector", "html", ["html"], false );
   1.680 +      t( "Parent Element", "div p", ["firstp","ap","sndp","en","sap","first"] );
   1.681 +      var param = query("#object1 param");
   1.682 +      assert( param && param.length == 2, type + ": Object/param as context" );
   1.683 +
   1.684 +      var l = query("#length");  
   1.685 +      assert( l && l.length, type + ': &lt;input name="length"&gt; cannot be found under IE' );
   1.686 +      var lin = query("#lengthtest input");
   1.687 +      assert( lin && lin.length, type + ': &lt;input name="length"&gt; cannot be found under IE' );
   1.688 +
   1.689 +      t( "Broken Selector", "[" );
   1.690 +      t( "Broken Selector", "(" );
   1.691 +      t( "Broken Selector", "{" );
   1.692 +      t( "Broken Selector", "<" );
   1.693 +      t( "Broken Selector", "()" );
   1.694 +      t( "Broken Selector", "<>" );
   1.695 +      t( "Broken Selector", "{}" );
   1.696 +
   1.697 +      t( "ID Selector", "#body", ["body"], false );
   1.698 +      t( "ID Selector w/ Element", "body#body", ["body"], false );
   1.699 +      t( "ID Selector w/ Element", "ul#first", [] );
   1.700 +      t( "ID selector with existing ID descendant", "#firstp #simon1", ["simon1"] );
   1.701 +      t( "ID selector with nonexistent descendant", "#firstp #foobar", [] );
   1.702 +
   1.703 +      t( "ID selector using UTF8", "#台北Táiběi", ["台北Táiběi"] );
   1.704 +      t( "Multiple ID selectors using UTF8", "#台北Táiběi, #台北", ["台北Táiběi","台北"] );
   1.705 +      t( "Descendant ID selector using UTF8", "div #台北", ["台北"] );
   1.706 +      t( "Child ID selector using UTF8", "form > #台北", ["台北"] );
   1.707 +  
   1.708 +      t( "Escaped ID", "#foo\\:bar", ["foo:bar"] );
   1.709 +      t( "Escaped ID", "#test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
   1.710 +      t( "Descendant escaped ID", "div #foo\\:bar", ["foo:bar"] );
   1.711 +      t( "Descendant escaped ID", "div #test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
   1.712 +      t( "Child escaped ID", "form > #foo\\:bar", ["foo:bar"] );
   1.713 +      t( "Child escaped ID", "form > #test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
   1.714 +  
   1.715 +      t( "ID Selector, child ID present", "#form > #radio1", ["radio1"] ); // bug #267
   1.716 +      t( "ID Selector, not an ancestor ID", "#form #first", [] );
   1.717 +      t( "ID Selector, not a child ID", "#form > #option1a", [] );
   1.718 +      
   1.719 +      t( "All Children of ID", "#foo > *", ["sndp", "en", "sap"] );
   1.720 +      t( "All Children of ID with no children", "#firstUL > *", [] );
   1.721 +
   1.722 +      t( "ID selector with nonexistent ancestor", "#asdfasdf #foobar", [] ); // bug #986
   1.723 +
   1.724 +      //t( "body div#form", [], "ID selector within the context of another element" );
   1.725 +
   1.726 +      t( "Class Selector", ".blog", ["mark","simon"] );
   1.727 +      t( "Class Selector", ".blog.link", ["simon"] );
   1.728 +      t( "Class Selector w/ Element", "a.blog", ["mark","simon"] );
   1.729 +      t( "Parent Class Selector", "p .blog", ["mark","simon"] );
   1.730 +  
   1.731 +      t( "Class selector using UTF8", ".台北Táiběi", ["utf8class1"] );
   1.732 +      t( "Class selector using UTF8", ".台北", ["utf8class1","utf8class2"] );
   1.733 +      t( "Class selector using UTF8", ".台北Táiběi.台北", ["utf8class1"] );
   1.734 +      t( "Class selector using UTF8", ".台北Táiběi, .台北", ["utf8class1","utf8class2"] );
   1.735 +      t( "Descendant class selector using UTF8", "div .台北Táiběi", ["utf8class1"] );
   1.736 +      t( "Child class selector using UTF8", "form > .台北Táiběi", ["utf8class1"] );
   1.737 +  
   1.738 +      t( "Escaped Class", ".foo\\:bar", ["foo:bar"] );
   1.739 +      t( "Escaped Class", ".test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
   1.740 +      t( "Descendant scaped Class", "div .foo\\:bar", ["foo:bar"] );
   1.741 +      t( "Descendant scaped Class", "div .test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
   1.742 +      t( "Child escaped Class", "form > .foo\\:bar", ["foo:bar"] );
   1.743 +      t( "Child escaped Class", "form > .test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
   1.744 +
   1.745 +      t( "Comma Support", "a.blog, p", ['firstp','ap','mark','sndp','en','sap','simon','first'] );
   1.746 +      t( "Comma Support", "a.blog , p", ['firstp','ap','mark','sndp','en','sap','simon','first'] );
   1.747 +      t( "Comma Support", "a.blog ,p", ['firstp','ap','mark','sndp','en','sap','simon','first'] );
   1.748 +      t( "Comma Support", "a.blog,p", ['firstp','ap','mark','sndp','en','sap','simon','first'] );
   1.749 +
   1.750 +      t( "Outer Whitespace", " a.blog,p", ['firstp','ap','mark','sndp','en','sap','simon','first'] );
   1.751 +      t( "Outer Whitespace", "a.blog,p ", ['firstp','ap','mark','sndp','en','sap','simon','first'] );
   1.752 +      t( "Outer Whitespace", " p,a.blog", ['firstp','ap','mark','sndp','en','sap','simon','first'] );
   1.753 +      t( "Outer Whitespace", "p,a.blog ", ['firstp','ap','mark','sndp','en','sap','simon','first'] );
   1.754 +
   1.755 +      t( "Child", "p > a", ["simon1","google","groups","mark","yahoo","simon"] );
   1.756 +      t( "Child", "p> a", ["simon1","google","groups","mark","yahoo","simon"] );
   1.757 +      t( "Child", "p >a", ["simon1","google","groups","mark","yahoo","simon"] );
   1.758 +      t( "Child", "p>a", ["simon1","google","groups","mark","yahoo","simon"] );
   1.759 +      t( "Child w/ Class", "p > a.blog", ["mark","simon"] );
   1.760 +      t( "All Children", "code > *", ["anchor1","anchor2"] );
   1.761 +      t( "All Grandchildren", "p > * > *", ["anchor1","anchor2"] );
   1.762 +      t( "Adjacent", "a + a", ["groups"] );
   1.763 +      t( "Adjacent", "a +a", ["groups"] );
   1.764 +      t( "Adjacent", "a+ a", ["groups"] );
   1.765 +      t( "Adjacent", "a+a", ["groups"] );
   1.766 +      t( "Adjacent", "p + p", ["ap","en","sap"] );
   1.767 +      t( "Comma, Child, and Adjacent", "a + a, code > a", ["groups","anchor1","anchor2"] );
   1.768 +      
   1.769 +      t( "First Child", "p:first-child", ["firstp","sndp"] );
   1.770 +      t( "Nth Child", "p:nth-child(1)", ["firstp","sndp"] );
   1.771 +      
   1.772 +      t( "Last Child", "p:last-child", ["sap"] );
   1.773 +      t( "Last Child", "a:last-child", ["simon1","anchor1","mark","yahoo","anchor2","simon"] );
   1.774 +  
   1.775 +      t( "Nth-child", "#main form#form > *:nth-child(2)", ["text2"] );
   1.776 +      t( "Nth-child", "#main form#form > :nth-child(2)", ["text2"] );
   1.777 +
   1.778 +      t( "Nth-child", "#form #select1 option:nth-child(3)", ["option1c"] );
   1.779 +      t( "Nth-child", "#form #select1 option:nth-child(0n+3)", ["option1c"] );
   1.780 +      t( "Nth-child", "#form #select1 option:nth-child(1n+0)", ["option1a", "option1b", "option1c", "option1d"] );
   1.781 +      t( "Nth-child", "#form #select1 option:nth-child(1n)", ["option1a", "option1b", "option1c", "option1d"] );
   1.782 +      t( "Nth-child", "#form #select1 option:nth-child(n)", ["option1a", "option1b", "option1c", "option1d"] );
   1.783 +      t( "Nth-child", "#form #select1 option:nth-child(even)", ["option1b", "option1d"] );
   1.784 +      t( "Nth-child", "#form #select1 option:nth-child(odd)", ["option1a", "option1c"] );
   1.785 +      t( "Nth-child", "#form #select1 option:nth-child(2n)", ["option1b", "option1d"] );
   1.786 +      t( "Nth-child", "#form #select1 option:nth-child(2n+1)", ["option1a", "option1c"] );
   1.787 +      t( "Nth-child", "#form #select1 option:nth-child(3n)", ["option1c"] );
   1.788 +      t( "Nth-child", "#form #select1 option:nth-child(3n+1)", ["option1a", "option1d"] );
   1.789 +      t( "Nth-child", "#form #select1 option:nth-child(3n+2)", ["option1b"] );
   1.790 +      t( "Nth-child", "#form #select1 option:nth-child(3n+3)", ["option1c"] );
   1.791 +      t( "Nth-child", "#form #select1 option:nth-child(3n-1)", ["option1b"] );
   1.792 +      t( "Nth-child", "#form #select1 option:nth-child(3n-2)", ["option1a", "option1d"] );
   1.793 +      t( "Nth-child", "#form #select1 option:nth-child(3n-3)", ["option1c"] );
   1.794 +      t( "Nth-child", "#form #select1 option:nth-child(3n+0)", ["option1c"] );
   1.795 +      t( "Nth-child", "#form #select1 option:nth-child(-n+3)", ["option1a", "option1b", "option1c"] );
   1.796 +
   1.797 +      t( "Attribute Exists", "a[title]", ["google"] );
   1.798 +      t( "Attribute Exists", "*[title]", ["google"] );
   1.799 +      t( "Attribute Exists", "[title]", ["google"] );
   1.800 +      
   1.801 +      t( "Attribute Equals", "a[rel='bookmark']", ["simon1"] );
   1.802 +      t( "Attribute Equals", 'a[rel="bookmark"]', ["simon1"] );
   1.803 +      t( "Attribute Equals", "a[rel=bookmark]", ["simon1"] );
   1.804 +      t( "Multiple Attribute Equals", "#form input[type='hidden'],#form input[type='radio']", ['radio1','radio2','hidden1'] );
   1.805 +      t( "Multiple Attribute Equals", "#form input[type=\"hidden\"],#form input[type='radio']", ['radio1','radio2','hidden1'] );
   1.806 +      t( "Multiple Attribute Equals", "#form input[type=hidden],#form input[type=radio]", ['radio1','radio2','hidden1'] );
   1.807 +  
   1.808 +      t( "Attribute selector using UTF8", "span[lang=中文]", ["台北"] );
   1.809 +  
   1.810 +      t( "Attribute Begins With", "a[href ^= 'http://www']", ["google","yahoo"] );
   1.811 +      t( "Attribute Ends With", "a[href $= 'org/']", ["mark"] );
   1.812 +      t( "Attribute Contains", "a[href *= 'google']", ["google","groups"] );
   1.813 +  
   1.814 +      // t("Select options via [selected]", "#select1 option[selected]", ["option1a"] );
   1.815 +      t("Select options via [selected]", "#select1 option[selected]", [] );
   1.816 +      t("Select options via [selected]", "#select2 option[selected]", ["option2d"] );
   1.817 +      t("Select options via [selected]", "#select3 option[selected]", ["option3b", "option3c"] );
   1.818 +  
   1.819 +      t( "Grouped Form Elements", "input[name='foo[bar]']", ["hidden2"] );
   1.820 +  
   1.821 +      t( ":not() Existing attribute", "#form select:not([multiple])", ["select1", "select2"]);
   1.822 +      t( ":not() Equals attribute", "#form select:not([name=select1])", ["select2", "select3"]);
   1.823 +      t( ":not() Equals quoted attribute", "#form select:not([name='select1'])", ["select2", "select3"]);
   1.824 +
   1.825 +      t( "First Child", "p:first-child", ["firstp","sndp"] );
   1.826 +      t( "Last Child", "p:last-child", ["sap"] );
   1.827 +      t( "Only Child", "a:only-child", ["simon1","anchor1","yahoo","anchor2"] );
   1.828 +      t( "Empty", "ul:empty", ["firstUL"] );
   1.829 +      //t( "Enabled UI Element", "#form input:enabled", ["text1","radio1","radio2","check1","check2","hidden2","name"] );
   1.830 +      t( "Disabled UI Element", "#form input:disabled", ["text2"] );
   1.831 +      t( "Checked UI Element", "#form input:checked", ["radio2","check1"] );
   1.832 +      t( "Element Preceded By", "p ~ div", ["foo","fx-queue","fx-tests", "moretests"] );
   1.833 +      t( "Not", "a.blog:not(.link)", ["mark"] );
   1.834 +    }
   1.835 +  };
   1.836 +  ]]></script>
   1.837 +</head>
   1.838 +<body id="body" class="unitTest" title="childhood and element type selectors">
   1.839 +<h1><a href="http://www.w3.org/TR/selectors-api/">Selectors API</a> Test Suite</h1>
   1.840 +<p>Testrunner by <a href="http://ejohn.org/">John Resig</a>, tests by <a href="http://ejohn.org/">John Resig</a>, <a href="http://disruptive-innovations.com/zoo/css3tests/selectorTest.html">Disruptive Innovations</a>, <a href="http://www.w3.org/Style/CSS/Test/CSS3/Selectors/20060307/html/index.html">W3C CSS Working Group</a>, <a href="http://jquery.com/test/">jQuery JavaScript Library</a>.</p>
   1.841 +<div id="root">
   1.842 +  <div class="header">
   1.843 +    <h3>CSS 3 Selectors tests</h3>
   1.844 +    <p>(c) <a href="http://www.disruptive-innovations.com">Disruptive Innovations</a> 2008<br/>
   1.845 +    Last update: 2008-06-06</p>
   1.846 +  </div>
   1.847 +
   1.848 +  <div class="test target">
   1.849 +    <div class="unitTest skipWhenToggling" id="target" title=":target selector"></div>
   1.850 +  </div>
   1.851 +
   1.852 +  <div class="test">
   1.853 +    <div class="blox1 unitTest" title="childhood selector"></div>
   1.854 +  </div>
   1.855 +
   1.856 +  <div class="test attributeExistence">
   1.857 +    <div class="blox2 unitTest" align="center" title="attribute existence selector"></div>
   1.858 +    <div class="blox3 unitTest" align="" title="attribute existence selector with empty string value"></div>
   1.859 +    <div class="blox4 unitTest" valign="center" title="attribute existence selector with almost identical attribute"></div>
   1.860 +    <div class="blox5 unitTest" alignv="center" title="attribute existence selector with almost identical attribute"></div>
   1.861 +  </div>
   1.862 +
   1.863 +  <div class="test attributeValue">
   1.864 +    <div class="blox6 unitTest" align="center" title="attribute value selector"></div>
   1.865 +    <div class="blox6 unitTest" foo="&eacute;" title="attribute value selector with an entity in the attribute and an escaped value in the selector"></div>
   1.866 +    <div class="blox6 unitTest" _foo="&eacute;" title="attribute value selector with an entity in the attribute, an escaped value in the selector, and a leading underscore in the attribute name"></div>
   1.867 +  </div>
   1.868 +
   1.869 +  <div class="test attributeSpaceSeparatedValues">
   1.870 +    <div class="blox7 foo unitTest" title="[~=] attribute selector"></div>
   1.871 +    <div class="blox8 unitTest" title="[~=] attribute selector looking for empty string"></div>
   1.872 +    <div class="blox9 unitTest" foo="" title="[~=] attribute selector looking for empty string in empty attribute"></div>
   1.873 +    <div class="blox10 unitTest" foo="foobar" title="[~=] attribute selector looking for 'foo' in 'foobar'"></div>
   1.874 +  </div>
   1.875 +
   1.876 +  <div class="test attrStart">
   1.877 +    <div class="unitTest t1" title="[^=] attribute selector"></div>
   1.878 +    <div class="unitTest t2" title="[^=] attribute selector"></div>
   1.879 +    <div class="unitTest t3" align="center" title="[^=] attribute selector looking for empty string"></div>
   1.880 +    <div class="unitTest t4" foo="&eacute;tagada" title="[^=] attribute selector looking for &eacute;"></div>
   1.881 +  </div>
   1.882 +
   1.883 +  <div class="test attrEnd">
   1.884 +    <div class="unitTest t1" title="[$=] attribute selector"></div>
   1.885 +    <div class="unitTest t2" title="[$=] attribute selector"></div>
   1.886 +    <div class="unitTest t3" align="center" title="[$=] attribute selector looking for empty string"></div>
   1.887 +    <div class="unitTest t4" foo="tagada&eacute;" title="[$=] attribute selector looking for &eacute;"></div>
   1.888 +  </div>
   1.889 +
   1.890 +  <div class="test attrMiddle">
   1.891 +    <div class="unitTest t1" title="[*=] attribute selector"></div>
   1.892 +    <div class="unitTest t2" title="[*=] attribute selector"></div>
   1.893 +    <div class="unitTest t3" align="center" title="[*=] attribute selector looking for empty string"></div>
   1.894 +    <div class="unitTest t4" foo="tagada&eacute;foo" title="[*=] attribute selector looking for &eacute;"></div>
   1.895 +  </div>
   1.896 +
   1.897 +  <div class="test firstChild">
   1.898 +    <div class="unitTest" title=":first-child selector"></div>
   1.899 +    <div class="blox12 unitTest" title=":first-child selector should not match non first child"></div>
   1.900 +    <div class="blox13 unitTest" title=":first-child selector should not match non first child"></div>
   1.901 +  </div>
   1.902 +
   1.903 +  <div class="test not">
   1.904 +    <div class="blox14 unitTest" title="negation pseudo-class with argument being an element type selector"></div>
   1.905 +    <div class="blox15 unitTest" foo="blox15" title="negation pseudo-class with argument being an attribute selector"></div>
   1.906 +    <div class="blox16 unitTest" foo="blox15" title="negation pseudo-class accepts only simple selectors for argument"></div>
   1.907 +  </div>
   1.908 +
   1.909 +  <div class="test onlyOfType">
   1.910 +    <div class="blox17 unitTest" title=":only-of-type selector"></div>
   1.911 +    <p class="blox18 unitTest" title="negated :only-of-type selector"></p>
   1.912 +    <p class="blox18 unitTest" title="negated :only-of-type selector"></p>
   1.913 +  </div>
   1.914 +
   1.915 +  <div class="test nthchild1">
   1.916 +    <div class="unitTest" title=":nth-child(odd) selector"></div>
   1.917 +    <div class="unitTest" title=":nth-last-child(odd) selector"></div>
   1.918 +    <div class="unitTest" title=":nth-child(odd) selector"></div>
   1.919 +    <div class="unitTest" title=":nth-last-child(odd) selector"></div>
   1.920 +    <div class="unitTest" title=":nth-child(odd) selector"></div>
   1.921 +    <div class="unitTest" title=":nth-last-child(odd) selector"></div>
   1.922 +  </div>
   1.923 +  <div class="test nthchild2">
   1.924 +    <div class="unitTest" title=":nth-last-child(even) selector"></div>
   1.925 +    <div class="unitTest" title=":nth-child(even) selector"></div>
   1.926 +    <div class="unitTest" title=":nth-last-child(even) selector"></div>
   1.927 +    <div class="unitTest" title=":nth-child(even) selector"></div>
   1.928 +    <div class="unitTest" title=":nth-last-child(even) selector"></div>
   1.929 +    <div class="unitTest" title=":nth-child(even) selector"></div>
   1.930 +  </div>
   1.931 +  <div class="test nthchild3">
   1.932 +    <div class="unitTest no" title=":nth-last-child(3n+3) selector"></div>
   1.933 +    <div class="unitTest" title=":nth-child(3n+2) selector"></div>
   1.934 +    <div class="unitTest no" title=":nth-last-child(3n+1) selector"></div>
   1.935 +    <div class="unitTest no" title=":nth-last-child(3n+3) selector"></div>
   1.936 +    <div class="unitTest" title=":nth-child(3n+2) selector"></div>
   1.937 +    <div class="unitTest no" title=":nth-last-child(3n+1) selector"></div>
   1.938 +  </div>
   1.939 +
   1.940 +  <div class="test nthoftype1">
   1.941 +    <div class="unitTest" title=":nth-of-type(odd) selector"></div>
   1.942 +    <p class="unitTest" title=":nth-* selector"></p>
   1.943 +    <p class="unitTest" title=":nth-* selector"></p>
   1.944 +    <div class="unitTest" title=":nth-last-of-type(odd) selector"></div>
   1.945 +    <p class="unitTest" title=":nth-* selector"></p>
   1.946 +    <div class="unitTest" title=":nth-of-type(odd) selector"></div>
   1.947 +    <div class="unitTest" title=":nth-last-of-type(odd) selector"></div>
   1.948 +  </div>
   1.949 +  <div class="test nthoftype2">
   1.950 +    <div class="unitTest" title=":nth-last-of-type(even) selector"></div>
   1.951 +    <p class="unitTest" title=":nth-* selector"></p>
   1.952 +    <p class="unitTest" title=":nth-* selector"></p>
   1.953 +    <div class="unitTest" title=":nth-of-type(even) selector"></div>
   1.954 +    <p class="unitTest" title=":nth-* selector"></p>
   1.955 +    <div class="unitTest" title=":nth-last-of-type(even) selector"></div>
   1.956 +    <div class="unitTest" title=":nth-of-type(even) selector"></div>
   1.957 +  </div>
   1.958 +  <div class="test nthoftype3">
   1.959 +    <div class="unitTest" title=":nth-of-type(3n+1) selector"></div>
   1.960 +    <p class="unitTest" title=":nth-* selector"></p>
   1.961 +    <p class="unitTest" title=":nth-* selector"></p>
   1.962 +    <div class="unitTest" title=":nth-last-of-type(3n+2) selector"></div>
   1.963 +    <p class="unitTest" title=":nth-* selector"></p>
   1.964 +    <div class="unitTest" title=":nth-last-of-type(3n+1) selector"></div>
   1.965 +    <div class="unitTest" title=":nth-of-type(3n+1) selector"></div>
   1.966 +    <p class="unitTest" title=":nth-* selector"></p>
   1.967 +    <div class="unitTest" title=":nth-last-of-type(3n+2) selector"></div>
   1.968 +    <div class="unitTest" title=":nth-last-of-type(3n+1) selector"></div>
   1.969 +  </div>
   1.970 +
   1.971 +  <div class="test lastChild">
   1.972 +    <p class="unitTest" title=":not(:last-child) selector"></p>
   1.973 +    <div class="unitTest" title=":last-child selector"></div>&nbsp;
   1.974 +  </div>
   1.975 +
   1.976 +  <div class="test firstOfType">
   1.977 +    <p class="unitTest" title=":first-of-type selector"></p>
   1.978 +    <div class="unitTest" title=":first-of-type selector"></div>
   1.979 +    <p class="unitTest" title=":not(:first-of-type)"></p>
   1.980 +    <div class="unitTest" title=":not(:first-of-type)"></div>
   1.981 +  </div>
   1.982 +
   1.983 +  <div class="test lastOfType">
   1.984 +    <p class="unitTest" title=":not(:last-of-type)"></p>
   1.985 +    <div class="unitTest" title=":not(:last-of-type)"></div>
   1.986 +    <p class="unitTest" title=":last-of-type selector"></p>
   1.987 +    <div class="unitTest" title=":last-of-type selector"></div>
   1.988 +  </div>
   1.989 +
   1.990 +  <div class="test onlyChild">
   1.991 +    <div class="unitTest" title=":only-child where the element is NOT the only child"></div>
   1.992 +    <div class="unitTest" title=":only-child where the element is the only child">
   1.993 +      <div class="unitTest" title=":only-child where the element is the only child"></div>
   1.994 +    </div>
   1.995 +  </div>
   1.996 +
   1.997 +  <div class="test onlyOfType">
   1.998 +    <p class="unitTest" title=":only-of-type"></p>
   1.999 +    <div class="unitTest" title=":only-of-type">
  1.1000 +      <div class="unitTest" title=":only-of-type"></div>
  1.1001 +    </div>
  1.1002 +    <div class="unitTest" title=":not(only-of-type)"></div>
  1.1003 +  </div>
  1.1004 +
  1.1005 +  <div class="test empty">
  1.1006 +    <div class="unitTest isEmpty" title=":empty with empty element"></div>
  1.1007 +    <div class="unitTest isNotEmpty" title=":empty but element contains a whitespace"> </div>
  1.1008 +    <div class="unitTest isEmpty" title=":empty and element contains an SGML comment"><!-- foo --></div>
  1.1009 +    <div class="unitTest isNotEmpty" title=":empty but element contains a SPAN element"><span></span></div>
  1.1010 +    <div class="unitTest isNotEmpty" title=":empty but element contains an entity reference">&nbsp;</div>
  1.1011 +  </div>
  1.1012 +
  1.1013 +  <div class="test lang">
  1.1014 +    <div id="nofragment" class="unitTest" title=":lang() where language comes from the document"></div>
  1.1015 +    <div class="unitTest" lang="fr" title=":lang() where language comes from the element"></div>
  1.1016 +    <div class="unitTest" lang="en-US" title=":lang() where language comes from the element but is a dialect of the language queried"></div>
  1.1017 +    <div class="unitTest t1" lang="es" title=":lang() where language comes from the element but the language queried is a dialect of the element's one so it should not match"></div>
  1.1018 +  </div>
  1.1019 +
  1.1020 +  <div class="test attrLang">
  1.1021 +    <div class="unitTest t1" title="[|=] where language comes from the document"></div>
  1.1022 +    <div class="unitTest" lang="fr" title="[|=] where language comes from the element"></div>
  1.1023 +    <div class="unitTest t2" lang="en-US" title="[|=] where language comes from the element but is a dialect of the language queried"></div>
  1.1024 +    <div class="unitTest t3" lang="es" title="[|=] where language comes from the element but the language queried is a dialect of the element's one so it should not match"></div>
  1.1025 +  </div>
  1.1026 +
  1.1027 +  <div class="test UI">
  1.1028 +    <button name="submit" type="submit" value="submit" class="t1"  title=":enabled pseudo-class"><div class="unitTest"></div></button>
  1.1029 +    <button name="submit" type="submit" value="submit" class="t2" disabled="true"  title=":enabled pseudo-class"><div class="unitTest"></div></button>
  1.1030 +  </div>
  1.1031 +  <div class="test UI">
  1.1032 +    <input class="t3" type="checkbox" checked="true"/><div class="unitTest" title=":checked"></div>
  1.1033 +    the previous square should be green when the checkbox is checked and become red when you uncheck it
  1.1034 +  </div>
  1.1035 +  <div class="test UI">
  1.1036 +    <input class="t4" type="checkbox"/><div class="unitTest" title=":not(:checked)"></div>
  1.1037 +    the previous square should be green when the checkbox is NOT checked and become red when you check it
  1.1038 +  </div>
  1.1039 +
  1.1040 +  <div class="test tilda">
  1.1041 +    <div class="unitTest t1" title="~ combinator"></div>
  1.1042 +    <div class="unitTest" title="~ combinator"></div>
  1.1043 +    <div class="unitTest" title="~ combinator"></div>
  1.1044 +    <div class="unitTest" title="~ combinator"></div>
  1.1045 +    <span style="float:left">the three last squares should be green and become red when the pointer hovers over the white square</span>
  1.1046 +  </div>
  1.1047 +  <div class="test plus">
  1.1048 +    <div class="unitTest t1" title="+ combinator"></div>
  1.1049 +    <div class="unitTest t2" title="+ combinator"></div>
  1.1050 +    <div class="unitTest" title="+ combinator"></div>
  1.1051 +    <span style="float:left">the last square should be green and become red when the pointer hovers over the FIRST white square</span>
  1.1052 +  </div>
  1.1053 +</div>
  1.1054 +<div id="root2">
  1.1055 +  <div class="header">
  1.1056 +    <h3>CSS 3 Selectors tests</h3>
  1.1057 +    <p>(c) <a href="http://www.disruptive-innovations.com">Disruptive Innovations</a> 2008<br/>
  1.1058 +    Last update: 2008-06-06</p>
  1.1059 +  </div>
  1.1060 +
  1.1061 +  <div class="test">
  1.1062 +    <div class="blox1 unitTest" title="childhood selector"></div>
  1.1063 +  </div>
  1.1064 +
  1.1065 +  <div class="test attributeExistence">
  1.1066 +    <div class="blox2 unitTest" align="center" title="attribute existence selector"></div>
  1.1067 +    <div class="blox3 unitTest" align="" title="attribute existence selector with empty string value"></div>
  1.1068 +    <div class="blox4 unitTest" valign="center" title="attribute existence selector with almost identical attribute"></div>
  1.1069 +    <div class="blox5 unitTest" alignv="center" title="attribute existence selector with almost identical attribute"></div>
  1.1070 +  </div>
  1.1071 +
  1.1072 +  <div class="test attributeValue">
  1.1073 +    <div class="blox6 unitTest" align="center" title="attribute value selector"></div>
  1.1074 +    <div class="blox6 unitTest" foo="&eacute;" title="attribute value selector with an entity in the attribute and an escaped value in the selector"></div>
  1.1075 +    <div class="blox6 unitTest" _foo="&eacute;" title="attribute value selector with an entity in the attribute, an escaped value in the selector, and a leading underscore in the attribute name"></div>
  1.1076 +  </div>
  1.1077 +
  1.1078 +  <div class="test attributeSpaceSeparatedValues">
  1.1079 +    <div class="blox7 foo unitTest" title="[~=] attribute selector"></div>
  1.1080 +    <div class="blox8 unitTest" title="[~=] attribute selector looking for empty string"></div>
  1.1081 +    <div class="blox9 unitTest" foo="" title="[~=] attribute selector looking for empty string in empty attribute"></div>
  1.1082 +    <div class="blox10 unitTest" foo="foobar" title="[~=] attribute selector looking for 'foo' in 'foobar'"></div>
  1.1083 +  </div>
  1.1084 +
  1.1085 +  <div class="test attrStart">
  1.1086 +    <div class="unitTest t1" title="[^=] attribute selector"></div>
  1.1087 +    <div class="unitTest t2" title="[^=] attribute selector"></div>
  1.1088 +    <div class="unitTest t3" align="center" title="[^=] attribute selector looking for empty string"></div>
  1.1089 +    <div class="unitTest t4" foo="&eacute;tagada" title="[^=] attribute selector looking for &eacute;"></div>
  1.1090 +  </div>
  1.1091 +
  1.1092 +  <div class="test attrEnd">
  1.1093 +    <div class="unitTest t1" title="[$=] attribute selector"></div>
  1.1094 +    <div class="unitTest t2" title="[$=] attribute selector"></div>
  1.1095 +    <div class="unitTest t3" align="center" title="[$=] attribute selector looking for empty string"></div>
  1.1096 +    <div class="unitTest t4" foo="tagada&eacute;" title="[$=] attribute selector looking for &eacute;"></div>
  1.1097 +  </div>
  1.1098 +
  1.1099 +  <div class="test attrMiddle">
  1.1100 +    <div class="unitTest t1" title="[*=] attribute selector"></div>
  1.1101 +    <div class="unitTest t2" title="[*=] attribute selector"></div>
  1.1102 +    <div class="unitTest t3" align="center" title="[*=] attribute selector looking for empty string"></div>
  1.1103 +    <div class="unitTest t4" foo="tagada&eacute;foo" title="[*=] attribute selector looking for &eacute;"></div>
  1.1104 +  </div>
  1.1105 +
  1.1106 +  <div class="test firstChild">
  1.1107 +    <div class="unitTest" title=":first-child selector"></div>
  1.1108 +    <div class="blox12 unitTest" title=":first-child selector should not match non first child"></div>
  1.1109 +    <div class="blox13 unitTest" title=":first-child selector should not match non first child"></div>
  1.1110 +  </div>
  1.1111 +
  1.1112 +  <div class="test not">
  1.1113 +    <div class="blox14 unitTest" title="negation pseudo-class with argument being an element type selector"></div>
  1.1114 +    <div class="blox15 unitTest" foo="blox15" title="negation pseudo-class with argument being an attribute selector"></div>
  1.1115 +    <div class="blox16 unitTest" foo="blox15" title="negation pseudo-class accepts only simple selectors for argument"></div>
  1.1116 +  </div>
  1.1117 +
  1.1118 +  <div class="test onlyOfType">
  1.1119 +    <div class="blox17 unitTest" title=":only-of-type selector"></div>
  1.1120 +    <p class="blox18 unitTest" title="negated :only-of-type selector"></p>
  1.1121 +    <p class="blox18 unitTest" title="negated :only-of-type selector"></p>
  1.1122 +  </div>
  1.1123 +
  1.1124 +  <div class="test nthchild1">
  1.1125 +    <div class="unitTest" title=":nth-child(odd) selector"></div>
  1.1126 +    <div class="unitTest" title=":nth-last-child(odd) selector"></div>
  1.1127 +    <div class="unitTest" title=":nth-child(odd) selector"></div>
  1.1128 +    <div class="unitTest" title=":nth-last-child(odd) selector"></div>
  1.1129 +    <div class="unitTest" title=":nth-child(odd) selector"></div>
  1.1130 +    <div class="unitTest" title=":nth-last-child(odd) selector"></div>
  1.1131 +  </div>
  1.1132 +  <div class="test nthchild2">
  1.1133 +    <div class="unitTest" title=":nth-last-child(even) selector"></div>
  1.1134 +    <div class="unitTest" title=":nth-child(even) selector"></div>
  1.1135 +    <div class="unitTest" title=":nth-last-child(even) selector"></div>
  1.1136 +    <div class="unitTest" title=":nth-child(even) selector"></div>
  1.1137 +    <div class="unitTest" title=":nth-last-child(even) selector"></div>
  1.1138 +    <div class="unitTest" title=":nth-child(even) selector"></div>
  1.1139 +  </div>
  1.1140 +  <div class="test nthchild3">
  1.1141 +    <div class="unitTest no" title=":nth-last-child(3n+3) selector"></div>
  1.1142 +    <div class="unitTest" title=":nth-child(3n+2) selector"></div>
  1.1143 +    <div class="unitTest no" title=":nth-last-child(3n+1) selector"></div>
  1.1144 +    <div class="unitTest no" title=":nth-last-child(3n+3) selector"></div>
  1.1145 +    <div class="unitTest" title=":nth-child(3n+2) selector"></div>
  1.1146 +    <div class="unitTest no" title=":nth-last-child(3n+1) selector"></div>
  1.1147 +  </div>
  1.1148 +
  1.1149 +  <div class="test nthoftype1">
  1.1150 +    <div class="unitTest" title=":nth-of-type(odd) selector"></div>
  1.1151 +    <p class="unitTest" title=":nth-of-* selector"></p>
  1.1152 +    <p class="unitTest" title=":nth-of-* selector"></p>
  1.1153 +    <div class="unitTest" title=":nth-last-of-type(odd) selector"></div>
  1.1154 +    <p class="unitTest" title=":nth-of-* selector"></p>
  1.1155 +    <div class="unitTest" title=":nth-of-type(odd) selector"></div>
  1.1156 +    <div class="unitTest" title=":nth-last-of-type(odd) selector"></div>
  1.1157 +  </div>
  1.1158 +  <div class="test nthoftype2">
  1.1159 +    <div class="unitTest" title=":nth-last-of-type(even) selector"></div>
  1.1160 +    <p class="unitTest" title=":nth-of-* selector"></p>
  1.1161 +    <p class="unitTest" title=":nth-of-* selector"></p>
  1.1162 +    <div class="unitTest" title=":nth-of-type(even) selector"></div>
  1.1163 +    <p class="unitTest" title=":nth-of-* selector"></p>
  1.1164 +    <div class="unitTest" title=":nth-last-of-type(even) selector"></div>
  1.1165 +    <div class="unitTest" title=":nth-of-type(even) selector"></div>
  1.1166 +  </div>
  1.1167 +  <div class="test nthoftype3">
  1.1168 +    <div class="unitTest" title=":nth-of-type(3n+1) selector"></div>
  1.1169 +    <p class="unitTest" title=":nth-of-* selector"></p>
  1.1170 +    <p class="unitTest" title=":nth-of-* selector"></p>
  1.1171 +    <div class="unitTest" title=":nth-last-of-type(3n+2) selector"></div>
  1.1172 +    <p class="unitTest" title=":nth-of-* selector"></p>
  1.1173 +    <div class="unitTest" title=":nth-last-of-type(3n+1) selector"></div>
  1.1174 +    <div class="unitTest" title=":nth-of-type(3n+1) selector"></div>
  1.1175 +    <p class="unitTest" title=":nth-of-* selector"></p>
  1.1176 +    <div class="unitTest" title=":nth-last-of-type(3n+2) selector"></div>
  1.1177 +    <div class="unitTest" title=":nth-last-of-type(3n+1) selector"></div>
  1.1178 +  </div>
  1.1179 +
  1.1180 +  <div class="test lastChild">
  1.1181 +    <p class="unitTest" title=":not(:last-child) selector"></p>
  1.1182 +    <div class="unitTest" title=":last-child selector"></div>&nbsp;
  1.1183 +  </div>
  1.1184 +
  1.1185 +  <div class="test firstOfType">
  1.1186 +    <p class="unitTest" title=":first-of-type selector"></p>
  1.1187 +    <div class="unitTest" title=":first-of-type selector"></div>
  1.1188 +    <p class="unitTest" title=":not(:first-of-type)"></p>
  1.1189 +    <div class="unitTest" title=":not(:first-of-type)"></div>
  1.1190 +  </div>
  1.1191 +
  1.1192 +  <div class="test lastOfType">
  1.1193 +    <p class="unitTest" title=":not(:last-of-type)"></p>
  1.1194 +    <div class="unitTest" title=":not(:last-of-type)"></div>
  1.1195 +    <p class="unitTest" title=":last-of-type selector"></p>
  1.1196 +    <div class="unitTest" title=":last-of-type selector"></div>
  1.1197 +  </div>
  1.1198 +
  1.1199 +  <div class="test onlyChild">
  1.1200 +    <div class="unitTest" title=":only-child where the element is NOT the only child"></div>
  1.1201 +    <div class="unitTest" title=":only-child where the element is the only child">
  1.1202 +      <div class="unitTest" title=":only-child where the element is the only child"></div>
  1.1203 +    </div>
  1.1204 +  </div>
  1.1205 +
  1.1206 +  <div class="test onlyOfType">
  1.1207 +    <p class="unitTest" title=":only-of-type"></p>
  1.1208 +    <div class="unitTest" title=":only-of-type">
  1.1209 +      <div class="unitTest" title=":only-of-type"></div>
  1.1210 +    </div>
  1.1211 +    <div class="unitTest" title=":not(only-of-type)"></div>
  1.1212 +  </div>
  1.1213 +
  1.1214 +  <div class="test empty">
  1.1215 +    <div class="unitTest isEmpty" title=":empty with empty element"></div>
  1.1216 +    <div class="unitTest isNotEmpty" title=":empty but element contains a whitespace"> </div>
  1.1217 +    <div class="unitTest isEmpty" title=":empty and element contains an SGML comment"><!-- foo --></div>
  1.1218 +    <div class="unitTest isNotEmpty" title=":empty but element contains a SPAN element"><span></span></div>
  1.1219 +    <div class="unitTest isNotEmpty" title=":empty but element contains an entity reference">&nbsp;</div>
  1.1220 +  </div>
  1.1221 +
  1.1222 +  <div class="test lang">
  1.1223 +    <div id="nofragment" class="unitTest" title=":lang() where language comes from the document"></div>
  1.1224 +    <div class="unitTest" lang="fr" title=":lang() where language comes from the element"></div>
  1.1225 +    <div class="unitTest" lang="en-US" title=":lang() where language comes from the element but is a dialect of the language queried"></div>
  1.1226 +    <div class="unitTest t1" lang="es" title=":lang() where language comes from the element but the language queried is a dialect of the element's one so it should not match"></div>
  1.1227 +  </div>
  1.1228 +
  1.1229 +  <div class="test attrLang">
  1.1230 +    <div class="unitTest t1" title="[|=] where language comes from the document"></div>
  1.1231 +    <div class="unitTest" lang="fr" title="[|=] where language comes from the element"></div>
  1.1232 +    <div class="unitTest t2" lang="en-US" title="[|=] where language comes from the element but is a dialect of the language queried"></div>
  1.1233 +    <div class="unitTest t3" lang="es" title="[|=] where language comes from the element but the language queried is a dialect of the element's one so it should not match"></div>
  1.1234 +  </div>
  1.1235 +
  1.1236 +  <div class="test UI">
  1.1237 +    <button name="submit" type="submit" value="submit" class="t1"  title=":enabled pseudo-class"><div class="unitTest"></div></button>
  1.1238 +    <button name="submit" type="submit" value="submit" class="t2" disabled="true"  title=":enabled pseudo-class"><div class="unitTest"></div></button>
  1.1239 +  </div>
  1.1240 +  <div class="test UI">
  1.1241 +    <input class="t3" type="checkbox" checked="true"/><div class="unitTest" title=":checked"></div>
  1.1242 +    the previous square should be green when the checkbox is checked and become red when you uncheck it
  1.1243 +  </div>
  1.1244 +  <div class="test UI">
  1.1245 +    <input class="t4" type="checkbox"/><div class="unitTest" title=":not(:checked)"></div>
  1.1246 +    the previous square should be green when the checkbox is NOT checked and become red when you check it
  1.1247 +  </div>
  1.1248 +
  1.1249 +  <div class="test tilda">
  1.1250 +    <div class="unitTest t1" title="~ combinator"></div>
  1.1251 +    <div class="unitTest" title="~ combinator"></div>
  1.1252 +    <div class="unitTest" title="~ combinator"></div>
  1.1253 +    <div class="unitTest" title="~ combinator"></div>
  1.1254 +    <span style="float:left">the three last squares should be green and become red when the pointer hovers over the white square</span>
  1.1255 +  </div>
  1.1256 +  <div class="test plus">
  1.1257 +    <div class="unitTest t1" title="+ combinator"></div>
  1.1258 +    <div class="unitTest t2" title="+ combinator"></div>
  1.1259 +    <div class="unitTest" title="+ combinator"></div>
  1.1260 +    <span style="float:left">the last square should be green and become red when the pointer hovers over the FIRST white square</span>
  1.1261 +  </div>
  1.1262 +</div>
  1.1263 +<div id="root3">
  1.1264 +  <div id="svgs">
  1.1265 +  <!-- svg elements, but in the xhtml namespace -->
  1.1266 +  <svg width="12cm" height="4cm" viewBox="0 0 1200 400" version="1.1" id="svg1">
  1.1267 +    <desc id="desc1">Example circle01 - circle filled with red and stroked with blue</desc>
  1.1268 +    <rect id="rect1" x="1" y="1" width="1198" height="398" fill="none" stroke="blue" stroke-width="2"/>
  1.1269 +    <circle id="circle1" cx="600" cy="200" r="100" fill="red" stroke="blue" stroke-width="10"  />
  1.1270 +  </svg>
  1.1271 +  <!-- svg elements using svg: -->
  1.1272 +  <svg:svg width="12cm" height="4cm" viewBox="0 0 1200 400" version="1.1" id="svg2">
  1.1273 +    <svg:desc id="desc2">Example circle01 - circle filled with red and stroked with blue</svg:desc>
  1.1274 +    <svg:rect id="rect2" x="1" y="1" width="1198" height="398" fill="none" stroke="blue" stroke-width="2"/>
  1.1275 +    <svg:circle id="circle2" cx="600" cy="200" r="100" fill="red" stroke="blue" stroke-width="10"  />
  1.1276 +  </svg:svg>
  1.1277 +  <!-- svg using an inline xmlns -->
  1.1278 +  <svg width="12cm" height="4cm" viewBox="0 0 1200 400" xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg3">
  1.1279 +    <desc id="desc3">Example circle01 - circle filled with red and stroked with blue</desc>
  1.1280 +    <rect id="rect3" x="1" y="1" width="1198" height="398" fill="none" stroke="blue" stroke-width="2"/>
  1.1281 +    <circle id="circle3" cx="600" cy="200" r="100" fill="red" stroke="blue" stroke-width="10"  />
  1.1282 +  </svg>
  1.1283 +  </div>
  1.1284 +
  1.1285 +  <h1 id="header">jQuery Test Suite</h1>
  1.1286 +  <h2 id="banner"></h2>
  1.1287 +  <h2 id="userAgent"></h2>
  1.1288 +  
  1.1289 +  <!-- Test HTML -->
  1.1290 +  <div id="nothiddendiv" style="height:1px;background:white;">
  1.1291 +
  1.1292 +    <div id="nothiddendivchild"></div>
  1.1293 +  </div>
  1.1294 +  <!-- Test for scoping -->
  1.1295 +  <nosuchtag id="outerbogustag">
  1.1296 +    <nosuchtag id="innerbogustag"></nosuchtag>
  1.1297 +  </nosuchtag>
  1.1298 +  <!-- this iframe is outside the #main so it won't reload constantly wasting time, but it means the tests must be "safe" and clean up after themselves -->
  1.1299 +  <iframe id="loadediframe" name="loadediframe" style="display:none;" src="data/iframe.html"></iframe>
  1.1300 +  <dl id="dl" style="display:none;">
  1.1301 +  <div id="main" style="display: none;">
  1.1302 +    <p id="firstp">See <a id="simon1" href="http://simon.incutio.com/archive/2003/03/25/#getElementsBySelector" rel="bookmark">this blog entry</a> for more information.</p>
  1.1303 +
  1.1304 +    <p id="ap">
  1.1305 +      Here are some links in a normal paragraph: <a id="google" href="http://www.google.com/" title="Google!">Google</a>, 
  1.1306 +      <a id="groups" href="http://groups.google.com/">Google Groups</a>. 
  1.1307 +      This link has <code><a href="http://smin" id="anchor1">class="blog"</a></code>: 
  1.1308 +      <a href="http://diveintomark.org/" class="blog" hreflang="en" id="mark">diveintomark</a>
  1.1309 +
  1.1310 +    </p>
  1.1311 +    <div id="foo">
  1.1312 +
  1.1313 +      <p id="sndp">Everything inside the red border is inside a div with <code>id="foo"</code>.</p>
  1.1314 +      <p lang="en" id="en">This is a normal link: <a id="yahoo" href="http://www.yahoo.com/" class="blogTest">Yahoo</a></p>
  1.1315 +      <p id="sap">This link has <code><a href="#2" id="anchor2">class="blog"</a></code>: <a href="http://simon.incutio.com/" class="blog link" id="simon">Simon Willison's Weblog</a></p>
  1.1316 +
  1.1317 +    </div>
  1.1318 +
  1.1319 +    <p id="first">Try them out:</p>
  1.1320 +    <ul id="firstUL"></ul>
  1.1321 +    <ol id="empty"></ol>
  1.1322 +    <form id="form" action="formaction">
  1.1323 +      <input type="text" name="action" value="Test" id="text1" maxlength="30"/>
  1.1324 +      <input type="text" name="text2" value="Test" id="text2" disabled="disabled"/>
  1.1325 +      <input type="radio" name="radio1" id="radio1" value="on"/>
  1.1326 +
  1.1327 +      <input type="radio" name="radio2" id="radio2" checked="checked"/>
  1.1328 +
  1.1329 +      <input type="checkbox" name="check" id="check1" checked="checked"/>
  1.1330 +      <input type="checkbox" id="check2" value="on"/>
  1.1331 +
  1.1332 +      <input type="hidden" name="hidden" id="hidden1"/>
  1.1333 +      <input type="text" style="display:none;" name="foo[bar]" id="hidden2"/>
  1.1334 +      
  1.1335 +      <input type="text" id="name" name="name" value="name" />
  1.1336 +      
  1.1337 +      <button id="button" name="button">Button</button>
  1.1338 +      
  1.1339 +      <textarea id="area1" maxlength="30">foobar</textarea>
  1.1340 +
  1.1341 +      
  1.1342 +      <select name="select1" id="select1">
  1.1343 +        <option id="option1a" class="emptyopt" value="">Nothing</option>
  1.1344 +        <option id="option1b" value="1">1</option>
  1.1345 +        <option id="option1c" value="2">2</option>
  1.1346 +        <option id="option1d" value="3">3</option>
  1.1347 +      </select>
  1.1348 +      <select name="select2" id="select2">
  1.1349 +
  1.1350 +        <option id="option2a" class="emptyopt" value="">Nothing</option>
  1.1351 +        <option id="option2b" value="1">1</option>
  1.1352 +        <option id="option2c" value="2">2</option>
  1.1353 +        <option id="option2d" selected="selected" value="3">3</option>
  1.1354 +      </select>
  1.1355 +      <select name="select3" id="select3" multiple="multiple">
  1.1356 +        <option id="option3a" class="emptyopt" value="">Nothing</option>
  1.1357 +
  1.1358 +        <option id="option3b" selected="selected" value="1">1</option>
  1.1359 +        <option id="option3c" selected="selected" value="2">2</option>
  1.1360 +        <option id="option3d" value="3">3</option>
  1.1361 +      </select>
  1.1362 +      
  1.1363 +      <object id="object1" codebase="stupid">
  1.1364 +        <param name="p1" value="x1" />
  1.1365 +        <param name="p2" value="x2" />
  1.1366 +
  1.1367 +      </object>
  1.1368 +      
  1.1369 +      <span id="台北Táiběi"></span>
  1.1370 +      <span id="台北" lang="中文"></span>
  1.1371 +      <span id="utf8class1" class="台北Táiběi 台北"></span>
  1.1372 +      <span id="utf8class2" class="台北"></span>
  1.1373 +      <span id="foo:bar" class="foo:bar"></span>
  1.1374 +      <span id="test.foo[5]bar" class="test.foo[5]bar"></span>
  1.1375 +      
  1.1376 +      <foo_bar id="foobar">test element</foo_bar>
  1.1377 +
  1.1378 +    </form>
  1.1379 +    <b id="floatTest">Float test.</b>
  1.1380 +    <iframe id="iframe" name="iframe"></iframe>
  1.1381 +    <form id="lengthtest">
  1.1382 +      <input type="text" id="length" name="test"/>
  1.1383 +      <input type="text" id="idTest" name="id"/>
  1.1384 +    </form>
  1.1385 +    <table id="table"></table>
  1.1386 +
  1.1387 +    
  1.1388 +    <div id="fx-queue">
  1.1389 +      <div id="fadein" class='chain test'>fadeIn<div>fadeIn</div></div>
  1.1390 +      <div id="fadeout" class='chain test out'>fadeOut<div>fadeOut</div></div>
  1.1391 +      
  1.1392 +      <div id="show" class='chain test'>show<div>show</div></div>
  1.1393 +      <div id="hide" class='chain test out'>hide<div>hide</div></div>
  1.1394 +
  1.1395 +      
  1.1396 +      <div id="togglein" class='chain test'>togglein<div>togglein</div></div>
  1.1397 +      <div id="toggleout" class='chain test out'>toggleout<div>toggleout</div></div>
  1.1398 +    
  1.1399 +      
  1.1400 +      <div id="slideup" class='chain test'>slideUp<div>slideUp</div></div>
  1.1401 +      <div id="slidedown" class='chain test out'>slideDown<div>slideDown</div></div>
  1.1402 +      
  1.1403 +      <div id="slidetogglein" class='chain test'>slideToggleIn<div>slideToggleIn</div></div>
  1.1404 +
  1.1405 +      <div id="slidetoggleout" class='chain test out'>slideToggleOut<div>slideToggleOut</div></div>
  1.1406 +    </div>
  1.1407 +    
  1.1408 +    <div id="fx-tests"></div>
  1.1409 +
  1.1410 +    <form id="testForm" action="#" method="get">
  1.1411 +      <textarea name="T3" rows="2" cols="15">?
  1.1412 +Z</textarea>
  1.1413 +      <input type="hidden" name="H1" value="x" />
  1.1414 +      <input type="hidden" name="H2" />
  1.1415 +
  1.1416 +      <input name="PWD" type="password" value="" />
  1.1417 +      <input name="T1" type="text" />
  1.1418 +      <input name="T2" type="text" value="YES" readonly="readonly" />
  1.1419 +      <input type="checkbox" name="C1" value="1" />
  1.1420 +      <input type="checkbox" name="C2" />
  1.1421 +      <input type="radio" name="R1" value="1" />
  1.1422 +      <input type="radio" name="R1" value="2" />
  1.1423 +      <input type="text" name="My Name" value="me" />
  1.1424 +      <input type="reset" name="reset" value="NO" />
  1.1425 +
  1.1426 +      <select name="S1">
  1.1427 +        <option value="abc">ABC</option>
  1.1428 +        <option value="abc">ABC</option>
  1.1429 +        <option value="abc">ABC</option>
  1.1430 +      </select>
  1.1431 +      <select name="S2" multiple="multiple" size="3">
  1.1432 +        <option value="abc">ABC</option>
  1.1433 +
  1.1434 +        <option value="abc">ABC</option>
  1.1435 +        <option value="abc">ABC</option>
  1.1436 +      </select>
  1.1437 +      <select name="S3">
  1.1438 +        <option selected="selected">YES</option>
  1.1439 +      </select>
  1.1440 +      <select name="S4">
  1.1441 +
  1.1442 +        <option value="" selected="selected">NO</option>
  1.1443 +      </select>
  1.1444 +      <input type="submit" name="sub1" value="NO" />
  1.1445 +      <input type="submit" name="sub2" value="NO" />
  1.1446 +      <input type="image" name="sub3" value="NO" />
  1.1447 +      <button name="sub4" type="submit" value="NO">NO</button>
  1.1448 +      <input name="D1" type="text" value="NO" disabled="disabled" />
  1.1449 +      <input type="checkbox" checked="checked" disabled="disabled" name="D2" value="NO" />
  1.1450 +
  1.1451 +      <input type="radio" name="D3" value="NO" checked="checked" disabled="disabled" />
  1.1452 +      <select name="D4" disabled="disabled">
  1.1453 +        <option selected="selected" value="NO">NO</option>
  1.1454 +      </select>
  1.1455 +    </form>
  1.1456 +    <div id="moretests">
  1.1457 +      <form>
  1.1458 +        <div id="checkedtest" style="display:none;">
  1.1459 +
  1.1460 +          <input type="radio" name="checkedtestradios" checked="checked"/>
  1.1461 +          <input type="radio" name="checkedtestradios" value="on"/>
  1.1462 +          <input type="checkbox" name="checkedtestcheckboxes" checked="checked"/>
  1.1463 +          <input type="checkbox" name="checkedtestcheckboxes" />
  1.1464 +        </div>
  1.1465 +      </form>
  1.1466 +      <div id="nonnodes"><span>hi</span> there <!-- mon ami --></div>
  1.1467 +
  1.1468 +      <div id="t2037">
  1.1469 +        <div><div class="hidden">hidden</div></div>
  1.1470 +      </div>
  1.1471 +    </div>
  1.1472 +  </div>
  1.1473 +  </dl>
  1.1474 +  
  1.1475 +  <ol id="tests"></ol>
  1.1476 +</div>
  1.1477 +<ol id="results"></ol>
  1.1478 +</body>
  1.1479 +</html>

mercurial