Skip to content

Commit 909df48

Browse files
committed
Fix spacing in Specificity.js
1 parent 41c66fc commit 909df48

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

src/css/Specificity.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function Specificity(a, b, c, d){
1818

1919
Specificity.prototype = {
2020
constructor: Specificity,
21-
21+
2222
/**
2323
* Compare this specificity to another.
2424
* @param {Specificity} other The other specificity to compare to.
@@ -28,18 +28,18 @@ Specificity.prototype = {
2828
compare: function(other){
2929
var comps = ["a", "b", "c", "d"],
3030
i, len;
31-
31+
3232
for (i=0, len=comps.length; i < len; i++){
3333
if (this[comps[i]] < other[comps[i]]){
3434
return -1;
3535
} else if (this[comps[i]] > other[comps[i]]){
3636
return 1;
3737
}
3838
}
39-
39+
4040
return 0;
4141
},
42-
42+
4343
/**
4444
* Creates a numeric value for the specificity.
4545
* @return {int} The numeric value for the specificity.
@@ -48,7 +48,7 @@ Specificity.prototype = {
4848
valueOf: function(){
4949
return (this.a * 1000) + (this.b * 100) + (this.c * 10) + this.d;
5050
},
51-
51+
5252
/**
5353
* Returns a string representation for specificity.
5454
* @return {String} The string representation of specificity.
@@ -72,52 +72,52 @@ Specificity.calculate = function(selector){
7272
var i, len,
7373
part,
7474
b=0, c=0, d=0;
75-
75+
7676
function updateValues(part){
77-
77+
7878
var i, j, len, num,
7979
elementName = part.elementName ? part.elementName.text : "",
8080
modifier;
81-
81+
8282
if (elementName && elementName.charAt(elementName.length-1) != "*") {
8383
d++;
84-
}
85-
84+
}
85+
8686
for (i=0, len=part.modifiers.length; i < len; i++){
8787
modifier = part.modifiers[i];
8888
switch(modifier.type){
8989
case "class":
9090
case "attribute":
9191
c++;
9292
break;
93-
93+
9494
case "id":
9595
b++;
9696
break;
97-
97+
9898
case "pseudo":
9999
if (Pseudos.isElement(modifier.text)){
100100
d++;
101101
} else {
102102
c++;
103-
}
103+
}
104104
break;
105-
105+
106106
case "not":
107107
for (j=0, num=modifier.args.length; j < num; j++){
108108
updateValues(modifier.args[j]);
109109
}
110-
}
110+
}
111111
}
112112
}
113-
113+
114114
for (i=0, len=selector.parts.length; i < len; i++){
115115
part = selector.parts[i];
116-
116+
117117
if (part instanceof SelectorPart){
118-
updateValues(part);
118+
updateValues(part);
119119
}
120120
}
121-
121+
122122
return new Specificity(0, b, c, d);
123123
};

0 commit comments

Comments
 (0)