Skip to content

Commit d6bffbd

Browse files
Allow @supports and @Viewport (without checking)
This change is a temporary workaround that adds an interim/initial/partial level of support for allowing the @supports and @Viewport at-rules. The intent is that we’ll add full support for them later, and then at that time back this change out — or else at least just use it as a starting point for full support. This change simply causes no errors to be reported for stylesheets that use @supports and @Viewport. Beyond that, it doesn’t add any checking to report an error if the content of a particular @supports at-rule or @Viewport at-rule doesn’t conform to the requirements in the relevant CSS specs. Addresses #71
1 parent d4f15aa commit d6bffbd

File tree

2 files changed

+32
-26
lines changed

2 files changed

+32
-26
lines changed

org/w3c/css/parser/analyzer/CssParser.java

+28-25
Original file line numberDiff line numberDiff line change
@@ -2412,7 +2412,10 @@ final public void ignoreStatement() throws ParseException {
24122412
addAtRuleError();
24132413
}
24142414
} else {
2415-
addAtRuleError();
2415+
if (!n.toString().startsWith("@supports")
2416+
&& !n.toString().startsWith("@viewport")) {
2417+
addAtRuleError();
2418+
}
24162419
}
24172420
skipStatement();
24182421
}
@@ -5731,30 +5734,6 @@ private boolean jj_2_5(int xla)
57315734
finally { jj_save(4, xla); }
57325735
}
57335736

5734-
private boolean jj_3R_175()
5735-
{
5736-
if (jj_scan_token(STRING)) return true;
5737-
return false;
5738-
}
5739-
5740-
private boolean jj_3R_154()
5741-
{
5742-
if (jj_scan_token(PLUS)) return true;
5743-
return false;
5744-
}
5745-
5746-
private boolean jj_3R_174()
5747-
{
5748-
if (jj_3R_183()) return true;
5749-
return false;
5750-
}
5751-
5752-
private boolean jj_3R_173()
5753-
{
5754-
if (jj_3R_152()) return true;
5755-
return false;
5756-
}
5757-
57585737
private boolean jj_3R_172()
57595738
{
57605739
if (jj_3R_151()) return true;
@@ -6375,6 +6354,30 @@ private boolean jj_3R_176()
63756354
return false;
63766355
}
63776356

6357+
private boolean jj_3R_175()
6358+
{
6359+
if (jj_scan_token(STRING)) return true;
6360+
return false;
6361+
}
6362+
6363+
private boolean jj_3R_154()
6364+
{
6365+
if (jj_scan_token(PLUS)) return true;
6366+
return false;
6367+
}
6368+
6369+
private boolean jj_3R_174()
6370+
{
6371+
if (jj_3R_183()) return true;
6372+
return false;
6373+
}
6374+
6375+
private boolean jj_3R_173()
6376+
{
6377+
if (jj_3R_152()) return true;
6378+
return false;
6379+
}
6380+
63786381
/** Generated Token Manager. */
63796382
public CssParserTokenManager token_source;
63806383
SimpleCharStream jj_input_stream;

org/w3c/css/parser/analyzer/CssParser.jj

+4-1
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,10 @@ void atRuleDeclaration() :
15531553
addAtRuleError();
15541554
}
15551555
} else {
1556-
addAtRuleError();
1556+
if (!n.toString().startsWith("@supports")
1557+
&& !n.toString().startsWith("@viewport")) {
1558+
addAtRuleError();
1559+
}
15571560
}
15581561
skipStatement();
15591562
}

0 commit comments

Comments
 (0)