[ https://issues.apache.org/jira/browse/TAP5-2791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17897026#comment-17897026 ]
ASF subversion and git services commented on TAP5-2791: ------------------------------------------------------- Commit d288764bcf08ad22644ebfdc5b7eea324e99eecc in tapestry-5's branch refs/heads/javax from Ben Weidig [ https://gitbox.apache.org/repos/asf?p=tapestry-5.git;h=d288764bc ] TAP5-2791: Fixing CssCompressor SVG data url handling > CssCompressor for CSS files produces wrong minification for url() function, > at least with data URLs > --------------------------------------------------------------------------------------------------- > > Key: TAP5-2791 > URL: https://issues.apache.org/jira/browse/TAP5-2791 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-webresources > Affects Versions: 5.8.0, 5.8.7 > Reporter: Hendrik Noot > Assignee: Ben Weidig > Priority: Major > > This problem is closely related to TAP5-2753 and caused by the optimisation > (yuicompressor update) from TAP5-2708. > The CssCompressor removes white spaces from url() functions inside CSS files. > So for example if you use a SVG as an backround image something like > 'urlheight="1em" viewBox="0 0 576 512"' becomes > 'height="1em"viewBox="00576512"' which breaks the SVG. > There is also an open issue for yuicompressor: > [https://github.com/yui/yuicompressor/issues/344] > The fix inside the CssCompressor is to disable white space removal for the > url function, change: > {code:java} > css = preserveToken(css, "url", PRESERVE_TOKEN_URL, true, "TOKEN", > preservedTokens); {code} > to: > {code:java} > css = preserveToken(css, "url", PRESERVE_TOKEN_URL, false, "TOKEN", > preservedTokens); > {code} > This works for me and I couldn't find any negative side effects. > If needed I can provide a pull request. -- This message was sent by Atlassian Jira (v8.20.10#820010)