{"comment":{"created_at":"2011-10-10T17:48:14Z","body":"Master is two versions of JSDOM ahead of the last release, which included the #164 fix. No failing tests.","updated_at":"2011-10-10T17:48:14Z","url":"https://api.github.com/repos/assaf/zombie/issues/comments/2350104","id":2350104,"user":{"avatar_url":"https://secure.gravatar.com/avatar/a62b87a36bfc29a7207bc73f3aac960b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/assaf","id":5158,"login":"assaf"}},"action":"created","issue":{"number":182,"created_at":"2011-10-08T17:30:12Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"This is driving me nuts, it works \"sometimes\". I'll try to give a basic example with this html fragment:\r\n\r\n\t<div id=\"categTree\">\r\n\t\t<h3>A</h3>\r\n\t\t<ul>\r\n\t\t\t<li><a href=\"\">1</a></li>\r\n\t\t\t<li><a href=\"\">2</a></li>\r\n\t\t\t<li><a href=\"\">3</a></li>\r\n\t\t\t<li><a href=\"\">4</a></li>\r\n\t\t</ul>\r\n\t\t<h3>B</h3>\r\n\t\t<ul>\r\n\t\t\t<li><a href=\"\">1</a></li>\r\n\t\t\t<li><a href=\"\">2</a></li>\r\n\t\t</ul>\r\n\t</div>\r\n\t\r\nAnd this JS:\r\n\r\n\tvar parents = browser.css('#categTree > h3');\r\n\tvar children = browser.css('#categTree > ul');\r\n\tchildren.forEach(function(c) {\r\n\t\tconsole.log(c.getElementsByTagName('a').length);\r\n\t});\r\n\tchildren.forEach(function(c) {\r\n\t\tconsole.log(c.querySelectorAll('a').length);\r\n\t});\r\n\t\r\nOutput:\r\n\r\n\t4\r\n\t2\r\n\t6\r\n\t6\r\n\t\r\nWhy the context node is ignored? I use querySelector with explicit context node in other parts of my code and works just fine, I don't get it.\r\n\r\nBtw, browser.css() returns an Array and browser.querySelector() returns a NodeList. Documentation says that both return a NodeList, how's that?\r\n","comments":3,"title":"Weird querySelector context behavior","updated_at":"2011-10-10T17:48:14Z","url":"https://api.github.com/repos/assaf/zombie/issues/182","id":1853085,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/f29ce246704ed07c7a6453acb35daff6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/demian85","id":470630,"login":"demian85"},"html_url":"https://github.com/assaf/zombie/issues/182","labels":[],"state":"open"},"legacy":{"issue_id":1853085,"comment_id":2350104}}