File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
org/w3c/css/parser/analyzer Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -2030,16 +2030,20 @@ void ruleSet() :
2030
2030
if ((ac.getCssProfile() != CssProfile.MOBILE) && !context_set.isEmpty()) {
2031
2031
String ret = skipStatement();
2032
2032
CssVersion version = ac.getCssVersion();
2033
- Token t1 = getToken(1 );
2033
+ Token t1 = getToken(0 );
2034
2034
if (version.compareTo(CssVersion.CSS3) < 0) {
2035
2035
addError(e, ret);
2036
2036
} else if ((ret != null) && !ret.startsWith("/*") && (t1 != null && t1.kind != EOF)) {
2037
2037
addError(e, ret);
2038
+ } else if (!context_set.isEmpty() && value_set == null) {
2039
+ addError(e, ret);
2038
2040
} else {
2039
- // unterminated comment, skip until EOF
2040
- Token t = getToken(0);
2041
- while(t.kind != EOF) {
2042
- t = getNextToken();
2041
+ if ((ret != null) && ret.startsWith("/*")) {
2042
+ // unterminated comment, skip until EOF
2043
+ Token t = getToken(0);
2044
+ while(t.kind != EOF) {
2045
+ t = getNextToken();
2046
+ }
2043
2047
}
2044
2048
// then process
2045
2049
if (version.compareTo(CssVersion.CSS3) >= 0) {
@@ -3571,12 +3575,12 @@ String skipStatement() {
3571
3575
}
3572
3576
first = false;
3573
3577
}
3574
-
3578
+ getNextToken();
3575
3579
// skip white space
3576
- while (tok.kind == S) {
3580
+ /* while (tok.kind == S) {
3577
3581
getNextToken();
3578
3582
tok = getToken(1);
3579
- }
3583
+ } */
3580
3584
String statement = s.toString().trim();
3581
3585
return statement;
3582
3586
}
@@ -3598,6 +3602,7 @@ String skip_to_matching_brace() {
3598
3602
} else if (tok.kind == RBRACE) {
3599
3603
nesting--;
3600
3604
if (nesting == 0) {
3605
+ s.append(tok.image);
3601
3606
break;
3602
3607
}
3603
3608
}
You can’t perform that action at this time.
0 commit comments