Incorrect interpretation of CSS @import
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Calibre 5.xx (all versions up to at least 5.20) incorrectly interprets @import url(...) rules in CSS sheets (when relative URLs are used. According to W3 ( http://
Attached example demonstrates the problem. We have the following files:
test.htm
test.css
a/test.css
a/b/test.css
Test.htm loads a/b/test.css using <link rel="stylesheet" href="a/b/test.css" type="text/css"/> and as far as I can tell, Calibre can process that correctly. a/b/test.css then loads a/test.css using @import url('../test.css'), and this also gets interpreted correctly by Calibre. Then a/test.css tries to load test.css using @import url('../test.css') and this will crash Calibre (but not a browser). As far as I can tell, the last @import rule will incorrectly try to load a/test.css again, and again, and again until it exhausts the stack.
I reported a similar error some time ago ( https:/
Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.
status fixreleased