ClassRootNodeList should start from rootNode, not the first child of rootNode.
When some selector like ".class > div" (a class selector is not the right-most one),
ClassRootNodeList is used to find all elements which match the class selector (in this case, .class).
Suppose that we have the following DOM tree and we try document.body.querySelector('.class > div') and
document.body.querySelectorAll('class > div').
<body class='.class'>
<div></div>
</body>
If ClassRootNodeList starts from a given rootNode, i.e. document.body,
since there are no child elements of body whose class attirbute is "class",
the querySelector and querySelectorAll doesn't match any elements. This is a problem.
BUG=304069
TEST=fast/selectors/querySelector-leftmost-selector-matches-rootNode.html
Review URL: https://codereview.chromium.org/26218002
git-svn-id: svn://svn.chromium.org/blink/trunk@159014 bbb929c8-8fbe-4397-9dbb-9b2b20218538
3 files changed