{"action":"created","issue":{"url":"https://api.github.com/repos/magnars/optimus/issues/41","labels_url":"https://api.github.com/repos/magnars/optimus/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/magnars/optimus/issues/41/comments","events_url":"https://api.github.com/repos/magnars/optimus/issues/41/events","html_url":"https://github.com/magnars/optimus/issues/41","id":93640311,"number":41,"title":"Can't bundle CSS containing behavior:url(#id) ","user":{"login":"arohner","id":15422,"avatar_url":"https://avatars.githubusercontent.com/u/15422?v=3","gravatar_id":"","url":"https://api.github.com/users/arohner","html_url":"https://github.com/arohner","followers_url":"https://api.github.com/users/arohner/followers","following_url":"https://api.github.com/users/arohner/following{/other_user}","gists_url":"https://api.github.com/users/arohner/gists{/gist_id}","starred_url":"https://api.github.com/users/arohner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arohner/subscriptions","organizations_url":"https://api.github.com/users/arohner/orgs","repos_url":"https://api.github.com/users/arohner/repos","events_url":"https://api.github.com/users/arohner/events{/privacy}","received_events_url":"https://api.github.com/users/arohner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-07T22:06:15Z","updated_at":"2015-07-07T22:47:37Z","closed_at":null,"body":"Try to bundle https://github.com/mapbox/mapbox.js/ 's css, which contains:\r\n\r\n`.foo { behavior:url(#default#VML); }` [1]\r\n\r\nWhen trying to load the bundle, you'll get an exception like:\r\n\r\n```\r\nCaused by: java.io.FileNotFoundException: /home/ubuntu/rasterize/resources/public/bower/mapbox.js (Is a directory)\r\n at java.io.FileInputStream.open0 (FileInputStream.java:-2)\r\n    java.io.FileInputStream.open (FileInputStream.java:195)\r\n    java.io.FileInputStream.<init> (FileInputStream.java:138)\r\n    clojure.java.io/fn (io.clj:238)\r\n    clojure.java.io$fn__9102$G__9095__9109.invoke (io.clj:69)\r\n    clojure.java.io/fn (io.clj:165)\r\n    clojure.java.io$fn__9115$G__9091__9122.invoke (io.clj:69)\r\n    clojure.java.io$reader.doInvoke (io.clj:102)\r\n    clojure.lang.RestFn.invoke (RestFn.java:410)\r\n    clojure.lang.AFn.applyToHelper (AFn.java:154)\r\n    clojure.lang.RestFn.applyTo (RestFn.java:132)\r\n    clojure.core$apply.invoke (core.clj:632)\r\n    clojure.core$slurp.doInvoke (core.clj:6653)\r\n    clojure.lang.RestFn.invoke (RestFn.java:410)\r\n    optimus.optimizations.add_cache_busted_expires_headers$get_contents.invoke (add_cache_busted_expires_headers.clj:18)\r\n    optimus.optimizations.add_cache_busted_expires_headers$add_cache_busted_expires_header.invoke (add_cache_busted_expires_headers.clj:23)\r\n    optimus.optimizations.add_cache_busted_expires_headers$add_cache_busted_expires_headers_in_order.invoke (add_cache_busted_expires_headers.clj:68)\r\n    optimus.optimizations.add_cache_busted_expires_headers$add_cache_busted_expires_headers.invoke (add_cache_busted_expires_headers.clj:74)\r\n    rasterize.http.assets$full_optimizations.invoke (assets.clj:30)\r\n    optimus.strategies$serve_frozen_assets.invoke (strategies.clj:40)\r\n    optimus.prime$wrap.doInvoke (prime.clj:4)\r\n    clojure.lang.RestFn.invoke (RestFn.java:470)\r\n    rasterize.http.assets$wrap_assets.invoke (assets.clj:38)\r\n    rasterize.http.app.WebApp.start (app.clj:94)\r\n```\r\n\r\nIt looks like what's happening is that optimus.assets.load-css first converts `url(#default#VML)` to an absolute url: `\"/bower/mapbox.js/#default#VML\"`, and then calls `remove-url-appendages` which leaves `\"/bower/mapbox.js/\"`as an asset path. Code downstream tries to slurp, and throws the 'is a directory' exception.\r\n\r\n\r\n[1] - This appears to be an IE CSS extension: http://stackoverflow.com/questions/26339276/what-is-behavior-url-property-in-css\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/magnars/optimus/issues/comments/119365713","html_url":"https://github.com/magnars/optimus/issues/41#issuecomment-119365713","issue_url":"https://api.github.com/repos/magnars/optimus/issues/41","id":119365713,"user":{"login":"magnars","id":265785,"avatar_url":"https://avatars.githubusercontent.com/u/265785?v=3","gravatar_id":"","url":"https://api.github.com/users/magnars","html_url":"https://github.com/magnars","followers_url":"https://api.github.com/users/magnars/followers","following_url":"https://api.github.com/users/magnars/following{/other_user}","gists_url":"https://api.github.com/users/magnars/gists{/gist_id}","starred_url":"https://api.github.com/users/magnars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magnars/subscriptions","organizations_url":"https://api.github.com/users/magnars/orgs","repos_url":"https://api.github.com/users/magnars/repos","events_url":"https://api.github.com/users/magnars/events{/privacy}","received_events_url":"https://api.github.com/users/magnars/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T22:47:37Z","updated_at":"2015-07-07T22:47:37Z","body":"Wow, that is a peculiar use of `url` - targeting a DOM element. Even IE has stopped supporting it. I'm inclined to say \"won't fix\", in particular because `behavior` URLs can also be actual URLs - and because load-css doesn't do any actual CSS-parsing (it leaves that to clean-css). I guess the code could know that, while \"#foo\" is a valid relative url, it does not make sense as a CSS url, so leave it alone.\r\n\r\nAny thoughts?"}}