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);
@@ -2038,6 +2038,10 @@ namespace Sass {
2038
2038
Selector_Placeholder (ParserState pstate, std::string n)
2039
2039
: Simple_Selector(pstate, n)
2040
2040
{ has_placeholder (true ); }
2041
+ virtual unsigned long specificity ()
2042
+ {
2043
+ return Constants::Specificity_Base;
2044
+ }
2041
2045
// virtual Selector_Placeholder* find_placeholder();
2042
2046
virtual ~Selector_Placeholder () {};
2043
2047
ATTACH_OPERATIONS ()
@@ -2053,8 +2057,7 @@ namespace Sass {
2053
2057
{ }
2054
2058
virtual unsigned long specificity ()
2055
2059
{
2056
- // ToDo: What is the specificity of the star selector?
2057
- if (name () == " *" ) return Constants::Specificity_Universal;
2060
+ if (name () == " *" ) return 0 ;
2058
2061
else return Constants::Specificity_Type;
2059
2062
}
2060
2063
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