@@ -14,6 +14,7 @@ import '../visitor/serialize.dart';
14
14
import 'node.dart' ;
15
15
import 'selector/complex.dart' ;
16
16
import 'selector/list.dart' ;
17
+ import 'selector/parent.dart' ;
17
18
import 'selector/placeholder.dart' ;
18
19
import 'selector/pseudo.dart' ;
19
20
@@ -49,6 +50,13 @@ abstract base class Selector implements AstNode {
49
50
@internal
50
51
bool get isInvisible => accept (const _IsInvisibleVisitor (includeBogus: true ));
51
52
53
+ /// Whether this selector contains a [ParentSelector] .
54
+ ///
55
+ /// @nodoc
56
+ @internal
57
+ bool get containsParentSelector =>
58
+ accept (const _ContainsParentSelectorVisitor ());
59
+
52
60
// Whether this selector would be invisible even if it didn't have bogus
53
61
// combinators.
54
62
///
@@ -169,7 +177,7 @@ class _IsBogusVisitor with AnySelectorVisitor {
169
177
}
170
178
}
171
179
172
- /// The visitor used to implement [Selector.isUseless]
180
+ /// The visitor used to implement [Selector.isUseless] .
173
181
class _IsUselessVisitor with AnySelectorVisitor {
174
182
const _IsUselessVisitor ();
175
183
@@ -182,3 +190,10 @@ class _IsUselessVisitor with AnySelectorVisitor {
182
190
183
191
bool visitPseudoSelector (PseudoSelector pseudo) => pseudo.isBogus;
184
192
}
193
+
194
+ /// The visitor used to implement [Selector.containsParentSelector] .
195
+ class _ContainsParentSelectorVisitor with AnySelectorVisitor {
196
+ const _ContainsParentSelectorVisitor ();
197
+
198
+ bool visitParentSelector (ParentSelector _) => true ;
199
+ }
0 commit comments