@@ -1889,6 +1889,9 @@ namespace Sass {
18891889 virtual void set_media_block (Media_Block* mb) {
18901890 media_block (mb);
18911891 }
1892+ virtual bool has_wrapped_selector () {
1893+ return false ;
1894+ }
18921895 };
18931896 inline Selector::~Selector () { }
18941897
@@ -2185,6 +2188,10 @@ namespace Sass {
21852188 }
21862189 return hash_;
21872190 }
2191+ virtual bool has_wrapped_selector ()
2192+ {
2193+ return true ;
2194+ }
21882195 virtual unsigned long specificity ()
21892196 {
21902197 return selector_ ? selector_->specificity () : 0 ;
@@ -2270,6 +2277,15 @@ namespace Sass {
22702277 return sum;
22712278 }
22722279
2280+ virtual bool has_wrapped_selector ()
2281+ {
2282+ if (length () == 0 ) return false ;
2283+ if (Simple_Selector* ss = elements ().front ()) {
2284+ if (ss->has_wrapped_selector ()) return true ;
2285+ }
2286+ return false ;
2287+ }
2288+
22732289 bool is_empty_reference ()
22742290 {
22752291 return length () == 1 &&
@@ -2398,6 +2414,11 @@ namespace Sass {
23982414 if (tail_) tail_->set_media_block (mb);
23992415 if (head_) head_->set_media_block (mb);
24002416 }
2417+ virtual bool has_wrapped_selector () {
2418+ if (head_ && head_->has_wrapped_selector ()) return true ;
2419+ if (tail_ && tail_->has_wrapped_selector ()) return true ;
2420+ return false ;
2421+ }
24012422 bool operator <(const Complex_Selector& rhs) const ;
24022423 bool operator ==(const Complex_Selector& rhs) const ;
24032424 inline bool operator !=(const Complex_Selector& rhs) const { return !(*this == rhs); }
@@ -2506,6 +2527,12 @@ namespace Sass {
25062527 cs->set_media_block (mb);
25072528 }
25082529 }
2530+ virtual bool has_wrapped_selector () {
2531+ for (Complex_Selector* cs : elements ()) {
2532+ if (cs->has_wrapped_selector ()) return true ;
2533+ }
2534+ return false ;
2535+ }
25092536 Selector_List* clone (Context&) const ; // does not clone Compound_Selector*s
25102537 Selector_List* cloneFully (Context&) const ; // clones Compound_Selector*s
25112538 virtual bool operator ==(const Selector& rhs) const ;
0 commit comments