I've gone as far as I can with using regular expressions to find the URLs. I'm looking for an ASL-licensed library that can parse the CSS properly (or I'll have to write it myself).
On Wed, Jul 24, 2013 at 6:35 AM, Michael Gentry <[email protected]>wrote: > Hi Thiago and Peter, > > I believe this re-opened JIRA already covers it: > > https://issues.apache.org/jira/browse/TAP5-2106 > > Howard fixed some of the CSS URL rewriting a while back (we are using > it in a production-deployed application now), but perhaps more issues > still remain. > > Thanks, > > mrg > > > On Wed, Jul 24, 2013 at 8:22 AM, Thiago H de Paula Figueiredo > <[email protected]> wrote: > > On Wed, 24 Jul 2013 05:34:17 -0300, Peter Hvass <[email protected]> > > wrote: > > > >> Hello, > > > > > > Hi! > > > >> Further information! > > > > > > Thanks! Could you please file a JIRA about this? It surely looks like a > bug. > > > > > >> > >> > >> A further issue, lines in CSS files that are commented out and contain > url > >> declarations > >> do not escape the URL rewriting code. > >> > >> > >> For example: > >> > >> /* url('../font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') > >> format('svg'); */ > >> > >> > >> Yields exception with message: > >> Unable to locate asset > >> > 'classpath:META-INF/assets/font-awesome/font/fontawesome-webfont.svg#fontawesomeregular' > >> (the file does not exist). > >> > >> Thanks, > >> Peter > >> ----- Original Message ----- > >> > >> From: "Peter Hvass" <[email protected]> > >> To: "Tapestry users" <[email protected]> > >> Sent: Wednesday, July 24, 2013 11:21:07 AM > >> Subject: Tapestry 5.4 url paths in css > >> > >> Hello, > >> > >> > >> We're in the process of moving a couple of our projects over to 5.4 > (fun, > >> fun times). So far it's been really smooth sailing, our old 5.3 code > >> becoming so much more elegant with the use of RequireJS and properly > taking > >> advantage of data attributes. > >> > >> > >> Now comes the first problem we've run into - whatever code is > responsible > >> for CSS URL rewriting is anticipating only one URL declaration per > >> line/rule. > >> > >> > >> We have a mixin class for including Font Awesome ( > >> http://fortawesome.github.io/Font-Awesome/ ). And we include it in > >> components/pages by going @Mixin private FontAwesome fontAwesome. > >> > >> > >> It is simply; > >> > >> @Import(stylesheet = "font-awesome/css/font-awesome.css") > >> public class FontAwesome { > >> } > >> > >> > >> font-awesome folder lives under META-INF/assets/ and contains > >> css/font-awesome.css and font/ with > >> the various font formats. > >> > >> > >> Lines 28-34 of font-awesome.css look like this: > >> > >> @font-face { > >> font-family: 'FontAwesome'; > >> src: url('../font/fontawesome-webfont.eot?v=3.2.1'); > >> src: url('../font/fontawesome-webfont.eot?#iefix&v=3.2.1') > >> format('embedded-opentype'), > url('../font/fontawesome-webfont.woff?v=3.2.1') > >> format('woff'), url('../font/fontawesome-webfont.ttf?v=3.2.1') > >> format('truetype'), > >> url('../font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') > >> format('svg'); > >> font-weight: normal; > >> font-style: normal; > >> } > >> > >> > >> So far so good, but now we load the page including FontAwesome mixin, > >> inspecting font-awesome.css > >> we see that the URLs have been rewritten as follows; > >> > >> src: > >> > url("/proj/asset.gz/meta/8cc12c35/font-awesome/font/fontawesome-webfont.eot?v=3.2.1"); > >> src: > >> > url("/proj/asset.gz/meta/8cc12c35/font-awesome/font/fontawesome-webfont.eot?#iefix&v=3.2.1') > >> format('embedded-opentype'), > url('../font/fontawesome-webfont.woff?v=3.2.1') > >> format('woff'), url('../font/fontawesome-webfont.ttf?v=3.2.1') > >> format('truetype'), > >> url('../font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') > >> format('svg"); > >> > >> > >> Some of them have been rewritten to path using the hash tag for > >> reload/cache stuff, some have been left untouched. > >> Upon looking at the network tab in dev tools, only > fontawesome-webfont.eot > >> is downloaded, and it's valid. All the specified > >> font files should be downloaded, however. This is a way of ensuring > >> cross-browser fonts. > >> > >> > >> When changing this to put each url() on its own src: line, Tapestry > >> correctly rewrites each url() as follows, confirming my suspicions. > >> src: > >> > url("/proj/asset.gz/meta/8cc12c35/font-awesome/font/fontawesome-webfont.eot?v=3.2.1"); > >> > >> src: > >> > url("/proj/asset.gz/meta/8cc12c35/font-awesome/font/fontawesome-webfont.eot?#iefix&v=3.2.1') > >> format('embedded-opentype"); > >> src: > >> > url("/proj/asset.gz/meta/5d616c87/font-awesome/font/fontawesome-webfont.woff?v=3.2.1') > >> format('woff"); > >> src: > >> > url("/proj/asset.gz/meta/7222b578/font-awesome/font/fontawesome-webfont.ttf?v=3.2.1') > >> format('truetype"); > >> src: > >> > url("/proj/asset.gz/meta/e0edf310/font-awesome/font/fontawesome-webfont.svg") > >> format('svg'); > >> > >> > >> Would be great if this could be fixed in the next alpha (or beta)! > >> > >> > >> Thanks for all the hard work so far towards 5.4; we are really enjoying > >> using it much more than 5.3! > >> > >> > >> Peter > > > > > > > > -- > > Thiago H. de Paula Figueiredo > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com
