Test case details

Preparation Code

<div class='adiv'>   test text inside a div! </div> <div class='adiv'>   test text inside a div! </div> <div>   <div>     <div class='thediv'>       test test test test test test       <span>         this is a span       </span>     </div>   </div> </div> <div class='adiv'>   test text inside a div! </div> <div class='adiv'>   test text inside a div! </div> <div class='adiv'>   test text inside a div! </div>

Test cases

Test #1

if (document.evaluate) {   document.evaluate('./div/div/div[@class="thediv"]/span', document.body, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); }

Test #2

// https://gist.github.com/connrs/2724353 document.querySelectorAll||(document.querySelectorAll=function(a){var b=document,c=b.documentElement.firstChild,d=b.createElement("STYLE");return c.appendChild(d),b.__qsaels=[],d.styleSheet.cssText=a+"{x:expression(document.__qsaels.push(this))}",window.scrollBy(0,0),b.__qsaels}); document.querySelectorAll('body > div > div > div[class="thediv"] > span');

Test #3

// https://gist.github.com/connrs/2724353 document.querySelectorAll||(document.querySelectorAll=function(a){var b=document,c=b.documentElement.firstChild,d=b.createElement("STYLE");return c.appendChild(d),b.__qsaels=[],d.styleSheet.cssText=a+"{x:expression(document.__qsaels.push(this))}",window.scrollBy(0,0),b.__qsaels}); document.querySelectorAll('body div div div[class="thediv"] > span');

Test #4

// https://gist.github.com/connrs/2724353 document.querySelectorAll||(document.querySelectorAll=function(a){var b=document,c=b.documentElement.firstChild,d=b.createElement("STYLE");return c.appendChild(d),b.__qsaels=[],d.styleSheet.cssText=a+"{x:expression(document.__qsaels.push(this))}",window.scrollBy(0,0),b.__qsaels}); document.body.querySelectorAll('div > div > div[class="thediv"] > span');

Test #5

if (document.evaluate) {   document.evaluate('./div/div/div[@class="thediv"]/span', document.body, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); }

Test #6

if (document.evaluate) {   document.evaluate('./body/div/div/div[@class="thediv"]/span', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); }