aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/PuerkitoBio/goquery/expand.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/PuerkitoBio/goquery/expand.go')
-rw-r--r--vendor/github.com/PuerkitoBio/goquery/expand.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/github.com/PuerkitoBio/goquery/expand.go b/vendor/github.com/PuerkitoBio/goquery/expand.go
index f0c6c86..7caade5 100644
--- a/vendor/github.com/PuerkitoBio/goquery/expand.go
+++ b/vendor/github.com/PuerkitoBio/goquery/expand.go
@@ -41,6 +41,30 @@ func (s *Selection) AddNodes(nodes ...*html.Node) *Selection {
// AndSelf adds the previous set of elements on the stack to the current set.
// It returns a new Selection object containing the current Selection combined
// with the previous one.
+// Deprecated: This function has been deprecated and is now an alias for AddBack().
func (s *Selection) AndSelf() *Selection {
+ return s.AddBack()
+}
+
+// AddBack adds the previous set of elements on the stack to the current set.
+// It returns a new Selection object containing the current Selection combined
+// with the previous one.
+func (s *Selection) AddBack() *Selection {
return s.AddSelection(s.prevSel)
}
+
+// AddBackFiltered reduces the previous set of elements on the stack to those that
+// match the selector string, and adds them to the current set.
+// It returns a new Selection object containing the current Selection combined
+// with the filtered previous one
+func (s *Selection) AddBackFiltered(selector string) *Selection {
+ return s.AddSelection(s.prevSel.Filter(selector))
+}
+
+// AddBackMatcher reduces the previous set of elements on the stack to those that match
+// the mateher, and adds them to the curernt set.
+// It returns a new Selection object containing the current Selection combined
+// with the filtered previous one
+func (s *Selection) AddBackMatcher(m Matcher) *Selection {
+ return s.AddSelection(s.prevSel.FilterMatcher(m))
+}