3 <title>Selectors and Shadow Scopes
</title>
6 -webkit-appearance: none;
11 if (window
.testRunner
)
12 testRunner
.dumpAsText();
17 var SELECTOR_TEST_PROPERTIES
= ' { height: 1px; -webkit-appearance: none; }';
19 // convenience constants
23 function log(msg
, success
)
25 logDiv
.appendChild(document
.createElement('div')).innerHTML
= msg
+ ': ' + (success
? 'PASS' : 'FAIL');
28 function runSelectorTest(matchExpected
, selector
)
30 var style
= document
.createElement('style');
31 style
.textContent
= selector
+ SELECTOR_TEST_PROPERTIES
;
32 head
.appendChild(style
);
33 var matched
= input
.offsetHeight
== 1;
34 log('<code>' + selector
+ '</code> <strong>should' + (matchExpected
? '' : ' not') + '</strong> match', matchExpected
? matched
: !matched
);
35 head
.removeChild(style
);
40 head
= document
.getElementsByTagName('head')[0];
41 input
= document
.getElementsByTagName('input')[0];
42 logDiv
= document
.getElementById('log');
43 runSelectorTest(NO_MATCH
, 'div');
44 runSelectorTest(NO_MATCH
, '*');
45 runSelectorTest(NO_MATCH
, 'body *');
46 document
.body
.removeChild(input
);
51 <body onload=
"runTest()">
52 <p>Tests whether and how selectors cross shadow DOM scopes.
</p>
53 <input id=
"foo" class=
"bar" style=
"height:auto" type=
"range">