184N/A<
title>Selector Test Suite</
title>
184N/AYUI({ base: '/
build/', filter: 'raw' }).use('console-filters', 'test', function(Y) {
184N/A var els = (root || document).getElementsByTagName(tag),
184N/A if (!
test ||
test(
els[
i])) {
184N/A expected = expected || [];
184N/A var actual = $(
selector,
root,
firstOnly),
184N/A expected = expected[
0] ?
expected[
0] :
null;
184N/A nullInput:
function(
root,
firstOnly) {
184N/A '.heading':
function() {
'h1, .heading':
function() {
'h1 em':
Y.DOM.byId(
'only-h1').
getElementsByTagName(
'em'),
'foo .first-child h1': [],
'html #only-body #only-h1 em':
Y.DOM.byId(
'only-h1').
getElementsByTagName(
'em'),
if (
typeof test ===
'function') {
Y.each(
test,
function(
fn,
query) {
testCase = 'test: ' +
query;
<
body class="yui-skin-sam" id="only-body">
<
div id="first-child-of-body">
<
div class="first-child" id="test-root">
<
h1 class="heading h1 first-child" id="only-h1"><
em>Selector Test Suite</
em></
h1>
<
h2 class="heading h2">Testing 1</
h2>
<
h2 class="heading h2">Testing 2</
h2>
<
h2 class="heading h2">Testing 3</
h2>
.yui-skin-sam .yui-console-entry-pass .yui-console-entry-cat {
.yui-skin-sam .yui-console-entry-fail .yui-console-entry-cat {
.yui-skin-sam .yui-console-entry {
.yui-skin-sam .yui-console-entry .yui-console-entry-content {
<
div id="test-logger" class="last-child child-of-body"></
div>