Located in File: /src/QueryPath/CssEventHandler.php
The main idea is that we keep a copy of the tree, and then use an array to keep track of matches. To handle a list of selectors (using the comma separator), we have to track both the currently progressing match and the previously matched elements.
To use this handler:
$matches will be an array of zero or more DOMElement objects.
Constructor __construct (line 78)
Method adjacent (line 1277)
In a strict DOM parser, line breaks and empty spaces are nodes. That means nodes like this will not be adjacent: <test/> <test/>. The space between them makes them non-adjacent. If this is not the desired behavior, pass in the appropriate flags to your parser. Example:
Method anotherSelector (line 1290)
Method anyDescendant (line 1337)
Method anyElement (line 258)
Method anyElementInNS (line 271)
Method attachNodeList (line 1402)
Method attribute (line 309)
Method attributeNS (line 354)
Method attrValMatches (line 1169)
Method directDescendant (line 1248)
Method element (line 189)
Method elementClass (line 294)
Method elementID (line 174)
If this finds an ID, it will immediately quit. Essentially, it doesn't enforce ID uniqueness, but it assumes it.
Method elementNS (line 209)
Method emptyElement (line 1116)
Method find (line 141)
This is the primary searching method used throughout QueryPath.
Method firstOfType (line 1050)
Method getMatches (line 157)
This should be called after the filter has been parsed.
Method has (line 1032)
This can also be used as a general filtering routine.
Method lang (line 973)
Method lastOfType (line 1071)
Method not (line 1012)
This does not follow the specification in the following way: The CSS 3 selector spec says the value of not() must be a simple selector. This function allows complex selectors.
Method nthChild (line 712)
Method nthLastChild (line 795)
Method nthLastOfTypeChild (line 966)
Not implemented.
Method nthOfTypeChild (line 902)
Not implemented.
Method onlyChild (line 1093)
Method onlyOfType (line 1139)
Method parseAnB (line 678)
Method pseudoClass (line 392)
Method pseudoElement (line 1200)
Method searchForAttr (line 335)
Method sibling (line 1311)
If two passed in items are siblings of each other, neither will be included in the list of siblings. Their status as being candidates excludes them from being considered siblings.