manakai//Selectors Extensions

manakai//Selectors Extensions

[1] The :-manakai-contains(s) pseudo-class has the same semantics and syntax as of :contains(s) pseudo-class <>.

[2] The :-manakai-current pseudo-class represents an element that is currently selected for the purpose of querying (known as current element).

Unless explicitly defined by a specification, current element is null and therefore no element matches with this pseudo-class.

For selectors specified in the first argument of querySelector or querySelectorAll method of ElementSelector interface, the current element is the element on which the method is invoked.

For example, a Perl subroutine:
sub {
  my $section = $doc->get_elements_by_tag_name ('section')->[0];
  return @{$section->query_selector (':-manakai-current > p')};
... will return an array of three Element nodes: first, second, and fourth p elements, but third p element in the child section element will not returned. Note that $doc->query_selector (':-manakai-current > p') will return no node, since current element is not defined for the DocumentSelector interface.