Details
-
Bug
-
Status: Resolved
-
Resolution: Fixed
-
1.5
-
None
-
None
-
Operating System: All
Platform: All
Description
The following ruleset does not parse:
{ page: ""; }The empty, quoted string seems not to be parsed properly. It works when the string contains at
least one character.
My local, uninformed quick fix to the problem is to change
-code-
protected int string2() throws IOException {
nextChar();
start = position - 1;
-code-
to
-code-
protected int string2() throws IOException {
start = position;
-code-
to not read one unchecked character from the input before it is checked against specials in
org.apache.batik.css.parser.Scanner.string2() .
Please note that I only had a look at the code for about 30 minutes (to find that place) and applied
that change locally as a quick fix. I have neither tested it against test suites nor any other situation
than my example above.
The CSS2.1 grammar seems to allow completely empty strings due to the rule
string1 \"(\t !#$%&(-~|
|\'|
{nonascii}|
{escape})*\"
A similar fix should probably be applied to string1().
Regards, Christian