Свойство | Тип | Описание | |
---|---|---|---|
$alreadyMatched | The matches | ||
$dom | |||
$findAnyElement | Matches found before current selector. | ||
$matches | Always points to the top level. |
Метод | Описание | |
---|---|---|
__construct ( $dom ) | Create a new event handler. | |
adjacent ( ) | For an element to be adjacent to another, it must be THE NEXT NODE in the node list. So if an element is surrounded by pcdata, there are no adjacent nodes. E.g. in FOO, the a and b elements are not adjacent. | |
anotherSelector ( ) | ||
anyDescendant ( ) | Get any descendant. | |
anyElement ( ) | ||
anyElementInNS ( $ns ) | ||
attachNodeList ( DOMNodeList $nodeList, SplObjectStorage $splos ) | Attach all nodes in a node list to the given \SplObjectStorage. | |
attribute ( $name, $value = null, $operation = EventHandler::isExactly ) | ||
attributeNS ( $lname, $ns, $value = null, $operation = EventHandler::isExactly ) | ||
directDescendant ( ) | ||
element ( $name ) | Inherited | |
elementClass ( $name ) | ||
elementID ( $id ) | Find any element with the ID that matches $id. | |
elementNS ( $lname, $namespace = null ) | Inherited | |
find ( string $filter ) : |
Generic finding method. | |
getMatches ( ) : array | Get the elements that match the evaluated selector. | |
has ( $filter ) | Pseudo-class handler for :has(filter). | |
matches ( ) | ||
pseudoClass ( $name, $value = null ) | This also supports the following nonstandard pseudo classes: - :x-reset/:x-root (reset to the main item passed into the constructor. Less drastic than :root) - :odd/:even (shorthand for :nth-child(odd)/:nth-child(even)). | |
pseudoElement ( $name ) | As the spec mentions, these must be at the end of a selector or else they will cause errors. Most selectors return elements. Pseudo-elements do not. | |
sibling ( ) | Get all nodes that are siblings to currently selected nodes. |
Метод | Описание | |
---|---|---|
attrValMatches ( $needle, $haystack, $operation ) | Check for attr value matches based on an operation. | |
emptyElement ( ) | Pseudo-class handler for :empty. | |
firstOfType ( ) | Pseudo-class handler for :first-of-type. | |
lang ( $value ) | Pseudo-class handler for :lang. | |
lastOfType ( ) | Pseudo-class handler for :last-of-type. | |
not ( string $filter ) | Pseudo-class handler for :not(filter). | |
nthChild ( integer $groupSize, integer $elementInGroup, boolean $lastChild = false ) | Pseudo-class handler for nth-child and all related pseudo-classes. | |
nthLastChild ( $groupSize, $elementInGroup ) | Pseudo-class handler for :nth-last-child and related pseudo-classes. | |
nthLastOfTypeChild ( $groupSize, $elementInGroup ) | Pseudo-class handler for nth-last-of-type-child. | |
nthOfTypeChild ( $groupSize, $elementInGroup, $lastChild ) | Pseudo-class handler for nth-of-type-child. | |
onlyChild ( ) | Pseudo-class handler for :only-child. | |
onlyOfType ( ) | Pseudo-class handler for :only-of-type. | |
parseAnB ( $rule ) | Parse an an+b rule for CSS pseudo-classes. | |
searchForAttr ( $name, $value = null ) | Helper function to find all elements with exact matches. |
Метод | Описание | |
---|---|---|
candidateList ( ) | Determine what candidates are in the current scope. | |
getAllCandidates ( $elements ) | Get a list of all of the candidate elements. | |
getByPosition ( $operator, $pos ) | Pseudo-class handler for a variety of jQuery pseudo-classes. | |
removeQuotes ( $str ) | Remove leading and trailing quotes. |
$doc = new DomDocument();
$doc->loadXML(' ', LIBXML_NOBLANKS);
public adjacent ( ) |
public attachNodeList ( DOMNodeList $nodeList, SplObjectStorage $splos ) | ||
$nodeList | DOMNodeList | |
$splos | SplObjectStorage |
protected attrValMatches ( $needle, $haystack, $operation ) |
public attribute ( $name, $value = null, $operation = EventHandler::isExactly ) |
public attributeNS ( $lname, $ns, $value = null, $operation = EventHandler::isExactly ) |
public elementID ( $id ) | ||
$id | String ID for an element. |
public getMatches ( ) : array | ||
Результат | array | The matched items. This is almost always an array of {@link DOMElement} objects. It is always an instance of {@link DOMNode} objects. |
protected nthChild ( integer $groupSize, integer $elementInGroup, boolean $lastChild = false ) | ||
$groupSize | integer | The size of the group (in an+b, this is a). |
$elementInGroup | integer | The offset in a group. (in an+b this is b). |
$lastChild | boolean | Whether counting should begin with the last child. By default, this is false. Pseudo-classes that start with the last-child can set this to true. |
protected nthLastChild ( $groupSize, $elementInGroup ) |
protected nthLastOfTypeChild ( $groupSize, $elementInGroup ) |
protected nthOfTypeChild ( $groupSize, $elementInGroup, $lastChild ) |
protected parseAnB ( $rule ) | ||
$rule | Some rule in the an+b format. |
public pseudoClass ( $name, $value = null ) |
public pseudoElement ( $name ) |
protected searchForAttr ( $name, $value = null ) |
public sibling ( ) |
protected $findAnyElement |