You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org> on 2012/08/18 02:06:38 UTC
[jira] [Updated] (TAP5-1907) Client exception in IE9 when partial
page render introduces stylesheets
[ https://issues.apache.org/jira/browse/TAP5-1907?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship updated TAP5-1907:
---------------------------------------
Labels: ajax ie internetexplorer scripts (was: ajax internetexplorer scripts)
Summary: Client exception in IE9 when partial page render introduces stylesheets (was: ie9 javascript error when partial render includes stylesheets)
> Client exception in IE9 when partial page render introduces stylesheets
> -----------------------------------------------------------------------
>
> Key: TAP5-1907
> URL: https://issues.apache.org/jira/browse/TAP5-1907
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.3.2
> Reporter: Paul Stanton
> Priority: Critical
> Labels: ajax, ie, internetexplorer, scripts
>
> 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?:/)) {
> return path;
> }
> ...
> 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();
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira