@@ -1889,6 +1889,9 @@ namespace Sass {
1889
1889
virtual void set_media_block (Media_Block* mb) {
1890
1890
media_block (mb);
1891
1891
}
1892
+ virtual bool has_wrapped_selector () {
1893
+ return false ;
1894
+ }
1892
1895
};
1893
1896
inline Selector::~Selector () { }
1894
1897
@@ -2185,6 +2188,10 @@ namespace Sass {
2185
2188
}
2186
2189
return hash_;
2187
2190
}
2191
+ virtual bool has_wrapped_selector ()
2192
+ {
2193
+ return true ;
2194
+ }
2188
2195
virtual unsigned long specificity ()
2189
2196
{
2190
2197
return selector_ ? selector_->specificity () : 0 ;
@@ -2270,6 +2277,15 @@ namespace Sass {
2270
2277
return sum;
2271
2278
}
2272
2279
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
+
2273
2289
bool is_empty_reference ()
2274
2290
{
2275
2291
return length () == 1 &&
@@ -2398,6 +2414,11 @@ namespace Sass {
2398
2414
if (tail_) tail_->set_media_block (mb);
2399
2415
if (head_) head_->set_media_block (mb);
2400
2416
}
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
+ }
2401
2422
bool operator <(const Complex_Selector& rhs) const ;
2402
2423
bool operator ==(const Complex_Selector& rhs) const ;
2403
2424
inline bool operator !=(const Complex_Selector& rhs) const { return !(*this == rhs); }
@@ -2506,6 +2527,12 @@ namespace Sass {
2506
2527
cs->set_media_block (mb);
2507
2528
}
2508
2529
}
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
+ }
2509
2536
Selector_List* clone (Context&) const ; // does not clone Compound_Selector*s
2510
2537
Selector_List* cloneFully (Context&) const ; // clones Compound_Selector*s
2511
2538
virtual bool operator ==(const Selector& rhs) const ;
0 commit comments