<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: MSIE&#8217;s document.createStyleSheet() throws an error if there are more than 30 existing style sheets</title>
	<atom:link href="http://dean.edwards.name/weblog/2010/02/bug85/feed/" rel="self" type="application/rss+xml" />
	<link>http://dean.edwards.name/weblog/2010/02/bug85/</link>
	<description>JavaScript, DHTML and browser hacking</description>
	<lastBuildDate>Wed, 22 Feb 2012 15:04:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Abderrahmane TAHRI JOUTI</title>
		<link>http://dean.edwards.name/weblog/2010/02/bug85/comment-page-1/#comment-377111</link>
		<dc:creator>Abderrahmane TAHRI JOUTI</dc:creator>
		<pubDate>Mon, 21 Mar 2011 21:27:02 +0000</pubDate>
		<guid isPermaLink="false">http://dean.edwards.name/weblog/?p=179#comment-377111</guid>
		<description>&lt;p&gt;I really appreciate this behavior: 30 StyleSheet ? really ?!
but I don&#039;t like the fact that IE, is really strict on so many levels and things :/
&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I really appreciate this behavior: 30 StyleSheet ? really ?!
but I don&#8217;t like the fact that IE, is really strict on so many levels and things :/
</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rajesh Gite</title>
		<link>http://dean.edwards.name/weblog/2010/02/bug85/comment-page-1/#comment-377044</link>
		<dc:creator>Rajesh Gite</dc:creator>
		<pubDate>Mon, 14 Mar 2011 07:04:40 +0000</pubDate>
		<guid isPermaLink="false">http://dean.edwards.name/weblog/?p=179#comment-377044</guid>
		<description>&lt;p&gt;Hey @Fred, @dean
I am getting error at sheet.cssText = cssText;
Error is cssText is undefied. what will be cssText value. Will it be null or something else??
&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Hey @Fred, @dean
I am getting error at sheet.cssText = cssText;
Error is cssText is undefied. what will be cssText value. Will it be null or something else??
</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Abhijit</title>
		<link>http://dean.edwards.name/weblog/2010/02/bug85/comment-page-1/#comment-375161</link>
		<dc:creator>Abhijit</dc:creator>
		<pubDate>Sun, 07 Nov 2010 15:33:35 +0000</pubDate>
		<guid isPermaLink="false">http://dean.edwards.name/weblog/?p=179#comment-375161</guid>
		<description>&lt;p&gt;You should change the number &quot;30&quot; in the title to &quot;31&quot; as IE&#039;s limit for the number of CSS files is 31! This issue is well known to Drupal developers as Drupal depends on &quot;modules&quot;, many of which loads it&#039;s own CSS file which in turn can lead to a large number of CSS files. One solution for this seems to use &quot;@import&quot; to include CSS files. Though it&#039;s not a good idea, it does allow including any number of CSS files. Anyway of implementing that using JS?
&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>You should change the number &#8220;30&#8243; in the title to &#8220;31&#8243; as IE&#8217;s limit for the number of CSS files is 31! This issue is well known to Drupal developers as Drupal depends on &#8220;modules&#8221;, many of which loads it&#8217;s own CSS file which in turn can lead to a large number of CSS files. One solution for this seems to use &#8220;@import&#8221; to include CSS files. Though it&#8217;s not a good idea, it does allow including any number of CSS files. Anyway of implementing that using JS?
</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Richard, Leeds</title>
		<link>http://dean.edwards.name/weblog/2010/02/bug85/comment-page-1/#comment-375158</link>
		<dc:creator>Richard, Leeds</dc:creator>
		<pubDate>Sun, 07 Nov 2010 11:16:28 +0000</pubDate>
		<guid isPermaLink="false">http://dean.edwards.name/weblog/?p=179#comment-375158</guid>
		<description>&lt;p&gt;I found a similar thing with arrays.&lt;/p&gt;
&lt;p&gt;I&#039;d written a script to help me practise my French, but when I got to around the 7000th entry into the array the whole thing just stopped working.&lt;/p&gt;
&lt;p&gt;It remained fine in firefox, though - so it seems that IE must also have limits on how many items you can have in an array.
&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I found a similar thing with arrays.</p>
<p>I&#8217;d written a script to help me practise my French, but when I got to around the 7000th entry into the array the whole thing just stopped working.</p>
<p>It remained fine in firefox, though &#8211; so it seems that IE must also have limits on how many items you can have in an array.
</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Zhou Renjian</title>
		<link>http://dean.edwards.name/weblog/2010/02/bug85/comment-page-1/#comment-370826</link>
		<dc:creator>Zhou Renjian</dc:creator>
		<pubDate>Sat, 05 Jun 2010 22:19:35 +0000</pubDate>
		<guid isPermaLink="false">http://dean.edwards.name/weblog/?p=179#comment-370826</guid>
		<description>&lt;p&gt;@Fred, @dean&lt;/p&gt;
&lt;p&gt;Even though document.getElementsByTagName(&quot;style&quot;).length can be greater than 31, document.styleSheets.length won&#039;t be greater than 31. So I think only the beginning 31 style elements will affect CSS rendering.&lt;/p&gt;
&lt;p&gt;Here is my solution, appending CSS text to the last style sheet object:&lt;/p&gt;
&lt;pre class=&quot;javascript&quot;&gt;var sheet = null;
try {
	sheet = document.createStyleSheet ();
	sheet.cssText = cssText;
} catch (e) {
	sheet = document.styleSheets[document.styleSheets.length - 1];
	sheet.cssText += &quot;\r\n&quot; + cssText;
}&lt;/pre&gt;
&lt;p&gt;Or choose the style sheet with minimal CSS text:&lt;/p&gt;
&lt;pre class=&quot;javascript&quot;&gt;var sheet = null;
try {
	sheet = document.createStyleSheet ();
	sheet.cssText = cssText;
} catch (e) {
	var min = 0;
	var idx = 0;
	for (var i = 0; i &lt; document.styleSheets.length; i++) {
		var style = document.styleSheets[i];
		if (min == 0) {
			min = style.cssText.length;
			idx = i;
		} else if (min &gt; style.cssText.length) {
			min = style.cssText.length;
			idx = i;
		}
	}
	sheet = document.styleSheets[idx];
	sheet.cssText += &quot;\r\n&quot; + cssText;
}&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@Fred, @dean</p>
<p>Even though document.getElementsByTagName(&#8220;style&#8221;).length can be greater than 31, document.styleSheets.length won&#8217;t be greater than 31. So I think only the beginning 31 style elements will affect CSS rendering.</p>
<p>Here is my solution, appending CSS text to the last style sheet object:</p>
<pre class="javascript">var sheet = null;
try {
	sheet = document.createStyleSheet ();
	sheet.cssText = cssText;
} catch (e) {
	sheet = document.styleSheets[document.styleSheets.length - 1];
	sheet.cssText += "\r\n" + cssText;
}</pre>
<p>Or choose the style sheet with minimal CSS text:</p>
<pre class="javascript">var sheet = null;
try {
	sheet = document.createStyleSheet ();
	sheet.cssText = cssText;
} catch (e) {
	var min = 0;
	var idx = 0;
	for (var i = 0; i &lt; document.styleSheets.length; i++) {
		var style = document.styleSheets[i];
		if (min == 0) {
			min = style.cssText.length;
			idx = i;
		} else if (min &gt; style.cssText.length) {
			min = style.cssText.length;
			idx = i;
		}
	}
	sheet = document.styleSheets[idx];
	sheet.cssText += "\r\n" + cssText;
}</pre>]]></content:encoded>
	</item>
	<item>
		<title>By: Warica</title>
		<link>http://dean.edwards.name/weblog/2010/02/bug85/comment-page-1/#comment-369880</link>
		<dc:creator>Warica</dc:creator>
		<pubDate>Sun, 04 Apr 2010 20:52:05 +0000</pubDate>
		<guid isPermaLink="false">http://dean.edwards.name/weblog/?p=179#comment-369880</guid>
		<description>&lt;p&gt;Although I can&#039;t think of a natural use for more than 30 style elements on any given page - I still don&#039;t see why it should be limited.&lt;/p&gt;
&lt;p&gt;I&#039;m sure it doesn&#039;t take a lot of resources for IE to merge all of these style elements together before parsing them?&lt;/p&gt;
&lt;p&gt;Thanks.
&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Although I can&#8217;t think of a natural use for more than 30 style elements on any given page &#8211; I still don&#8217;t see why it should be limited.</p>
<p>I&#8217;m sure it doesn&#8217;t take a lot of resources for IE to merge all of these style elements together before parsing them?</p>
<p>Thanks.
</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Michal Čaplygin</title>
		<link>http://dean.edwards.name/weblog/2010/02/bug85/comment-page-1/#comment-369033</link>
		<dc:creator>Michal Čaplygin</dc:creator>
		<pubDate>Sat, 27 Feb 2010 22:24:15 +0000</pubDate>
		<guid isPermaLink="false">http://dean.edwards.name/weblog/?p=179#comment-369033</guid>
		<description>&lt;p&gt;There is also maximum amount of rules: only first 4095 will be parsed by IE. (It&#039;s said that multiple selectors in a single rule counts as extra rule each).
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa358796(VS.85).aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/aa358796(VS.85).aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And some believe that IE will not parse anything beyond 288 kB file size of external stylesheet, but I&#039;ve never seen any confirmation for this.
&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>There is also maximum amount of rules: only first 4095 will be parsed by IE. (It&#8217;s said that multiple selectors in a single rule counts as extra rule each).
<a href="http://msdn.microsoft.com/en-us/library/aa358796(VS.85).aspx">http://msdn.microsoft.com/en-us/library/aa358796(VS.85).aspx</a></p>
<p>And some believe that IE will not parse anything beyond 288 kB file size of external stylesheet, but I&#8217;ve never seen any confirmation for this.
</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://dean.edwards.name/weblog/2010/02/bug85/comment-page-1/#comment-368684</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Tue, 16 Feb 2010 21:04:03 +0000</pubDate>
		<guid isPermaLink="false">http://dean.edwards.name/weblog/?p=179#comment-368684</guid>
		<description>&lt;p&gt;Nice!&lt;/p&gt;
&lt;p&gt;Thanks for the info Dean and everyone :)&lt;br /&gt;
Another one to add to my book of IE deficiencies
&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Nice!</p>
<p>Thanks for the info Dean and everyone <img src='http://dean.edwards.name/weblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br />
Another one to add to my book of IE deficiencies
</p>]]></content:encoded>
	</item>
	<item>
		<title>By: unacoder</title>
		<link>http://dean.edwards.name/weblog/2010/02/bug85/comment-page-1/#comment-368586</link>
		<dc:creator>unacoder</dc:creator>
		<pubDate>Sat, 13 Feb 2010 01:27:24 +0000</pubDate>
		<guid isPermaLink="false">http://dean.edwards.name/weblog/?p=179#comment-368586</guid>
		<description>&lt;p&gt;MS should increase that number to 640k. there&#039;s no way anyone would need even that many.
&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>MS should increase that number to 640k. there&#8217;s no way anyone would need even that many.
</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://dean.edwards.name/weblog/2010/02/bug85/comment-page-1/#comment-368579</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Fri, 12 Feb 2010 20:13:56 +0000</pubDate>
		<guid isPermaLink="false">http://dean.edwards.name/weblog/?p=179#comment-368579</guid>
		<description>&lt;p&gt;@Ian, snap!&lt;/p&gt;
&lt;p&gt;@Dean, thanks for pointing this one out. I literally ran into this problem today and was scratching my head over why a style wasn&#039;t being applied. One look in the IE developer toolbar and I found the problem. However, without my RSS reader picking this up today I would have been scratching for a good deal longer!
&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>@Ian, snap!</p>
<p>@Dean, thanks for pointing this one out. I literally ran into this problem today and was scratching my head over why a style wasn&#8217;t being applied. One look in the IE developer toolbar and I found the problem. However, without my RSS reader picking this up today I would have been scratching for a good deal longer!
</p>]]></content:encoded>
	</item>
</channel>
</rss>

