Set CSS text after style element is added to DOM, to fix crash on IE < 9...#2000
Set CSS text after style element is added to DOM, to fix crash on IE < 9...#2000lukeapage merged 1 commit intoless:masterfrom
Conversation
|
Makes sense. This page is more helpfull It suggests to me that if the css contains javascript it may error if we set it before appending to the document.. Is that your case? Because outside of that, people have been using IE8/IE9 and less far more in the past and never reported this problem.. I think we can take this but I want to be sure it fixes your problem and we understand it - because the safest change is usually to do nothing. |
|
Can css/less contain javascript? I'm using a DXImageTransform gradient for IE, but nothing else fancy. I thought it might be the size of the css text (it was about 32KB), but tried a basic example and it was successful with twice that size. I'm trying to think what changed to cause this. |
|
and this fix definitely fixes your problem (e.g. identical scenarios, with and without?) |
|
Well, with my fix in place, IE 8 no longer crashes when running my application. I did not have time to investigate further. |
|
okay I think we'll just take it. Don't worry about the example. Thanks for your contribution. |
Set CSS text after style element is added to DOM, to fix crash on IE < 9...
|
Ok, thanks |
|
I did a bit more investigation. |
The fix is based on a comment on this page: http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head.
I did not write a test for this fix because i was not able to create a basic scenario to reproduce the issue. Also, it only happens on IE 8 (and 7 too i think).