Menu

#6 stylesheetDeclaration expects braces

closed
None
5
2012-07-18
2005-04-27
No

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.)

Discussion

  • Nobody/Anonymous

    Logged In: NO

    I noticed this too. I simply added braces around the CSS
    declaration, and it then worked as expected.

     
  • Michael hall

    Michael hall - 2006-11-15

    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.

     
  • Johannes Koch

    Johannes Koch - 2008-03-13

    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.

     
  • Daniel Gredler

    Daniel Gredler - 2008-03-25

    Logged In: YES
    user_id=1109422
    Originator: NO

    This is fixed, I've added a regression unit test.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.