<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Barryvan &#187; HTML</title>
	<atom:link href="http://www.barryvan.com.au/category/programming/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.barryvan.com.au</link>
	<description>Music, Programming, Design</description>
	<lastBuildDate>Sun, 08 Jan 2012 08:48:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>(Un)quoted HTML attributes</title>
		<link>http://www.barryvan.com.au/2011/08/unquoted-html-attributes/</link>
		<comments>http://www.barryvan.com.au/2011/08/unquoted-html-attributes/#comments</comments>
		<pubDate>Sun, 07 Aug 2011 07:23:22 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=607</guid>
		<description><![CDATA[In HTML, it&#8217;s perfectly valid to write something like this: &#60;p class=alpha&#62;Lorem ipsum dolor sit amet etc.&#60;/p&#62; Indeed, Internet Explorer 7 and 8 favour this approach. Whereas Firefox, for example, would return the above as &#60;p class=&#34;alpha&#34;&#62;Lorem ipsum dolor sit amet etc.&#60;/p&#62; when retrieving it using innerHTML, IE 7 &#38; 8 only quotes attributes that [...]]]></description>
			<content:encoded><![CDATA[<p>In HTML, it&#8217;s perfectly valid to write something like this:</p>
<pre class="brush: html">&lt;p class=alpha&gt;Lorem ipsum dolor sit amet etc.&lt;/p&gt;</pre>
<p>Indeed, Internet Explorer 7 and 8 favour this approach. Whereas Firefox, for example, would return the above as</p>
<pre class="brush: html">&lt;p class=&quot;alpha&quot;&gt;Lorem ipsum dolor sit amet etc.&lt;/p&gt;</pre>
<p>when retrieving it using innerHTML, IE 7 &amp; 8 only quotes attributes that satisfy certain criteria:</p>
<ul>
<li>Any attributes that contain spaces;</li>
<li>Some magic set of standard attributes, such as <i>href</i>;</li>
<li>Any custom attributes you may have specified.</li>
</ul>
<p>Unfortunately, however, this doesn&#8217;t constitute well-formed XML. In the software I develop at work, we produce PDFs that can include user-generated HTML. To do this, we use XSL:FO &#8212; an XML-based system. You can see where this is going: the backend requires valid XML, but the frontend is sending through HTML. The simplest way to fix this is with a simple regex, like so:</p>
<pre class="brush: javascript">var s = &#039;&lt;p class=alpha&gt;Lorem ipsum dolor sit amet etc.&lt;/p&gt;&#039;;
s = s.replace(/=([^&quot;&#039;`&gt;\s]+)/g, &#039;=&quot;$1&quot;&#039;);
// s === &#039;&lt;p class=&quot;alpha&quot;&gt;Lorem ipsum dolor sit amet etc.&lt;/p&gt;&#039;</pre>
<p>Bear in mind that this regex is by no means perfect. It will, for example, convert this:</p>
<pre class="brush: html">&lt;p class=alpha&gt;Lorem ipsum&lt;/p&gt;
&lt;p&gt;dolor sit=amet&lt;/p&gt;</pre>
<p>into this:</p>
<pre class="brush: html">&lt;p class=&quot;alpha&quot;&gt;Lorem ipsum&lt;/p&gt;
&lt;p&gt;dolor sit=&quot;amet&lt;/p&quot;&gt;.</pre>
<p>&#8230;which is obviously not what we want. I spent a while trying to come up with a regex that would solve this problem, but I stopped pretty soon. What&#8217;s really needed here is a parser: something that can take in the tag soup that Internet Explorer produces, and produce valid XHTML (which is valid XML). A quick search reveals myriad implementations in various languages &#8212; Python, Java, even JavaScript.</p>
<p>So, after all that, what&#8217;s the take-away from this post? Just this: web browsers (slightly older versions of Internet Explorer in particular) are imperfect. XML was borne out of HTML, and is much less forgiving; whether or not its strictness is a good thing is up for debate. I guess that it&#8217;s a bit like reading Shakespeare nowadays: you can pretty much understand it, but every now and then you have to reach for a dictionary to make sense of what&#8217;s going on. Of course, when you don&#8217;t understand something in Shakespeare, you don&#8217;t fall over in a heap, but let&#8217;s not stretch the analogy too far.</p>
<h2>In brief</h2>
<p>When retrieving the innerHTML of an element (or using contenteditable), Internet Explorer doesn&#8217;t always wrap attribute values in quotes. The solution to this is not a magnificently obtuse regex, but a tag-soup parser that can return valid XML.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2011/08/unquoted-html-attributes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Theme update (again!)</title>
		<link>http://www.barryvan.com.au/2010/08/theme-update-again/</link>
		<comments>http://www.barryvan.com.au/2010/08/theme-update-again/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 04:12:48 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=474</guid>
		<description><![CDATA[And so, for the third time this year, I&#8217;ve completely re-themed this site. Taking a very different tack from the last theme, I&#8217;ve tried to keep this one as simple as possible, with just a few subtle touches here and there to add interest. The palette is more subdued, which hopefully means that reading the [...]]]></description>
			<content:encoded><![CDATA[<p>And so, for the third time this year, I&#8217;ve completely re-themed this site. Taking a very different tack from the last theme, I&#8217;ve tried to keep this one as simple as possible, with just a few subtle touches here and there to add interest. The palette is more subdued, which hopefully means that reading the text is a more pleasant experience. I&#8217;ve also done away with the multi-column body text in favour of a fixed-width design.</p>
<p>At the same time, though, I have endeavoured to use some of the new features available in modern web browsers &#8212; gradients, shadows, transitions, generated content, and so on. I&#8217;m fairly happy with the result &#8212; I think it&#8217;s a clean, unobtrusive theme that&#8217;s not too in your face. Feedback and criticism welcome! <img src='http://www.barryvan.com.au/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/08/theme-update-again/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Generative Music</title>
		<link>http://www.barryvan.com.au/2010/03/generative-music/</link>
		<comments>http://www.barryvan.com.au/2010/03/generative-music/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 08:08:11 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Ambient]]></category>
		<category><![CDATA[Chillout]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=443</guid>
		<description><![CDATA[Continuing my HTML5 and canvas experiments, I&#8217;ve put together a generative music system. Essentially, a series of particles move across a field, occasionally triggering sounds &#8212; the sound triggered depends on their location in the field. There is, of course, a little bit more to it than that. Under the hood, I&#8217;ve got a series [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing my HTML5 and canvas experiments, I&#8217;ve put together a generative music system. Essentially, a series of particles move across a field, occasionally triggering sounds &#8212; the sound triggered depends on their location in the field.</p>
<p>There is, of course, a little bit more to it than that. Under the hood, I&#8217;ve got a series of HTML5 Audio objects that are used to provide polyphonic audio using a simple round-robin algorithm (I encoded the audio in OGG, so you&#8217;ll need to use an OGG-friendly browser, like <a href="http://www.getfirefox.com">Firefox</a>). The particles are much simpler than those in my <a href="/2010/03/canvas-swarms/">previous canvas dalliance</a>, in that they don&#8217;t swarm, and their motion is more linear.</p>
<div class="screenshots">
<a href="/demos/generative.html"><br/><br />
<img alt="Generative Audio Screenshot" src="/wp-content/uploads/2010/03/generative.png" class="aligncenter size-full"/><br/><br />
View (and hear!) it live<br/><br />
</a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/03/generative-music/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Canvas Swarms</title>
		<link>http://www.barryvan.com.au/2010/03/canvas-swarms/</link>
		<comments>http://www.barryvan.com.au/2010/03/canvas-swarms/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 00:27:18 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=440</guid>
		<description><![CDATA[I&#8217;ve been meaning to start playing with the HTML5 &#60;canvas&#62; element for a while now, and yesterday I took the opportunity. I translated a Processing sketch I made a while ago into JavaScript (with a few minor enhancements). View it live Essentially, 1 to 3 swarms of particles move around the canvas, reproducing when the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been meaning to start playing with the HTML5 &lt;canvas&gt; element for a while now, and yesterday I took the opportunity. I translated a Processing sketch I made a while ago into JavaScript (with a few minor enhancements).</p>
<div class="screenshots">
<a href="/demos/swarms/swarms.html"><br />
<img class="aligncenter size-full" src="/demos/swarms/swarms.png" alt="Swarms Screenshot"/><br />
View it live<br />
</a>
</div>
<p>Essentially, 1 to 3 swarms of particles move around the canvas, reproducing when the conditions are just right, and dying of old age. Quite simple, but the patterns produced can be really quite pretty.</p>
<p>One interesting thing that I discovered whilst doing this is that you can&#8217;t pass around a canvas&#8217; context at the instantiation of a MooTools class &#8212; it complains about wrapped natives. That&#8217;s why, if you like in the source JavaScript, you&#8217;ll see me pass the actual context around to various functions. I&#8217;d be interested in hearing if anyone has a workaround for this, because this is, well, a bit clunky.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/03/canvas-swarms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML: IE file submission</title>
		<link>http://www.barryvan.com.au/2010/02/html-ie-file-submission/</link>
		<comments>http://www.barryvan.com.au/2010/02/html-ie-file-submission/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 07:57:22 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=437</guid>
		<description><![CDATA[I&#8217;ve been bumping up against an interesting bug in Internet Explorer recently, and, having just found the solution, thought I&#8217;d share it with you. The problem is that in Internet Explorer (tested 7 &#038; 8), when your document is in quirks mode, uploading a file sometimes just sends through the file name, without the actual [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been bumping up against an interesting bug in Internet Explorer recently, and, having just found the solution, thought I&#8217;d share it with you.</p>
<p>The problem is that in Internet Explorer (tested 7 &#038; 8), when your document is in quirks mode, uploading a file sometimes just sends through the file name, without the actual body of the request. Put the document into standards mode, and it all works. It should be noted that this is when you&#8217;re dynamically setting up the elements used with JavaScript.</p>
<p>The cause? In quirks mode, the <em>enctype</em> attribute isn&#8217;t supported. So whilst setting &#8220;encType&#8221; on the form element to the correct &#8220;multipart/form-data&#8221; will indeed set this attribute, it won&#8217;t actually cause the upload to include the file. Instead, you need to set the <em>encoding</em> attribute to this value, too. It certainly doesn&#8217;t help that the MSDN article on the &lt;input type=&#8221;file&#8221;&gt; element tells you to set &#8220;enctype&#8221;, but makes no mention of &#8220;encoding&#8221;.</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/ms533744(VS.85).aspx">MSDN: &#8216;Encoding&#8217; property</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/cc304100%28VS.85%29.aspx">MSDN: &#8216;Enctype&#8217; property</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms535263%28VS.85%29.aspx">MSDN: &lt;input type=&#8221;file&#8221;&gt; element</a></li>
</ul>
<p>I couldn&#8217;t find any reference to this problem on the intertubes (although maybe I just didn&#8217;t look hard enough), so hopefully this will help someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/02/html-ie-file-submission/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Full-width text inputs without extraneous markup or scripting</title>
		<link>http://www.barryvan.com.au/2010/01/full-width-text-inputs-without-extraneous-markup-or-scripting/</link>
		<comments>http://www.barryvan.com.au/2010/01/full-width-text-inputs-without-extraneous-markup-or-scripting/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 23:56:34 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=403</guid>
		<description><![CDATA[The problem When styling text &#60;input&#62; elements, it&#8217;s fairly common to run into a serious problem: they don&#8217;t behave like block-level elements. Note: In all of the examples, the container element is filled with blue, and the &#60;input&#62; itself is filled with red and has an opacity of 50% so that you can see it [...]]]></description>
			<content:encoded><![CDATA[<h1>The problem</h1>
<p>When styling text &lt;input&gt; elements, it&#8217;s fairly common to run into a serious problem: they don&#8217;t behave like block-level elements.</p>
<p>Note: In all of the examples, the container element is filled with blue, and the &lt;input&gt; itself is filled with red and has an opacity of 50% so that you can see it under- or over-flowing the container.</p>
<pre class="brush: xhtml">&lt;div  style=&quot;background: blue; width:200px;&quot;&gt;
  &lt;input  style=&quot;display:block; padding:4px; background: red; opacity:0.5; border:0;&quot; type=&quot;text&quot; value=&quot;text input&quot;/&gt;
&lt;/div&gt;</pre>
<div style="background:blue; width:200px;">
<input  style="display:block;padding:4px;background: red; opacity:0.5;border:0;" type="text" value="text input"/>
</div>
<p>You can see how the input doesn&#8217;t automatically flow to full width, as the &#8220;display: block&#8221; style suggests it should. The kneejerk response is to set the width to 100%:</p>
<pre class="brush: xhtml">&lt;div  style=&quot;background: blue; width:200px;&quot;&gt;
  &lt;input  style=&quot;display:block; padding:4px; background: red; opacity:0.5; width:100%; border:0;&quot; type=&quot;text&quot; value=&quot;text input&quot;/&gt;
&lt;/div&gt;</pre>
<div style="background:blue; width:200px;">
<input  style="display:block;padding:4px;background: red; opacity:0.5;width:100%;border:0;" type="text" value="text input"/>
</div>
<p>But notice now how the input overflows its container&#8217;s boundaries because of the left padding. At this point, people may resort to non-semantic markup (removing the padding on the &lt;input&gt; and putting it inside a padded &lt;div&gt;) or JavaScript solutions that set the pixel width whenever the container&#8217;s width changes (by the addition of scrollbars, for example).</p>
<h1>The (semantic) solution</h1>
<p><strong>But wait!</strong> There <strong>is</strong> a way to achieve this effect without resorting to an extra &lt;div&gt; or JavaScript:</p>
<pre class="brush: xhtml">&lt;div  style=&quot;background: blue; width:200px;&quot;&gt;
  &lt;input  style=&quot;display:block; padding:4px 0; background: red; opacity:0.5; width:100%; border:0; text-indent:4px;&quot; type=&quot;text&quot; value=&quot;text input&quot;/&gt;
&lt;/div&gt;</pre>
<div style="background:blue; width:200px;">
<input  style="display:block;padding:4px 0;background: red; opacity:0.5;width:100%;border:0;text-indent:4px;" type="text" value="text input"/>
</div>
<p>Do you see what I did there? I removed the horizontal padding on the &lt;input&gt;, so the 100% width now works correctly, and replaced it with &#8220;text-indent&#8221;. To the user, this looks no different, and it has the advantage of requiring no extraneous markup or tedious scripting.</p>
<h1>Drawbacks</h1>
<ol>
<li>Should the user enter a long string, their text will bump up against the right edge. But I think that that&#8217;s a boundary condition that I can live with.</li>
<li>Any vertical borders on the &lt;input&gt; will cause it to overflow its container. Personally, if I want a full-width &lt;input&gt;, though, I generally don&#8217;t want any borders on its left or right other than those of its container.</li>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/01/full-width-text-inputs-without-extraneous-markup-or-scripting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS Columns</title>
		<link>http://www.barryvan.com.au/2009/10/css-columns/</link>
		<comments>http://www.barryvan.com.au/2009/10/css-columns/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 13:01:09 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web design]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=295</guid>
		<description><![CDATA[In this post, I will walk through the new columns specification that arrived in CSS 3. I will show you the current implementation state of columns in the four major rendering engines: Gecko (Firefox), Webkit (Safari &#038; Chrome), Trident (Internet Explorer), and Presto (Opera). Before we get on to platform-specific issues and workarounds, though, we&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>In this post, I will walk through the new columns specification that arrived in CSS 3. I will show you the current implementation state of columns in the four major rendering engines: Gecko (Firefox), Webkit (Safari &#038; Chrome), Trident (Internet Explorer), and Presto (Opera).</p>
<p>Before we get on to platform-specific issues and workarounds, though, we&#8217;ll look at the various CSS properties available for working with columns.</p>
<p>For more in-depth information on columns, you should check out the <a href="http://www.w3.org/TR/css3-multicol/">W3C working draft</a> and Mozilla&#8217;s <a href="https://developer.mozilla.org/en/CSS3_Columns">MDC page on columns</a>. The Webkit blog <a href="http://webkit.org/blog/88/css3-multi-column-support/">also has an article</a>, but it&#8217;s not particularly informative.</p>
<h2>Contents</h2>
<ul>
<li>
		<a href="#capabilities">Browser capabilities</a>
	</li>
<li>
		<a href="#bugs">Browser bugs</a></p>
<ul>
<li><a href="#gecko-bugs">Gecko</a></li>
<li><a href="#webkit-bugs">Webkit</a></li>
</ul>
</li>
<li>
		<a href="#properties">Properties</a></p>
<ul>
<li><a href="#column-count">column-count</a></li>
<li><a href="#column-width">column-width</a></li>
<li><a href="#columns">columns</a></li>
<li><a href="#column-gap">column-gap</a></li>
<li><a href="#column-rule-color">column-rule-color</a></li>
<li><a href="#column-rule-style">column-rule-style</a></li>
<li><a href="#column-rule-width">column-rule-width</a></li>
<li><a href="#column-rule">column-rule</a></li>
<li><a href="#column-span">column-span</a></li>
<li><a href="#column-fill">column-fill</a></li>
</ul>
</li>
</ul>
<p>I will add more to this entry as I discover more about columns &#8212; the goal is to make it an easy-to-understand reference.</p>
<h2><a name="capabilities" href="#capabilities">Browser capabilities</a></h2>
<table class="capabilities" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td>Property</td>
<td>Gecko</td>
<td>Webkit</td>
<td>Trident</td>
<td>Presto</td>
</tr>
</thead>
<tbody>
<tr>
<td class="property"><a href="#column-count">column-count</a></td>
<td class="full">-moz-column-count</td>
<td class="full">-webkit-column-count</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
</tr>
<tr>
<td class="property"><a href="#column-width">column-width</a></td>
<td class="full">-moz-column-width</td>
<td class="full">-webkit-column-width</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
</tr>
<tr>
<td class="property"><a href="#columns">columns</a></td>
<td class="none">&#10007;</td>
<td class="full">-webkit-columns</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
</tr>
<tr>
<td class="property"><a href="#column-gap">column-gap</a></td>
<td class="full">-moz-column-gap</td>
<td class="full">-webkit-column-gap</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
</tr>
<tr>
<td class="property"><a href="#column-rule-color">column-rule-color</a></td>
<td class="partial"><a href="#gecko-bugs">-moz-column-rule-color</a></td>
<td class="full">-webkit-column-rule-color</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
</tr>
<tr>
<td class="property"><a href="#column-rule-style">column-rule-style</a></td>
<td class="partial"><a href="#gecko-bugs">-moz-column-rule-style</a></td>
<td class="full">-webkit-column-rule-style</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
</tr>
<tr>
<td class="property"><a href="#column-rule-width">column-rule-width</a></td>
<td class="partial"><a href="#gecko-bugs">-moz-column-rule-width</a></td>
<td class="full">-webkit-column-rule-width</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
</tr>
<tr>
<td class="property"><a href="#column-rule">column-rule</a></td>
<td class="partial"><a href="#gecko-bugs">-moz-column-rule</a></td>
<td class="full">column-rule</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
</tr>
<tr>
<td class="property"><a href="#column-span">column-span</a></td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
</tr>
<tr>
<td class="property"><a href="#column-fill">column-fill</a></td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
</tr>
<tr>
<td class="property">break-before</a></td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
</tr>
<tr>
<td class="property">break-inside</a></td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
<td class="none">&#10007;</td>
</tr>
</tbody>
</table>
<p>Browsers used for testing: Firefox 3.5.4 (Windows), Safari 4.0.2 (Windows), Internet Explorer 8.0.6001, Opera 10.00 (Windows)</p>
<p>Please let me know if this table is inaccurate, and I will update it.</p>
<h2><a name="bugs" href="#bugs">Browser bugs</a></h2>
<p>These are the bugs that I have encountered using CSS columns &#8212; if you know of more, please let me know, and I&#8217;ll add them to these lists.</p>
<h3><a name="gecko-bugs" href="#gecko-bugs">Gecko bugs</a></h3>
<ul>
<li>Specifying an &#8220;overflow&#8221; (or &#8220;overflow-x&#8221; or &#8220;overflow-y&#8221;) property on an element with columns prevents the column rule from being rendered at all.</li>
<li>Column rules occasionally don&#8217;t render, regardless of the &#8220;overflow&#8221; property.</li>
<li>There is no way to break columns.</li>
</ul>
<h3><a name="webkit-bugs" href="#webkit-bugs">Webkit bugs</a></h3>
<ul>
<li>Pixel creep: Pixels from a later column can creep back to the bottom of the previous column. This can happen with plain text, but it is much more noticeable when you use a non-layout altering effect like text-shadow or box-shadow.</li>
<li>Text that overflows the column horizontally is chopped off</li>
<li>There is no way to break columns.</li>
</ul>
<h2><a name="properties" href="#properties">Properties</a></h2>
<h3><a name="column-count" href="#column-count">column-count</a></h3>
<p><strong>Value:</strong> <integer> | auto<br />
<strong>Initial value:</strong> auto</p>
<p>If you don&#8217;t set the <a href="#column-width">column-width</a> property, <a href="#column-count">column-count</a> specifies the number of columns into which the content should be flowed.</p>
<p>If you specify <a href="#column-width">column-width</a>, <a href="#column-count">column-count</a> imposes a limit on the maximum number of columns to be rendered if you supply a numeric value.</p>
<h3><a name="column-width" href="#column-width">column-width</a></h3>
<p><strong>Value:</strong> <length> | auto<br />
<strong>Initial value:</strong> auto</p>
<p>This property indicates the <em>optimal</em> column width &#8212; columns may be rendered narrower or wider by the UA, according to the available space.</p>
<p>If <a href="#column-width">column-width</a> has the value &#8220;auto&#8221;, then the width of the columns is determined by other means (for example, <a href="#column-count">column-count</a>).</p>
<h3><a name="columns" href="#columns">columns</a></h3>
<p><strong>Value:</strong> <a href="#column-width">column-width</a> &#038;&#038; <a href="#column-count">column-count</a></p>
<p>The <a href="#columns">columns</a> property is a short-hand property, used to set both <a href="#column-width">column-width</a> and <a href="#column-count">column-count</a> simultaneously.</p>
<h3><a name="column-gap" href="#column-gap">column-gap</a></h3>
<p><strong>Value:</strong> <length> | normal<br />
<strong>Initial value:</strong> normal</p>
<p>Use <a href="#column-gap">column-gap</a> to specify the size of the gutter that lies between columns. Most UAs will render &#8220;normal&#8221; as 1em.</p>
<h3><a name="column-rule-color" href="#column-rule-color">column-rule-color</a></h3>
<p><strong>Value:</strong><br />
<color>
<p>When a <a href="#column-rule">column-rule</a> is specified, you may use <a href="#column-rule-color">column-rule-color</a> to set the colour for the line drawn between columns. This property is approximately equivalent to the various border-(?)-color properties.</p>
<h3><a name="column-rule-style" href="#column-rule-style">column-rule-style</a></h3>
<p><strong>Value:</strong> <border-style></p>
<p>By using <a href="#column-rule-style">column-rule-style</a>, you may determine how the line between columns is to be rendered, if at all. Similar to border-(?)-style.</p>
<h3><a name="column-rule-width" href="#column-rule-width">column-rule-width</a></h3>
<p><strong>Value:</strong> <border-width><br />
<strong>Initial value:</strong> medium</p>
<p><a href="#column-rule-width">column-rule-width</a> sets the width of the line rendered in the gutter between columns. Basically, it&#8217;s the same as the border-(?)-width properties.</p>
<h3><a name="column-rule" href="#column-rule">column-rule</a></h3>
<p><strong>Value:</strong> <a href="#column-rule-width">column-rule-width</a> &#038;&#038; <a href="#column-rule-style">column-rule-style</a> &#038; &#038; <a href="#column-rule-color">column-rule-color</a></p>
<p>Shorthand for setting all three column-rule properties.</p>
<h3><a name="column-span" href="#column-span">column-span</a></h3>
<p><strong>Value:</strong> 1 | all<br />
<strong>Initial value:</strong> 1</p>
<p>By using <a href="#column-span">column-span</a>, you can allow an element to span either the entire set of columns, or none at all.</p>
<p>Note that you cannot set an arbitrary number of columns to span &#8212; this property essentially &#8216;interrupts&#8217; the column flow and restarts it below the spanned element.</p>
<h3><a name="column-fill" href="#column-fill">column-fill</a></h3>
<p><strong>Value:</strong> auto | balance<br />
<strong>Initial value:</strong> balance</p>
<p>If you have set a height for your columnified element, setting <a href="#column-fill">column-fill</a> to &#8216;auto&#8217; will cause the columns to be &#8216;filled&#8217; in turn, rather than have the content balanced equally between them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2009/10/css-columns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Explorer DOMDocument &amp; XPath</title>
		<link>http://www.barryvan.com.au/2009/04/internet-explorer-domdocument-xpath/</link>
		<comments>http://www.barryvan.com.au/2009/04/internet-explorer-domdocument-xpath/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 04:10:38 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web design]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xpath]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=144</guid>
		<description><![CDATA[I discovered a couple of interesting things about Internet Explorer&#8217;s MSXML2.DOMDocument object. It turns out that there are essentially two &#8220;production-quality&#8221; versions of it available: 3.0 and 6.0. Version 6.0 is much the better version, but it&#8217;s quite new, and not available on all systems. This means that in IE7 and IE8, instantiating a new [...]]]></description>
			<content:encoded><![CDATA[<p>I discovered a couple of interesting things about Internet Explorer&#8217;s MSXML2.DOMDocument object. It turns out that there are essentially two &#8220;production-quality&#8221; versions of it available: 3.0 and 6.0. Version 6.0 is much the better version, but it&#8217;s quite new, and not available on all systems. This means that in IE7 and IE8, instantiating a new MSXML2.DOMDocument object gives you version 3.0.</p>
<p>Now most of the time, this isn&#8217;t a problem. Today, though, I was constructing an XPath expression that used the substring() function; something like this:</p>
<pre class="brush: xml">//Element[substring(Child, 1, 3)=&#039;abc&#039;]</pre>
<p>This will pull all Elements with a Child element whose value&#8217;s first three characters are &#8220;abc&#8221;. Not particularly complex. It turns out, though, that version 3.0 or the DOMDocument doesn&#8217;t actually use XPath as its default language: it uses a bastardised version of XPath called &#8220;XSLPatterns&#8221;, which just so happens to not support the substring() function at all.</p>
<p>So how do we deal with this situation? One way is to always instantiate version 6.0 of the DOMDocument:</p>
<pre class="brush: javascript">xd = new ActiveXObject(&#039;msxml2.DOMDocument.6.0&#039;)</pre>
<p>The problem with this approach is that, like I mentioned earlier, you can&#8217;t always be guaranteed that your users will have version 6.0 installed (even though it&#8217;s a free download). The safer way to deal with this problem is to switch the expression language to XPath in your 3.0 object:</p>
<pre class="brush: javascript">xd = new ActiveXObject(&#039;msxml2.DOMDocument&#039;);
xd.setProperty(&quot;SelectionLanguage&quot;, &quot;XPath&quot;);</pre>
<p>The advantage of this approach is that you&#8217;re not specifying a version, so when MS eventually changes the default to 7.0 (or whatever), your code will work without a problem.</p>
<p>For more information on this, check out  <a title="Microsoft XML Team's WebLog: Using the right version of MSXML in Internet Explorer" href="http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx">this blog post</a> from Microsoft&#8217;s XML team, which goes into a little bit more detail.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2009/04/internet-explorer-domdocument-xpath/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript-generated tables and rowspan</title>
		<link>http://www.barryvan.com.au/2009/04/javascript-generated-tables-and-rowspan/</link>
		<comments>http://www.barryvan.com.au/2009/04/javascript-generated-tables-and-rowspan/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 10:24:43 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=130</guid>
		<description><![CDATA[At work, I&#8217;ve recently been putting together a nice little calendar-like utility using Javascript. Basically, it has to generate a table consisting of cells which may span multiple rows. Surely the solution is simple enough: just set the rowspan on each td as we create it. Unfortunately, that doesn&#8217;t work, at least not in Firefox. [...]]]></description>
			<content:encoded><![CDATA[<p>At work, I&#8217;ve recently been putting together a nice little calendar-like utility using Javascript. Basically, it has to generate a table consisting of cells which may span multiple rows. Surely the solution is simple enough: just set the <em>rowspan</em> on each <em>td</em> as we create it. Unfortunately, that doesn&#8217;t work, at least not in Firefox.</p>
<p>It appears that in Firefox, if you create a <em>td</em> and set its <em>rowspan</em> to some value <strong>when there are no rows for it to expand into</strong>, the attribute will be completely ignored, <strong>even if you add rows afterwards</strong>! Needless to say, this is very annoying. The solution? Build your table backwards.</p>
<p>The code I have now is something like this (note that I&#8217;m developing using the Mootools framework):</p>
<pre class="brush: javascript">var tbl = new Element(&#039;table&#039;);
var trs = new Array();

for (var i = 0; i &lt; 4; i++) {
  var tr = new Element(&#039;tr&#039;);
  tr.grab(new Element(&#039;td&#039;, {
    &#039;html&#039;: &#039;Cell &#039; + i
  }));
  if (i % 2 == 0) {
    tr.grab(new Element(&#039;td&#039;, {
      &#039;rowspan&#039;: 2,
      &#039;html&#039;: &#039;Span &#039; + (i / 2)
    }));
  }
  trs.push(tr);
}

for (var i = trs.length - 1; i &gt;= 0; i--) {
  tbl.grab(trs[i], &#039;top&#039;);
}</pre>
<p>What does this code do? Well basically, we&#8217;re creating a table with ten rows and two columns; the cells in the right-hand column each occupy two rows. The result will be something like this:</p>
<table style="border:solid 1px blue;width:50%;">
<tr>
<td style="border:solid 1px black;">Cell 1</td>
<td rowspan="2" style="border:solid 1px red;">Span 1</td>
</tr>
<tr>
<td style="border:solid 1px black;">Cell 2</td>
</tr>
<tr>
<td style="border:solid 1px black;">Cell 3</td>
<td rowspan="2" style="border:solid 1px red;">Span 2</td>
</tr>
<tr>
<td style="border:solid 1px black;">Cell 4</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2009/04/javascript-generated-tables-and-rowspan/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HTML Entity Reference</title>
		<link>http://www.barryvan.com.au/2009/03/html-entity-reference/</link>
		<comments>http://www.barryvan.com.au/2009/03/html-entity-reference/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 01:16:07 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=122</guid>
		<description><![CDATA[What&#8217;sMyIP.org have a fantastic HTML Entity Reference which can optionally display every single character known to man (or seemingly so). It&#8217;s the most exhaustive and well-presented entity reference chart I&#8217;ve found on the web, so I thought it was worth pointing it out.]]></description>
			<content:encoded><![CDATA[<p><a href="http://whatsmyip.org">What&#8217;sMyIP.org</a> have a fantastic <a href="http://www.whatsmyip.org/htmlcharacters/">HTML Entity Reference</a> which can optionally display every single character known to man (or seemingly so). It&#8217;s the most exhaustive and well-presented entity reference chart I&#8217;ve found on the web, so I thought it was worth pointing it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2009/03/html-entity-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

