Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Duplicate
-
5.3.3
-
None
Description
We're using a progress spinner (http://fgnass.github.com/spin.js/) which inserts an inline style via JS in our application.
When a ajax response is processed the href attribute of all the stylesheets gets rebuilt if the agent is IE.
The problematic lines are (beginning line 2042 in tapestry.js:
addStylesheets : function(stylesheets) { if (!stylesheets) return; var _ = T5._; var loaded = _(document.styleSheets).chain().pluck("href").without("").map(this.rebuildURLIfIE).value(); ... rebuildURLIfIE : Prototype.Browser.IE ? Tapestry.rebuildURL : T5._.identity,
In IE8 the empty/missing href in the inline style tag evaluates to an empty string ("") which is correctly removed by without(""), in IE9 instead it's evaluated to null.
rebuildURLIfIE evaluates to Tapestry.rebuildURL for IE, when a href equals to null an exception is thrown as soon as the path parameter is accessed:
rebuildURL : function(path) { if (path.match(/^https?:/)) { ...
The issue can be easily fixed by adding without(null) above line:
... var loaded = _(document.styleSheets).chain().pluck("href").without("").without(null).map(this.rebuildURLIfIE).value(); ...
In FF the problem would be the same as an empty href in the style tag also evaluates to null, still the problem doesn't appear as the attribute is only rebuild for IE.
Attachments
Issue Links
- is related to
-
TAP5-1907 Client exception in IE9 when partial page render introduces stylesheets
- Closed