File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -1893,7 +1893,7 @@ namespace Sass {
1893
1893
return false ;
1894
1894
}
1895
1895
virtual unsigned long specificity () {
1896
- return Constants::Specificity_Universal ;
1896
+ return 0 ;
1897
1897
}
1898
1898
virtual void set_media_block (Media_Block* mb) {
1899
1899
media_block (mb);
@@ -2034,6 +2034,10 @@ namespace Sass {
2034
2034
Selector_Placeholder (ParserState pstate, std::string n)
2035
2035
: Simple_Selector(pstate, n)
2036
2036
{ has_placeholder (true ); }
2037
+ virtual unsigned long specificity ()
2038
+ {
2039
+ return Constants::Specificity_Base;
2040
+ }
2037
2041
// virtual Selector_Placeholder* find_placeholder();
2038
2042
virtual ~Selector_Placeholder () {};
2039
2043
ATTACH_OPERATIONS ()
@@ -2049,8 +2053,7 @@ namespace Sass {
2049
2053
{ }
2050
2054
virtual unsigned long specificity ()
2051
2055
{
2052
- // ToDo: What is the specificity of the star selector?
2053
- if (name () == " *" ) return Constants::Specificity_Universal;
2056
+ if (name () == " *" ) return 0 ;
2054
2057
else return Constants::Specificity_Type;
2055
2058
}
2056
2059
virtual Simple_Selector* unify_with (Simple_Selector*, Context&);
Original file line number Diff line number Diff line change @@ -10,12 +10,13 @@ namespace Sass {
10
10
// https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
11
11
// https://github.com/sass/sass/issues/1495#issuecomment-61189114
12
12
extern const unsigned long Specificity_Star = 0 ;
13
- extern const unsigned long Specificity_Universal = 1 << 0 ;
14
- extern const unsigned long Specificity_Type = 1 << 8 ;
15
- extern const unsigned long Specificity_Class = 1 << 16 ;
16
- extern const unsigned long Specificity_Attr = 1 << 16 ;
17
- extern const unsigned long Specificity_Pseudo = 1 << 16 ;
18
- extern const unsigned long Specificity_ID = 1 << 24 ;
13
+ extern const unsigned long Specificity_Universal = 0 ;
14
+ extern const unsigned long Specificity_Type = 1 ;
15
+ extern const unsigned long Specificity_Base = 1000 ;
16
+ extern const unsigned long Specificity_Class = 1000 ;
17
+ extern const unsigned long Specificity_Attr = 1000 ;
18
+ extern const unsigned long Specificity_Pseudo = 1000 ;
19
+ extern const unsigned long Specificity_ID = 1000000 ;
19
20
20
21
// sass keywords
21
22
extern const char at_root_kwd[] = " @at-root" ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ namespace Sass {
12
12
extern const unsigned long Specificity_Star;
13
13
extern const unsigned long Specificity_Universal;
14
14
extern const unsigned long Specificity_Type;
15
+ extern const unsigned long Specificity_Base;
15
16
extern const unsigned long Specificity_Class;
16
17
extern const unsigned long Specificity_Attr;
17
18
extern const unsigned long Specificity_Pseudo;
You can’t perform that action at this time.
0 commit comments