Can't specify URL when adding custom stylesheet
Pure Java HTML / CSS rendering engine
Status: Beta
Brought to you by:
radkovo
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
Anonymous
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.