IndexMatcher returns the position of the first element within the Selection object relative to the elements matched by the matcher, or -1 if not found.
(m Matcher)
| 107 | // Selection object relative to the elements matched by the matcher, or -1 if |
| 108 | // not found. |
| 109 | func (s *Selection) IndexMatcher(m Matcher) int { |
| 110 | if len(s.Nodes) > 0 { |
| 111 | sel := s.document.FindMatcher(m) |
| 112 | return indexInSlice(sel.Nodes, s.Nodes[0]) |
| 113 | } |
| 114 | return -1 |
| 115 | } |
| 116 | |
| 117 | // IndexOfNode returns the position of the specified node within the Selection |
| 118 | // object, or -1 if not found. |
nothing calls this directly
no test coverage detected