| 447 | | var style = doc.createElement("style"); |
| 448 | | style.setAttribute("type", "text/css"); |
| 449 | | // IE is b0rken enough to require that we add the element to the doc |
| 450 | | // before changing it's properties |
| 451 | | var head = doc.getElementsByTagName("head")[0]; |
| 452 | | if(!head){ // must have a head tag |
| 453 | | dojo.debug("No head tag in document, aborting styles"); |
| 454 | | return; // HTMLStyleElement |
| 455 | | }else{ |
| 456 | | head.appendChild(style); |
| 457 | | } |
| 458 | | if(style.styleSheet){// IE |
| 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); |
| | 447 | var style; |
| | 448 | var styleElements = doc.getElementsByTagName("style"); |
| | 449 | if(styleElements.length == 0 ) { |
| | 450 | style = doc.createElement("style"); |
| | 451 | // IE is b0rken enough to require that we add the element to the doc |
| | 452 | // before changing it's properties |
| | 453 | var head = doc.getElementsByTagName("head")[0]; |
| | 454 | if(!head){ // must have a head tag |
| | 455 | dojo.debug("No head tag in document, aborting styles"); |
| | 456 | return; |