tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard M. Lewis Ship (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (TAP5-1907) Client exception in IE9 when partial page render introduces stylesheets
Date Mon, 20 Aug 2012 19:01:40 GMT

     [ https://issues.apache.org/jira/browse/TAP5-1907?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Howard M. Lewis Ship updated TAP5-1907:
---------------------------------------

    Fix Version/s:     (was: 5.3.6)
                   5.3.5
    
> 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, fixed-in-5.4-js-rewrite, ie, internetexplorer, scripts
>             Fix For: 5.3.5
>
>
> 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

        

Mime
View raw message