There can be commas separating the selector. A comma separated list result is OR'd onto the main.
This ONLY cares about elements. text, etc, are ignored
There should be two functions: given element, does it match the selector? and given a selector, give me all the elements
The name getElementsBySelector was the original name, written back before the name querySelector was standardized (this library is older than you might think!), but they do the same thing..
Returns elements that match the given CSS selector
* -- all, default if nothing else is there
tag#id.class.class.class:pseudo[attrib=what][attrib=what] OP selector
It is all additive
OP
space = descendant > = direct descendant + = sibling (E+F Matches any F element immediately preceded by a sibling element E)
foo Foo is present as an attribute [foo="warning"] Matches any E element whose "foo" attribute value is exactly equal to "warning". E[foo~="warning"] Matches any E element whose "foo" attribute value is a list of space-separated values, one of which is exactly equal to "warning" E="en" Matches any E element whose "lang" attribute has a hyphen-separated list of values beginning (from the left) with "en".
[item$=sdas] ends with [item^-sdsad] begins with
Quotes are optional here.
Pseudos: :first-child :last-child :link (same as ahref for our purposes here)