Menu

#58 Can't specify URL when adding custom stylesheet

closed
nobody
None
1
2015-02-11
2014-10-31
Pcz
No

Hi,

i've discovered a bug in the method org.fit.cssbox.css.DOMAnalyzer.addStyleSheet(URL base, String cssdata, Origin origin)

.. the problem is that the "base" argument is IGNORED completely.

Also, there is no method like "public static StyleSheet parse(String css, URL url)" in JStyleParser

.. this bug causes that "file:/base/url/is/not/specified" is always returned by Declaration.Source.getUrl() when querying CSS properties defined by stylesheet that was added using the addStyleSheet method.

-- CSSBox version: 4.7 --

PS: I admire your work
have a nice day,
P

Discussion

  • Radek Burget

    Radek Burget - 2014-11-09

    Hi! You're right, the base should not be ignored. Moreover, the parse(String) function of CSSFactory is dangerous from this point of view because it silently replaces the base URL by some default.

    I have just pushed a new 'parsestring' branch of both jStyleParser where the parse(String) is replaced by a new parseString(String, URL) function. I have also made the the corresponding change in CSSBox.

    Any comments are appreciated.

     
  • Radek Burget

    Radek Burget - 2014-11-09
    • status: open --> accepted
     
  • Radek Burget

    Radek Burget - 2015-02-11
    • status: accepted --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB