Skip to content

Commit

Permalink
Allow @supports and @Viewport (without checking)
Browse files Browse the repository at this point in the history
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 (because adding real, full support will make it unnecessary).

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
  • Loading branch information
sideshowbarker committed Feb 15, 2018
1 parent d4f15aa commit b134d91
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
53 changes: 28 additions & 25 deletions org/w3c/css/parser/analyzer/CssParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,10 @@ final public void ignoreStatement() throws ParseException {
addAtRuleError();
}
} else {
addAtRuleError();
if (!n.toString().startsWith("@supports")
&& !n.toString().startsWith("@viewport")) {
addAtRuleError();
}
}
skipStatement();
}
Expand Down Expand Up @@ -5731,30 +5734,6 @@ private boolean jj_2_5(int xla)
finally { jj_save(4, xla); }
}

private boolean jj_3R_175()
{
if (jj_scan_token(STRING)) return true;
return false;
}

private boolean jj_3R_154()
{
if (jj_scan_token(PLUS)) return true;
return false;
}

private boolean jj_3R_174()
{
if (jj_3R_183()) return true;
return false;
}

private boolean jj_3R_173()
{
if (jj_3R_152()) return true;
return false;
}

private boolean jj_3R_172()
{
if (jj_3R_151()) return true;
Expand Down Expand Up @@ -6375,6 +6354,30 @@ private boolean jj_3R_176()
return false;
}

private boolean jj_3R_175()
{
if (jj_scan_token(STRING)) return true;
return false;
}

private boolean jj_3R_154()
{
if (jj_scan_token(PLUS)) return true;
return false;
}

private boolean jj_3R_174()
{
if (jj_3R_183()) return true;
return false;
}

private boolean jj_3R_173()
{
if (jj_3R_152()) return true;
return false;
}

/** Generated Token Manager. */
public CssParserTokenManager token_source;
SimpleCharStream jj_input_stream;
Expand Down
5 changes: 4 additions & 1 deletion org/w3c/css/parser/analyzer/CssParser.jj
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,10 @@ void atRuleDeclaration() :
addAtRuleError();
}
} else {
addAtRuleError();
if (!n.toString().startsWith("@supports")
&& !n.toString().startsWith("@viewport")) {
addAtRuleError();
}
}
skipStatement();
}
Expand Down

0 comments on commit b134d91

Please sign in to comment.