diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2019-06-26 21:39:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-26 21:39:10 +0200 |
commit | 79b74e043a4ee737d44a95094ff1184e40bd5b16 (patch) | |
tree | 200b55efd1a472e7b3036c1e1ecf6b6afe96a317 /test/data | |
parent | 438b1a3e8a52d3e4efd8aba45498477038849c97 (diff) | |
download | jquery-79b74e043a4ee737d44a95094ff1184e40bd5b16.tar.gz jquery-79b74e043a4ee737d44a95094ff1184e40bd5b16.zip |
Selector: Port Sizzle tests to jQuery
Apart from porting most Sizzle tests to jQuery (mostly to its selector module),
this commit fixes selector-native so that a jQuery custom compilation that
excludes Sizzle passes all tests as well.
Closes gh-4406
Diffstat (limited to 'test/data')
-rw-r--r-- | test/data/qunit-fixture.html | 79 | ||||
-rw-r--r-- | test/data/qunit-fixture.js | 2 | ||||
-rw-r--r-- | test/data/selector/mixed_sort.html | 23 | ||||
-rw-r--r-- | test/data/testinit.js | 40 |
4 files changed, 129 insertions, 15 deletions
diff --git a/test/data/qunit-fixture.html b/test/data/qunit-fixture.html index e0fd3e60e..7564311a3 100644 --- a/test/data/qunit-fixture.html +++ b/test/data/qunit-fixture.html @@ -1,8 +1,8 @@ <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> <p id="ap"> - Here are some links in a normal paragraph: <a id="google" href="http://www.google.com/" title="Google!">Google</a>, + Here are some [links] in a normal paragraph: <a id="google" href="http://www.google.com/" title="Google!">Google</a>, <a id="groups" href="http://groups.google.com/" class="GROUPS">Google Groups (Link)</a>. - This link has <code><a href="http://smin" id="anchor1">class="blog"</a></code>: + This link has <code id="code1"><a href="http://smin" id="anchor1">class="blog"</a></code>: <a href="http://diveintomark.org/" class="blog" hreflang="en" id="mark">diveintomark</a> </p> @@ -78,11 +78,11 @@ <param name="p2" value="x2" /> </object> - <span id="台北Táiběi"></span> + <span id="台北Táiběi"><span id="台北Táiběi-child"></span></span> <span id="台北" lang="中文"></span> - <span id="utf8class1" class="台北Táiběi 台北"></span> + <span id="utf8class1" class="台北Táiběi 台北">"'台北Táiběi"'</span> <span id="utf8class2" class="台北"></span> - <span id="foo:bar" class="foo:bar"></span> + <span id="foo:bar" class="foo:bar"><span id="foo_descendant"></span></span> <span id="test.foo[5]bar" class="test.foo[5]bar"></span> <foo_bar id="foobar">test element</foo_bar> @@ -163,7 +163,26 @@ Z</textarea> <div id="t6652"> <div></div> </div> + <div id="t12087"> + <input type="hidden" id="el12087" data-comma="0,1"/> + </div> <div id="no-clone-exception"><object><embed></embed></object></div> + <div id="names-group"> + <span id="name-is-example" name="example"></span> + <span id="name-is-div" name="div"></span> + </div> + <div id="id-name-tests"> + <a id="tName1ID" name="tName1"><span></span></a> + <a id="tName2ID" name="tName2"><span></span></a> + <div id="tName1"><span id="tName1-span">C</span></div> + </div> + <div id="whitespace-lists"> + <input id="t15233-single" data-15233="foo"/> + <input id="t15233-double" data-15233="foo bar"/> + <input id="t15233-double-tab" data-15233="foo bar"/> + <input id="t15233-double-nl" data-15233="foo
bar"/> + <input id="t15233-triple" data-15233="foo bar baz"/> + </div> </div> <div id="tabindex-tests"> @@ -194,6 +213,53 @@ Z</textarea> <span id="liveSpan2"><a href="#" id="liveLink2"></a></span> </div> +<form id="disabled-tests"> + <fieldset id="disabled-fieldset" disabled="disabled"> + <a id="disabled-fieldset-a" href="#"></a> + <input id="disabled-fieldset-input" name="disabled-fieldset-input" type="text" /> + <textarea id="disabled-fieldset-textarea" name="disabled-fieldset-textarea" ></textarea> + <button id="disabled-fieldset-button" name="disabled-fieldset-button">Go</button> + <!-- exclude <select> because IE6 is bugged and fails + <select id="disabled-fieldset-select" name="disabled-fieldset-select"></select> + --> + <span id="disabled-fieldset-span">Neither enabled nor disabled</span> + </fieldset> + <fieldset id="enabled-fieldset"> + <a id="disabled-a" href="#" disabled="disabled"></a> + <input id="disabled-input" name="disabled-input" type="text" disabled="disabled"/> + <textarea id="disabled-textarea" name="disabled-textarea" disabled="disabled"></textarea> + <button id="disabled-button" name="disabled-button" disabled="disabled">Go</button> + <select id="disabled-select" name="disabled-select" disabled="disabled"> + <optgroup id="disabled-optgroup" label="and" disabled="disabled"> + <option id="disabled-option" disabled="disabled">Black</option> + </optgroup> + </select> + <input id="enabled-input" name="enabled-input" type="text"/> + <textarea id="enabled-textarea" name="enabled-textarea"></textarea> + <button id="enabled-button" name="enabled-button">Go</button> + <select id="enabled-select" name="enabled-select"> + <optgroup id="enabled-optgroup" label="and"> + <option id="enabled-option">Gold</option> + </optgroup> + </select> + <span id="enabled-fieldset-span">Neither enabled nor disabled</span> + </fieldset> + <select id="disabled-select-inherit" name="disabled-select-inherit" disabled="disabled"> + <optgroup id="disabled-optgroup-inherit" label="and" disabled="disabled"> + <option id="disabled-optgroup-option">Black</option> + </optgroup> + <optgroup id="enabled-optgroup-inherit" label="and"> + <option id="enabled-optgroup-option">Gold</option> + </optgroup> + </select> + <select id="enabled-select-inherit" name="enabled-select-inherit"> + <optgroup id="en_disabled-optgroup-inherit" label="and" disabled="disabled"> + <option id="en_disabled-optgroup-option">Black</option> + </optgroup> + <option id="enabled-select-option">Black</option> + </select> +</form> + <div id="siblingTest"> <em id="siblingfirst">1</em> <em id="siblingnext">2</em> @@ -208,7 +274,7 @@ Z</textarea> </div> <div id="fx-test-group" style="position: absolute; width: 1px; height: 1px; overflow: hidden;"> <div id="fx-queue" name="test"> - <div id="fadein" class='chain-test' name='div'>fadeIn<div>fadeIn</div></div> + <div id="fadein" class='chain-test'>fadeIn<div>fadeIn</div></div> <div id="fadeout" class='chain-test chain-test-out'>fadeOut<div>fadeOut</div></div> <div id="show" class='chain-test'>show<div>show</div></div> @@ -235,3 +301,4 @@ Z</textarea> <div id="fx-tests"></div> <span id="display"></span> </div> +<br id="last"/> diff --git a/test/data/qunit-fixture.js b/test/data/qunit-fixture.js index 46f0c3c26..54e57f408 100644 --- a/test/data/qunit-fixture.js +++ b/test/data/qunit-fixture.js @@ -1,2 +1,2 @@ // Generated by build/tasks/qunit_fixture.js -QUnit.config.fixture = "<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>\n<p id=\"ap\">\n\tHere are some links in a normal paragraph: <a id=\"google\" href=\"http://www.google.com/\" title=\"Google!\">Google</a>,\n\t<a id=\"groups\" href=\"http://groups.google.com/\" class=\"GROUPS\">Google Groups (Link)</a>.\n\tThis link has <code><a href=\"http://smin\" id=\"anchor1\">class=\"blog\"</a></code>:\n\t<a href=\"http://diveintomark.org/\" class=\"blog\" hreflang=\"en\" id=\"mark\">diveintomark</a>\n\n</p>\n<div id=\"foo\">\n\t<p id=\"sndp\">Everything inside the red border is inside a div with <code>id=\"foo\"</code>.</p>\n\t<p lang=\"en\" id=\"en\">This is a normal link: <a id=\"yahoo\" href=\"http://www.yahoo.com/\" class=\"blogTest\">Yahoo</a></p>\n\t<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>\n\n</div>\n<div id=\"nothiddendiv\" style=\"height:1px;background:white;\" class=\"nothiddendiv\">\n\t<div id=\"nothiddendivchild\"></div>\n</div>\n<span id=\"name+value\"></span>\n<p id=\"first\">Try them out:</p>\n<ul id=\"firstUL\"></ul>\n<ol id=\"empty\"></ol>\n<form id=\"form\" action=\"formaction\">\n\t<label for=\"action\" id=\"label-for\">Action:</label>\n\t<input type=\"text\" name=\"action\" value=\"Test\" id=\"text1\" maxlength=\"30\"/>\n\t<input type=\"text\" name=\"text2\" value=\"Test\" id=\"text2\" disabled=\"disabled\"/>\n\t<input type=\"radio\" name=\"radio1\" id=\"radio1\" value=\"on\"/>\n\n\t<input type=\"radio\" name=\"radio2\" id=\"radio2\" checked=\"checked\"/>\n\t<input type=\"checkbox\" name=\"check\" id=\"check1\" checked=\"checked\"/>\n\t<input type=\"checkbox\" id=\"check2\" value=\"on\"/>\n\n\t<input type=\"hidden\" name=\"hidden\" id=\"hidden1\"/>\n\t<input type=\"text\" style=\"display:none;\" name=\"foo[bar]\" id=\"hidden2\"/>\n\n\t<input type=\"text\" id=\"name\" name=\"name\" value=\"name\" />\n\t<input type=\"search\" id=\"search\" name=\"search\" value=\"search\" />\n\n\t<button id=\"button\" name=\"button\" type=\"button\">Button</button>\n\n\t<textarea id=\"area1\" maxlength=\"30\">foobar</textarea>\n\n\t<select name=\"select1\" id=\"select1\">\n\t\t<option id=\"option1a\" class=\"emptyopt\" value=\"\">Nothing</option>\n\t\t<option id=\"option1b\" value=\"1\">1</option>\n\t\t<option id=\"option1c\" value=\"2\">2</option>\n\t\t<option id=\"option1d\" value=\"3\">3</option>\n\t</select>\n\t<select name=\"select2\" id=\"select2\">\n\t\t<option id=\"option2a\" class=\"emptyopt\" value=\"\">Nothing</option>\n\t\t<option id=\"option2b\" value=\"1\">1</option>\n\t\t<option id=\"option2c\" value=\"2\">2</option>\n\t\t<option id=\"option2d\" selected=\"selected\" value=\"3\">3</option>\n\t</select>\n\t<select name=\"select3\" id=\"select3\" multiple=\"multiple\">\n\t\t<option id=\"option3a\" class=\"emptyopt\" value=\"\">Nothing</option>\n\t\t<option id=\"option3b\" selected=\"selected\" value=\"1\">1</option>\n\t\t<option id=\"option3c\" selected=\"selected\" value=\"2\">2</option>\n\t\t<option id=\"option3d\" value=\"3\">3</option>\n\t\t<option id=\"option3e\">no value</option>\n\t</select>\n\t<select name=\"select4\" id=\"select4\" multiple=\"multiple\">\n\t\t<optgroup disabled=\"disabled\">\n\t\t\t<option id=\"option4a\" class=\"emptyopt\" value=\"\">Nothing</option>\n\t\t\t<option id=\"option4b\" disabled=\"disabled\" selected=\"selected\" value=\"1\">1</option>\n\t\t\t<option id=\"option4c\" selected=\"selected\" value=\"2\">2</option>\n\t\t</optgroup>\n\t\t<option selected=\"selected\" disabled=\"disabled\" id=\"option4d\" value=\"3\">3</option>\n\t\t<option id=\"option4e\">no value</option>\n\t</select>\n\t<select name=\"select5\" id=\"select5\">\n\t\t<option id=\"option5a\" value=\"3\">1</option>\n\t\t<option id=\"option5b\" value=\"2\">2</option>\n\t\t<option id=\"option5c\" value=\"1\" data-attr=\"\">3</option>\n\t</select>\n\n\t<object id=\"object1\" codebase=\"stupid\">\n\t\t<param name=\"p1\" value=\"x1\" />\n\t\t<param name=\"p2\" value=\"x2\" />\n\t</object>\n\n\t<span id=\"台北Táiběi\"></span>\n\t<span id=\"台北\" lang=\"中文\"></span>\n\t<span id=\"utf8class1\" class=\"台北Táiběi 台北\"></span>\n\t<span id=\"utf8class2\" class=\"台北\"></span>\n\t<span id=\"foo:bar\" class=\"foo:bar\"></span>\n\t<span id=\"test.foo[5]bar\" class=\"test.foo[5]bar\"></span>\n\n\t<foo_bar id=\"foobar\">test element</foo_bar>\n</form>\n<b id=\"floatTest\">Float test.</b>\n<iframe id=\"iframe\" name=\"iframe\"></iframe>\n<form id=\"lengthtest\">\n\t<input type=\"text\" id=\"length\" name=\"test\"/>\n\t<input type=\"text\" id=\"idTest\" name=\"id\"/>\n</form>\n<table id=\"table\"></table>\n\n<form id=\"name-tests\">\n\t<!-- Inputs with a grouped name attribute. -->\n\t<input name=\"types[]\" id=\"types_all\" type=\"checkbox\" value=\"all\" />\n\t<input name=\"types[]\" id=\"types_anime\" type=\"checkbox\" value=\"anime\" />\n\t<input name=\"types[]\" id=\"types_movie\" type=\"checkbox\" value=\"movie\" />\n</form>\n\n<form id=\"testForm\" action=\"#\" method=\"get\">\n\t<textarea name=\"T3\" rows=\"2\" cols=\"15\">?\nZ</textarea>\n\t<input type=\"hidden\" name=\"H1\" value=\"x\" />\n\t<input type=\"hidden\" name=\"H2\" />\n\t<input name=\"PWD\" type=\"password\" value=\"\" />\n\t<input name=\"T1\" type=\"text\" />\n\t<input name=\"T2\" type=\"text\" value=\"YES\" readonly=\"readonly\" />\n\t<input type=\"checkbox\" name=\"C1\" value=\"1\" />\n\t<input type=\"checkbox\" name=\"C2\" />\n\t<input type=\"radio\" name=\"R1\" value=\"1\" />\n\t<input type=\"radio\" name=\"R1\" value=\"2\" />\n\t<input type=\"text\" name=\"My Name\" value=\"me\" />\n\t<input type=\"reset\" name=\"reset\" value=\"NO\" />\n\t<select name=\"S1\">\n\t\t<option value=\"abc\">ABC</option>\n\t\t<option value=\"abc\">ABC</option>\n\t\t<option value=\"abc\">ABC</option>\n\t</select>\n\t<select name=\"S2\" multiple=\"multiple\" size=\"3\">\n\t\t<option value=\"abc\">ABC</option>\n\t\t<option value=\"abc\">ABC</option>\n\t\t<option value=\"abc\">ABC</option>\n\t</select>\n\t<select name=\"S3\">\n\t\t<option selected=\"selected\">YES</option>\n\t</select>\n\t<select name=\"S4\">\n\t\t<option value=\"\" selected=\"selected\">NO</option>\n\t</select>\n\t<input type=\"submit\" name=\"sub1\" value=\"NO\" />\n\t<input type=\"submit\" name=\"sub2\" value=\"NO\" />\n\t<input type=\"image\" name=\"sub3\" value=\"NO\" />\n\t<button name=\"sub4\" type=\"submit\" value=\"NO\">NO</button>\n\t<input name=\"D1\" type=\"text\" value=\"NO\" disabled=\"disabled\" />\n\t<input type=\"checkbox\" checked=\"checked\" disabled=\"disabled\" name=\"D2\" value=\"NO\" />\n\t<input type=\"radio\" name=\"D3\" value=\"NO\" checked=\"checked\" disabled=\"disabled\" />\n\t<select name=\"D4\" disabled=\"disabled\">\n\t\t<option selected=\"selected\" value=\"NO\">NO</option>\n\t</select>\n\t<input id=\"list-test\" type=\"text\" />\n\t<datalist id=\"datalist\">\n\t\t<option value=\"option\"></option>\n\t</datalist>\n</form>\n<div id=\"moretests\">\n\t<form>\n\t\t<div id=\"checkedtest\" style=\"display:none;\">\n\t\t\t<input type=\"radio\" name=\"checkedtestradios\" checked=\"checked\"/>\n\t\t\t<input type=\"radio\" name=\"checkedtestradios\" value=\"on\"/>\n\t\t\t<input type=\"checkbox\" name=\"checkedtestcheckboxes\" checked=\"checked\"/>\n\t\t\t<input type=\"checkbox\" name=\"checkedtestcheckboxes\" />\n\t\t</div>\n\t</form>\n\t<div id=\"nonnodes\"><span id=\"nonnodesElement\">hi</span> there <!-- mon ami --></div>\n\t<div id=\"t2037\">\n\t\t<div><div class=\"hidden\">hidden</div></div>\n\t</div>\n\t<div id=\"t6652\">\n\t\t<div></div>\n\t</div>\n\t<div id=\"no-clone-exception\"><object><embed></embed></object></div>\n</div>\n\n<div id=\"tabindex-tests\">\n\t<ol id=\"listWithTabIndex\" tabindex=\"5\">\n\t\t<li id=\"foodWithNegativeTabIndex\" tabindex=\"-1\">Rice</li>\n\t\t<li id=\"foodNoTabIndex\">Beans</li>\n\t\t<li>Blinis</li>\n\t\t<li>Tofu</li>\n\t</ol>\n\n\t<div id=\"divWithNoTabIndex\">I'm hungry. I should...</div>\n\t<span>...</span><a href=\"#\" id=\"linkWithNoTabIndex\">Eat lots of food</a><span>...</span> |\n\t<span>...</span><a href=\"#\" id=\"linkWithTabIndex\" tabindex=\"2\">Eat a little food</a><span>...</span> |\n\t<span>...</span><a href=\"#\" id=\"linkWithNegativeTabIndex\" tabindex=\"-1\">Eat no food</a><span>...</span>\n\t<span>...</span><a id=\"linkWithNoHrefWithNoTabIndex\">Eat a burger</a><span>...</span>\n\t<span>...</span><a id=\"linkWithNoHrefWithTabIndex\" tabindex=\"1\">Eat some funyuns</a><span>...</span>\n\t<span>...</span><a id=\"linkWithNoHrefWithNegativeTabIndex\" tabindex=\"-1\">Eat some funyuns</a><span>...</span>\n\t<input id=\"inputWithoutTabIndex\"/>\n\t<button id=\"buttonWithoutTabIndex\"></button>\n\t<textarea id=\"textareaWithoutTabIndex\"></textarea>\n\t<menu type=\"popup\">\n\t\t<menuitem id=\"menuitemWithoutTabIndex\" command=\"submitbutton\" default/>\n\t</menu>\n</div>\n\n<div id=\"liveHandlerOrder\">\n\t<span id=\"liveSpan1\"><a href=\"#\" id=\"liveLink1\"></a></span>\n\t<span id=\"liveSpan2\"><a href=\"#\" id=\"liveLink2\"></a></span>\n</div>\n\n<div id=\"siblingTest\">\n\t<em id=\"siblingfirst\">1</em>\n\t<em id=\"siblingnext\">2</em>\n\t<em id=\"siblingthird\">\n\t\t<em id=\"siblingchild\">\n\t\t\t<em id=\"siblinggrandchild\">\n\t\t\t\t<em id=\"siblinggreatgrandchild\"></em>\n\t\t\t</em>\n\t\t</em>\n\t</em>\n\t<span id=\"siblingspan\"></span>\n</div>\n<div id=\"fx-test-group\" style=\"position: absolute; width: 1px; height: 1px; overflow: hidden;\">\n\t<div id=\"fx-queue\" name=\"test\">\n\t\t<div id=\"fadein\" class='chain-test' name='div'>fadeIn<div>fadeIn</div></div>\n\t\t<div id=\"fadeout\" class='chain-test chain-test-out'>fadeOut<div>fadeOut</div></div>\n\n\t\t<div id=\"show\" class='chain-test'>show<div>show</div></div>\n\t\t<div id=\"hide\" class='chain-test chain-test-out'>hide<div>hide</div></div>\n\t\t<div id=\"easehide\" class='chain-test chain-test-out'>hide<div>hide</div></div>\n\n\t\t<div id=\"togglein\" class='chain-test'>togglein<div>togglein</div></div>\n\t\t<div id=\"toggleout\" class='chain-test chain-test-out'>toggleout<div>toggleout</div></div>\n\t\t<div id=\"easetoggleout\" class='chain-test chain-test-out'>toggleout<div>toggleout</div></div>\n\n\t\t<div id=\"slideup\" class='chain-test'>slideUp<div>slideUp</div></div>\n\t\t<div id=\"slidedown\" class='chain-test chain-test-out'>slideDown<div>slideDown</div></div>\n\t\t<div id=\"easeslideup\" class='chain-test'>slideUp<div>slideUp</div></div>\n\n\t\t<div id=\"slidetogglein\" class='chain-test'>slideToggleIn<div>slideToggleIn</div></div>\n\t\t<div id=\"slidetoggleout\" class='chain-test chain-test-out'>slideToggleOut<div>slideToggleOut</div></div>\n\n\t\t<div id=\"fadetogglein\" class='chain-test'>fadeToggleIn<div>fadeToggleIn</div></div>\n\t\t<div id=\"fadetoggleout\" class='chain-test chain-test-out'>fadeToggleOut<div>fadeToggleOut</div></div>\n\n\t\t<div id=\"fadeto\" class='chain-test'>fadeTo<div>fadeTo</div></div>\n\t</div>\n\n\t<div id=\"fx-tests\"></div>\n\t<span id=\"display\"></span>\n</div>\n"; +QUnit.config.fixture = "<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>\n<p id=\"ap\">\n\tHere are some [links] in a normal paragraph: <a id=\"google\" href=\"http://www.google.com/\" title=\"Google!\">Google</a>,\n\t<a id=\"groups\" href=\"http://groups.google.com/\" class=\"GROUPS\">Google Groups (Link)</a>.\n\tThis link has <code id=\"code1\"><a href=\"http://smin\" id=\"anchor1\">class=\"blog\"</a></code>:\n\t<a href=\"http://diveintomark.org/\" class=\"blog\" hreflang=\"en\" id=\"mark\">diveintomark</a>\n\n</p>\n<div id=\"foo\">\n\t<p id=\"sndp\">Everything inside the red border is inside a div with <code>id=\"foo\"</code>.</p>\n\t<p lang=\"en\" id=\"en\">This is a normal link: <a id=\"yahoo\" href=\"http://www.yahoo.com/\" class=\"blogTest\">Yahoo</a></p>\n\t<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>\n\n</div>\n<div id=\"nothiddendiv\" style=\"height:1px;background:white;\" class=\"nothiddendiv\">\n\t<div id=\"nothiddendivchild\"></div>\n</div>\n<span id=\"name+value\"></span>\n<p id=\"first\">Try them out:</p>\n<ul id=\"firstUL\"></ul>\n<ol id=\"empty\"></ol>\n<form id=\"form\" action=\"formaction\">\n\t<label for=\"action\" id=\"label-for\">Action:</label>\n\t<input type=\"text\" name=\"action\" value=\"Test\" id=\"text1\" maxlength=\"30\"/>\n\t<input type=\"text\" name=\"text2\" value=\"Test\" id=\"text2\" disabled=\"disabled\"/>\n\t<input type=\"radio\" name=\"radio1\" id=\"radio1\" value=\"on\"/>\n\n\t<input type=\"radio\" name=\"radio2\" id=\"radio2\" checked=\"checked\"/>\n\t<input type=\"checkbox\" name=\"check\" id=\"check1\" checked=\"checked\"/>\n\t<input type=\"checkbox\" id=\"check2\" value=\"on\"/>\n\n\t<input type=\"hidden\" name=\"hidden\" id=\"hidden1\"/>\n\t<input type=\"text\" style=\"display:none;\" name=\"foo[bar]\" id=\"hidden2\"/>\n\n\t<input type=\"text\" id=\"name\" name=\"name\" value=\"name\" />\n\t<input type=\"search\" id=\"search\" name=\"search\" value=\"search\" />\n\n\t<button id=\"button\" name=\"button\" type=\"button\">Button</button>\n\n\t<textarea id=\"area1\" maxlength=\"30\">foobar</textarea>\n\n\t<select name=\"select1\" id=\"select1\">\n\t\t<option id=\"option1a\" class=\"emptyopt\" value=\"\">Nothing</option>\n\t\t<option id=\"option1b\" value=\"1\">1</option>\n\t\t<option id=\"option1c\" value=\"2\">2</option>\n\t\t<option id=\"option1d\" value=\"3\">3</option>\n\t</select>\n\t<select name=\"select2\" id=\"select2\">\n\t\t<option id=\"option2a\" class=\"emptyopt\" value=\"\">Nothing</option>\n\t\t<option id=\"option2b\" value=\"1\">1</option>\n\t\t<option id=\"option2c\" value=\"2\">2</option>\n\t\t<option id=\"option2d\" selected=\"selected\" value=\"3\">3</option>\n\t</select>\n\t<select name=\"select3\" id=\"select3\" multiple=\"multiple\">\n\t\t<option id=\"option3a\" class=\"emptyopt\" value=\"\">Nothing</option>\n\t\t<option id=\"option3b\" selected=\"selected\" value=\"1\">1</option>\n\t\t<option id=\"option3c\" selected=\"selected\" value=\"2\">2</option>\n\t\t<option id=\"option3d\" value=\"3\">3</option>\n\t\t<option id=\"option3e\">no value</option>\n\t</select>\n\t<select name=\"select4\" id=\"select4\" multiple=\"multiple\">\n\t\t<optgroup disabled=\"disabled\">\n\t\t\t<option id=\"option4a\" class=\"emptyopt\" value=\"\">Nothing</option>\n\t\t\t<option id=\"option4b\" disabled=\"disabled\" selected=\"selected\" value=\"1\">1</option>\n\t\t\t<option id=\"option4c\" selected=\"selected\" value=\"2\">2</option>\n\t\t</optgroup>\n\t\t<option selected=\"selected\" disabled=\"disabled\" id=\"option4d\" value=\"3\">3</option>\n\t\t<option id=\"option4e\">no value</option>\n\t</select>\n\t<select name=\"select5\" id=\"select5\">\n\t\t<option id=\"option5a\" value=\"3\">1</option>\n\t\t<option id=\"option5b\" value=\"2\">2</option>\n\t\t<option id=\"option5c\" value=\"1\" data-attr=\"\">3</option>\n\t</select>\n\n\t<object id=\"object1\" codebase=\"stupid\">\n\t\t<param name=\"p1\" value=\"x1\" />\n\t\t<param name=\"p2\" value=\"x2\" />\n\t</object>\n\n\t<span id=\"台北Táiběi\"><span id=\"台北Táiběi-child\"></span></span>\n\t<span id=\"台北\" lang=\"中文\"></span>\n\t<span id=\"utf8class1\" class=\"台北Táiběi 台北\">\"'台北Táiběi\"'</span>\n\t<span id=\"utf8class2\" class=\"台北\"></span>\n\t<span id=\"foo:bar\" class=\"foo:bar\"><span id=\"foo_descendant\"></span></span>\n\t<span id=\"test.foo[5]bar\" class=\"test.foo[5]bar\"></span>\n\n\t<foo_bar id=\"foobar\">test element</foo_bar>\n</form>\n<b id=\"floatTest\">Float test.</b>\n<iframe id=\"iframe\" name=\"iframe\"></iframe>\n<form id=\"lengthtest\">\n\t<input type=\"text\" id=\"length\" name=\"test\"/>\n\t<input type=\"text\" id=\"idTest\" name=\"id\"/>\n</form>\n<table id=\"table\"></table>\n\n<form id=\"name-tests\">\n\t<!-- Inputs with a grouped name attribute. -->\n\t<input name=\"types[]\" id=\"types_all\" type=\"checkbox\" value=\"all\" />\n\t<input name=\"types[]\" id=\"types_anime\" type=\"checkbox\" value=\"anime\" />\n\t<input name=\"types[]\" id=\"types_movie\" type=\"checkbox\" value=\"movie\" />\n</form>\n\n<form id=\"testForm\" action=\"#\" method=\"get\">\n\t<textarea name=\"T3\" rows=\"2\" cols=\"15\">?\nZ</textarea>\n\t<input type=\"hidden\" name=\"H1\" value=\"x\" />\n\t<input type=\"hidden\" name=\"H2\" />\n\t<input name=\"PWD\" type=\"password\" value=\"\" />\n\t<input name=\"T1\" type=\"text\" />\n\t<input name=\"T2\" type=\"text\" value=\"YES\" readonly=\"readonly\" />\n\t<input type=\"checkbox\" name=\"C1\" value=\"1\" />\n\t<input type=\"checkbox\" name=\"C2\" />\n\t<input type=\"radio\" name=\"R1\" value=\"1\" />\n\t<input type=\"radio\" name=\"R1\" value=\"2\" />\n\t<input type=\"text\" name=\"My Name\" value=\"me\" />\n\t<input type=\"reset\" name=\"reset\" value=\"NO\" />\n\t<select name=\"S1\">\n\t\t<option value=\"abc\">ABC</option>\n\t\t<option value=\"abc\">ABC</option>\n\t\t<option value=\"abc\">ABC</option>\n\t</select>\n\t<select name=\"S2\" multiple=\"multiple\" size=\"3\">\n\t\t<option value=\"abc\">ABC</option>\n\t\t<option value=\"abc\">ABC</option>\n\t\t<option value=\"abc\">ABC</option>\n\t</select>\n\t<select name=\"S3\">\n\t\t<option selected=\"selected\">YES</option>\n\t</select>\n\t<select name=\"S4\">\n\t\t<option value=\"\" selected=\"selected\">NO</option>\n\t</select>\n\t<input type=\"submit\" name=\"sub1\" value=\"NO\" />\n\t<input type=\"submit\" name=\"sub2\" value=\"NO\" />\n\t<input type=\"image\" name=\"sub3\" value=\"NO\" />\n\t<button name=\"sub4\" type=\"submit\" value=\"NO\">NO</button>\n\t<input name=\"D1\" type=\"text\" value=\"NO\" disabled=\"disabled\" />\n\t<input type=\"checkbox\" checked=\"checked\" disabled=\"disabled\" name=\"D2\" value=\"NO\" />\n\t<input type=\"radio\" name=\"D3\" value=\"NO\" checked=\"checked\" disabled=\"disabled\" />\n\t<select name=\"D4\" disabled=\"disabled\">\n\t\t<option selected=\"selected\" value=\"NO\">NO</option>\n\t</select>\n\t<input id=\"list-test\" type=\"text\" />\n\t<datalist id=\"datalist\">\n\t\t<option value=\"option\"></option>\n\t</datalist>\n</form>\n<div id=\"moretests\">\n\t<form>\n\t\t<div id=\"checkedtest\" style=\"display:none;\">\n\t\t\t<input type=\"radio\" name=\"checkedtestradios\" checked=\"checked\"/>\n\t\t\t<input type=\"radio\" name=\"checkedtestradios\" value=\"on\"/>\n\t\t\t<input type=\"checkbox\" name=\"checkedtestcheckboxes\" checked=\"checked\"/>\n\t\t\t<input type=\"checkbox\" name=\"checkedtestcheckboxes\" />\n\t\t</div>\n\t</form>\n\t<div id=\"nonnodes\"><span id=\"nonnodesElement\">hi</span> there <!-- mon ami --></div>\n\t<div id=\"t2037\">\n\t\t<div><div class=\"hidden\">hidden</div></div>\n\t</div>\n\t<div id=\"t6652\">\n\t\t<div></div>\n\t</div>\n\t<div id=\"t12087\">\n\t\t<input type=\"hidden\" id=\"el12087\" data-comma=\"0,1\"/>\n\t</div>\n\t<div id=\"no-clone-exception\"><object><embed></embed></object></div>\n\t<div id=\"names-group\">\n\t\t<span id=\"name-is-example\" name=\"example\"></span>\n\t\t<span id=\"name-is-div\" name=\"div\"></span>\n\t</div>\n\t<div id=\"id-name-tests\">\n\t\t<a id=\"tName1ID\" name=\"tName1\"><span></span></a>\n\t\t<a id=\"tName2ID\" name=\"tName2\"><span></span></a>\n\t\t<div id=\"tName1\"><span id=\"tName1-span\">C</span></div>\n\t</div>\n\t<div id=\"whitespace-lists\">\n\t\t<input id=\"t15233-single\" data-15233=\"foo\"/>\n\t\t<input id=\"t15233-double\" data-15233=\"foo bar\"/>\n\t\t<input id=\"t15233-double-tab\" data-15233=\"foo\tbar\"/>\n\t\t<input id=\"t15233-double-nl\" data-15233=\"foo
bar\"/>\n\t\t<input id=\"t15233-triple\" data-15233=\"foo bar baz\"/>\n\t</div>\n</div>\n\n<div id=\"tabindex-tests\">\n\t<ol id=\"listWithTabIndex\" tabindex=\"5\">\n\t\t<li id=\"foodWithNegativeTabIndex\" tabindex=\"-1\">Rice</li>\n\t\t<li id=\"foodNoTabIndex\">Beans</li>\n\t\t<li>Blinis</li>\n\t\t<li>Tofu</li>\n\t</ol>\n\n\t<div id=\"divWithNoTabIndex\">I'm hungry. I should...</div>\n\t<span>...</span><a href=\"#\" id=\"linkWithNoTabIndex\">Eat lots of food</a><span>...</span> |\n\t<span>...</span><a href=\"#\" id=\"linkWithTabIndex\" tabindex=\"2\">Eat a little food</a><span>...</span> |\n\t<span>...</span><a href=\"#\" id=\"linkWithNegativeTabIndex\" tabindex=\"-1\">Eat no food</a><span>...</span>\n\t<span>...</span><a id=\"linkWithNoHrefWithNoTabIndex\">Eat a burger</a><span>...</span>\n\t<span>...</span><a id=\"linkWithNoHrefWithTabIndex\" tabindex=\"1\">Eat some funyuns</a><span>...</span>\n\t<span>...</span><a id=\"linkWithNoHrefWithNegativeTabIndex\" tabindex=\"-1\">Eat some funyuns</a><span>...</span>\n\t<input id=\"inputWithoutTabIndex\"/>\n\t<button id=\"buttonWithoutTabIndex\"></button>\n\t<textarea id=\"textareaWithoutTabIndex\"></textarea>\n\t<menu type=\"popup\">\n\t\t<menuitem id=\"menuitemWithoutTabIndex\" command=\"submitbutton\" default/>\n\t</menu>\n</div>\n\n<div id=\"liveHandlerOrder\">\n\t<span id=\"liveSpan1\"><a href=\"#\" id=\"liveLink1\"></a></span>\n\t<span id=\"liveSpan2\"><a href=\"#\" id=\"liveLink2\"></a></span>\n</div>\n\n<form id=\"disabled-tests\">\n\t<fieldset id=\"disabled-fieldset\" disabled=\"disabled\">\n\t\t<a id=\"disabled-fieldset-a\" href=\"#\"></a>\n\t\t<input id=\"disabled-fieldset-input\" name=\"disabled-fieldset-input\" type=\"text\" />\n\t\t<textarea id=\"disabled-fieldset-textarea\" name=\"disabled-fieldset-textarea\" ></textarea>\n\t\t<button id=\"disabled-fieldset-button\" name=\"disabled-fieldset-button\">Go</button>\n\t\t<!-- exclude <select> because IE6 is bugged and fails\n\t\t<select id=\"disabled-fieldset-select\" name=\"disabled-fieldset-select\"></select>\n\t\t-->\n\t\t<span id=\"disabled-fieldset-span\">Neither enabled nor disabled</span>\n\t</fieldset>\n\t<fieldset id=\"enabled-fieldset\">\n\t\t<a id=\"disabled-a\" href=\"#\" disabled=\"disabled\"></a>\n\t\t<input id=\"disabled-input\" name=\"disabled-input\" type=\"text\" disabled=\"disabled\"/>\n\t\t<textarea id=\"disabled-textarea\" name=\"disabled-textarea\" disabled=\"disabled\"></textarea>\n\t\t<button id=\"disabled-button\" name=\"disabled-button\" disabled=\"disabled\">Go</button>\n\t\t<select id=\"disabled-select\" name=\"disabled-select\" disabled=\"disabled\">\n\t\t\t<optgroup id=\"disabled-optgroup\" label=\"and\" disabled=\"disabled\">\n\t\t\t\t<option id=\"disabled-option\" disabled=\"disabled\">Black</option>\n\t\t\t</optgroup>\n\t\t</select>\n\t\t<input id=\"enabled-input\" name=\"enabled-input\" type=\"text\"/>\n\t\t<textarea id=\"enabled-textarea\" name=\"enabled-textarea\"></textarea>\n\t\t<button id=\"enabled-button\" name=\"enabled-button\">Go</button>\n\t\t<select id=\"enabled-select\" name=\"enabled-select\">\n\t\t\t<optgroup id=\"enabled-optgroup\" label=\"and\">\n\t\t\t\t<option id=\"enabled-option\">Gold</option>\n\t\t\t</optgroup>\n\t\t</select>\n\t\t<span id=\"enabled-fieldset-span\">Neither enabled nor disabled</span>\n\t</fieldset>\n\t<select id=\"disabled-select-inherit\" name=\"disabled-select-inherit\" disabled=\"disabled\">\n\t\t<optgroup id=\"disabled-optgroup-inherit\" label=\"and\" disabled=\"disabled\">\n\t\t\t<option id=\"disabled-optgroup-option\">Black</option>\n\t\t</optgroup>\n\t\t<optgroup id=\"enabled-optgroup-inherit\" label=\"and\">\n\t\t\t<option id=\"enabled-optgroup-option\">Gold</option>\n\t\t</optgroup>\n\t</select>\n\t<select id=\"enabled-select-inherit\" name=\"enabled-select-inherit\">\n\t\t<optgroup id=\"en_disabled-optgroup-inherit\" label=\"and\" disabled=\"disabled\">\n\t\t\t<option id=\"en_disabled-optgroup-option\">Black</option>\n\t\t</optgroup>\n\t\t<option id=\"enabled-select-option\">Black</option>\n\t</select>\n</form>\n\n<div id=\"siblingTest\">\n\t<em id=\"siblingfirst\">1</em>\n\t<em id=\"siblingnext\">2</em>\n\t<em id=\"siblingthird\">\n\t\t<em id=\"siblingchild\">\n\t\t\t<em id=\"siblinggrandchild\">\n\t\t\t\t<em id=\"siblinggreatgrandchild\"></em>\n\t\t\t</em>\n\t\t</em>\n\t</em>\n\t<span id=\"siblingspan\"></span>\n</div>\n<div id=\"fx-test-group\" style=\"position: absolute; width: 1px; height: 1px; overflow: hidden;\">\n\t<div id=\"fx-queue\" name=\"test\">\n\t\t<div id=\"fadein\" class='chain-test'>fadeIn<div>fadeIn</div></div>\n\t\t<div id=\"fadeout\" class='chain-test chain-test-out'>fadeOut<div>fadeOut</div></div>\n\n\t\t<div id=\"show\" class='chain-test'>show<div>show</div></div>\n\t\t<div id=\"hide\" class='chain-test chain-test-out'>hide<div>hide</div></div>\n\t\t<div id=\"easehide\" class='chain-test chain-test-out'>hide<div>hide</div></div>\n\n\t\t<div id=\"togglein\" class='chain-test'>togglein<div>togglein</div></div>\n\t\t<div id=\"toggleout\" class='chain-test chain-test-out'>toggleout<div>toggleout</div></div>\n\t\t<div id=\"easetoggleout\" class='chain-test chain-test-out'>toggleout<div>toggleout</div></div>\n\n\t\t<div id=\"slideup\" class='chain-test'>slideUp<div>slideUp</div></div>\n\t\t<div id=\"slidedown\" class='chain-test chain-test-out'>slideDown<div>slideDown</div></div>\n\t\t<div id=\"easeslideup\" class='chain-test'>slideUp<div>slideUp</div></div>\n\n\t\t<div id=\"slidetogglein\" class='chain-test'>slideToggleIn<div>slideToggleIn</div></div>\n\t\t<div id=\"slidetoggleout\" class='chain-test chain-test-out'>slideToggleOut<div>slideToggleOut</div></div>\n\n\t\t<div id=\"fadetogglein\" class='chain-test'>fadeToggleIn<div>fadeToggleIn</div></div>\n\t\t<div id=\"fadetoggleout\" class='chain-test chain-test-out'>fadeToggleOut<div>fadeToggleOut</div></div>\n\n\t\t<div id=\"fadeto\" class='chain-test'>fadeTo<div>fadeTo</div></div>\n\t</div>\n\n\t<div id=\"fx-tests\"></div>\n\t<span id=\"display\"></span>\n</div>\n<br id=\"last\"/>\n"; diff --git a/test/data/selector/mixed_sort.html b/test/data/selector/mixed_sort.html new file mode 100644 index 000000000..090b9aaca --- /dev/null +++ b/test/data/selector/mixed_sort.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>jQuery selector - cross-window uniqueSort</title> + + <script src="../../jquery.js"></script> + <script src="../iframeTest.js"></script> +</head> +<body> +<script> + var doc = parent.document, + unframed = [ doc.getElementById( "qunit-fixture" ), doc.body, doc.documentElement ], + framed = jQuery.find( "*" ); + parent.console.log( unframed ); + + startIframeTest( + jQuery.uniqueSort( unframed.concat( framed ) ), + framed.concat( unframed.slice(0).reverse() ) + ); +</script> +</body> +</html> diff --git a/test/data/testinit.js b/test/data/testinit.js index cb600cf15..39d8d1d7b 100644 --- a/test/data/testinit.js +++ b/test/data/testinit.js @@ -51,15 +51,9 @@ this.q = function() { * @example match("Check for something", "p", ["foo", "bar"]); */ function match( message, selector, expectedIds, context, assert ) { - var f = jQuery( selector, context ).get(), - s = "", - i = 0; - - for ( ; i < f.length; i++ ) { - s += ( s && "," ) + "\"" + f[ i ].id + "\""; - } + var elems = jQuery( selector, context ).get(); - assert.deepEqual( f, q.apply( q, expectedIds ), message + " (" + selector + ")" ); + assert.deepEqual( elems, q.apply( q, expectedIds ), message + " (" + selector + ")" ); } /** @@ -102,6 +96,36 @@ this.createDashboardXML = function() { return jQuery.parseXML( string ); }; +this.createWithFriesXML = function() { + var string = "<?xml version='1.0' encoding='UTF-8'?> \ + <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' \ + xmlns:xsd='http://www.w3.org/2001/XMLSchema' \ + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> \ + <soap:Body> \ + <jsconf xmlns='http://www.example.com/ns1'> \ + <response xmlns:ab='http://www.example.com/ns2'> \ + <meta> \ + <component id='seite1' class='component'> \ + <properties xmlns:cd='http://www.example.com/ns3'> \ + <property name='prop1'> \ + <thing /> \ + <value>1</value> \ + </property> \ + <property name='prop2'> \ + <thing att='something' /> \ + </property> \ + <foo_bar>foo</foo_bar> \ + </properties> \ + </component> \ + </meta> \ + </response> \ + </jsconf> \ + </soap:Body> \ + </soap:Envelope>"; + + return jQuery.parseXML( string ); +}; + this.createXMLFragment = function() { var frag, xml = document.implementation.createDocument( "", "", null ); |