Changeset 6645

Show
Ignore:
Timestamp:
11/20/06 13:06:12 (2 years ago)
Author:
alex
Message:

fail more gracefully in the face of IE foibles. Fixes #1958

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/0.4.1_working/src/html/style.js

    r6517 r6645  
    11dojo.provide("dojo.html.style"); 
     2dojo.require("dojo.html.common"); 
    23dojo.require("dojo.uri.Uri"); 
    34 
     
    399400        if(!doc){ doc = document; } 
    400401        var cssStr = dojo.hostenv.getText(URI, false, fail_ok); 
    401         if(cssStr===null){ return; }  
     402        if(cssStr===null){ return; } 
    402403        cssStr = dojo.html.fixPathsInCssText(cssStr, URI); 
    403404 
     
    456457        } 
    457458        if(style.styleSheet){// IE 
    458                 style.styleSheet.cssText = cssStr; 
     459                var setFunc = function(){  
     460                        try{ 
     461                                style.styleSheet.cssText = cssStr; 
     462                        }catch(e){ dojo.debug(e); } 
     463                }; 
     464                if(style.styleSheet.disabled){ 
     465                        setTimeout(setFunc, 10); 
     466                }else{ 
     467                        setFunc(); 
     468                } 
    459469        }else{ // w3c 
    460470                var cssText = doc.createTextNode(cssStr); 
  • trunk/src/html/style.js

    r6517 r6645  
    457457        } 
    458458        if(style.styleSheet){// IE 
    459                 style.styleSheet.cssText = cssStr; 
     459                var setFunc = function(){  
     460                        try{ 
     461                                style.styleSheet.cssText = cssStr; 
     462                        }catch(e){ dojo.debug(e); } 
     463                }; 
     464                if(style.styleSheet.disabled){ 
     465                        setTimeout(setFunc, 10); 
     466                }else{ 
     467                        setFunc(); 
     468                } 
    460469        }else{ // w3c 
    461470                var cssText = doc.createTextNode(cssStr);