Ticket #2657 (closed defect: wontfix)

Opened 20 months ago

Last modified 14 months ago

'intern-strings' does not correctly expand URLs inside of CSS

Reported by: bradneuberg Owned by: jburke
Priority: normal Milestone: 1.0
Component: BuildSystem Version: 0.4.2
Severity: major Keywords:
Cc:

Description

The Dojo build system's 'intern-strings' directive is meant to inline widget HTML and CSS resources directly into the generated dojo.js file. If that CSS file contains a URL directive, such as the following from EditorToolbar?.css:

.dojoE2TBIcon {

background-image: url(buttons/aggregate.gif);

}

the 'intern-strings' widget doesn't correctly expand this into a relative address that is now relative to dojo.js, rather than the src/widgets/templates/ directory. This causes it to break and not display our images.

This impacts the Editor2 widget, which has a system to bundle up all the toolbar images into a single GIF file, which it then references using a CSS url() directive and CSS clipping directives to get each icon seperately. This can speed up page load time since all the GIF resources are essentially in one file. Without fixing this 'intern-strings' bug though, this doesn't work, which affects me with Moxie and Dojo Offline, contributing to slow page load.

I have attached a patch to fix this issue, applied to the file buildUtil.py.

Attachments

buildUtil.py.diff (1.1 kB) - added by bradneuberg 20 months ago.
Diff with patch to fix bug

Change History

Changed 20 months ago by bradneuberg

Diff with patch to fix bug

Changed 20 months ago by bradneuberg

Hold off on integrating this patch -- there's a bug in it that I'm still tracking down.

Changed 20 months ago by bill

In dijit we've gotten rid of templateCssPath altogether; I'll leave this bug open though, just in case we want to merge it to a 0.4.3, or if we change our mind about supporting templateCssPath in dijit.

Changed 20 months ago by jburke

I think the way to fix this is by modifying the module's JS code that uses the interned string to hold on to the original path, and pass the path to the dojo.html.insertCssText() method and have that method fix the paths at runtime. This is what happens for templateCssPath/String variables inside widgets.

Changed 16 months ago by peller

  • owner changed from alex to jburke

Changed 16 months ago by jburke

  • status changed from new to closed
  • resolution set to wontfix
  • milestone set to 1.0

Changed 16 months ago by jburke

  • status changed from closed to reopened
  • resolution deleted

Changed 14 months ago by jburke

  • status changed from reopened to closed
  • resolution set to wontfix

This use case is obsolete in 1.0.

Note: See TracTickets for help on using tickets.