Page MenuHomePhabricator

CSS minification regression in ResourceLoader: relative links to images not resolved correctly
Closed, ResolvedPublic

Description

I noticed a regression in the CSS minification that has broken the load/save spinner from showing in SVGEdit extension...

From styles in ext.svgedit.edit.editButton.css; original source:

#mw-svgedit-spinner {
position: absolute;

    top: 2em;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5)
		 url("../images/ajax-loader.gif")
		 50%
		 no-repeat;
    z-index: 999999

}

as minified with current trunk code:

#mw-svgedit-spinner {

background: url("/trunk/extensions/SVGEdit/modules//../images/ajax-loader.gif?2011-01-22T00:58:20Z") no-repeat scroll 50% 50% rgba(0, 0, 0, 0.5);

This ends up resolving to (on my localhost):
http://stormcloud.local/trunk/extensions/SVGEdit/modules/images/ajax-loader.gif?2011-01-22T00:58:20Z

where it should instead load:
http://stormcloud.local/trunk/extensions/SVGEdit/images/ajax-loader.gif?2011-01-22T00:58:20Z

Looks like the problem is that double slash: "modules//../images" -- if it instead said "modules/../images" it should at least resolve correctly client-side.

Relative module paths used for SVGEdit's module:

$myResourceTemplate = array(
'localBasePath' => dirname( FILE ) . '/modules',
'remoteExtPath' => 'SVGEdit/modules',
'group' => 'ext.svgedit',
);

Possible workaround: relative paths that don't need to bump into "../" territory appear to work with the double slashes, so if image and font resources are always at the same directory level or in a subdirectory of where the CSS lives, it should still work.


Version: 1.18.x
Severity: blocker

Details

Reference
bz27052
TitleReferenceAuthorSource BranchDest Branch
Update function-schemata sub-module to HEAD (7ad8a56)repos/abstract-wiki/wikifunctions/function-evaluator!12jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (21f0e63)repos/abstract-wiki/wikifunctions/function-orchestrator!8jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (21f0e63)repos/abstract-wiki/wikifunctions/wikilambda-cli!2jforrestersync-function-schematamain
definitions: [Z2] Add Z2K5/short descriptions, an optional Z12/multi-lingual stringrepos/abstract-wiki/wikifunctions/function-schemata!3jforresterT290522main
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:19 PM
bzimport set Reference to bz27052.

Fixed in r83902 by eliminating double slashes.