Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
5.3.2
Description
I've found an incompatibility with ie9 and tapestry exposed when an ajax response renders a component(s) which include their own stylesheets.
This will call Tapestry.ScriptManager.addStylesheets.
The offending line 2048 in tapestry.js
var loaded = _(document.styleSheets).chain().pluck("href").without("").map(this.rebuildURLIfIE).value();
The problem is within
map(this.rebuildURLIfIE)
which is calling with a null path:
rebuildURL : function(path) {
if (path.match(/^https?:/))
...
Turns out, in ie9 (unlike all other browsers) the embedded stylesheets have a null href, not "" therefore the without("") does not filter the blank entries.
The solution is to add a call to without(null) before calling map.
However, this line is way too complicated to be on one line so I would recommend splitting it into 3 (at least):
var resources = _(document.styleSheets).chain().pluck("href");
resources = resources.without("").without(null);
var loaded = resources.map(this.rebuildURLIfIE).value();
The same must be done for addScripts (line 2021):
var resources = _(document.scripts).chain().pluck("src");
resources = resources.without("").without(null);
var loaded = resources.map(this.rebuildURLIfIE).value();
Attachments
Issue Links
- relates to
-
TAP5-1882 Ajax doesn't work anymore after inserting inline style in IE9
- Closed