Selectors Extensions

Selectors Extensions

[1] The :-manakai-contains(s) pseudo-class has the same semantics and syntax as of :contains(s) pseudo-class <http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#content-selectors>.

[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 {
  $doc->inner_html
      (q[<section><p></p><p></p><section><p></p></section><p></p></section>]);
  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.