CSSOMParser.parseStyleshetDeclaration currently expects
braces around the declarations, but the SAC javadocs
(1.3) mention that the text is without the braces. see
http://www.w3.org/Style/CSS/SAC/doc/org/w3c/css/sac/Parser.html#parseStyleDeclaration_org.w3c.css.sac.InputSource_
The error is
java.lang.RuntimeException:
org.w3c.css.sac.CSSException: Encountered
"background-color:white" at line 1, column 1.
Was expecting:
"{" ...
(If I've misunderstood the api, I'm looking for a way
to parse the contents of the HTML style attribute.)
Anonymous
Logged In: NO
I noticed this too. I simply added braces around the CSS
declaration, and it then worked as expected.
Logged In: YES
user_id=491022
Originator: NO
Are you calling CSSOMParser.parseStyleDeclaration() or CSSOMParser.parseStyleSheet()?
I don't see CSSOMParser.parseStyleSheetDeclaration() in the javadocs.
parseStyleDeclaration expects the contents of the <selector>{} (aka, the Declaration), while parseStyleSheet expects everything including <selector>{} (aka, the StyleSheet).
Hope this clears things up for you.
Logged In: YES
user_id=663593
Originator: NO
I can't reproduce this issue. Maybe the bug was already fixed. So the issue can be closed.
Logged In: YES
user_id=1109422
Originator: NO
This is fixed, I've added a regression unit test.