<?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>Doctyper &#187; (X)HTML</title>
	<atom:link href="http://doctyper.com/archives/category/xhtml/feed/" rel="self" type="application/rss+xml" />
	<link>http://doctyper.com</link>
	<description>Doctyper is the website of Richard Herrera, a front-end developer with a strong commitment to the web standards movement.</description>
	<lastBuildDate>Sat, 31 Jul 2010 00:17:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>RGBa makes a great debugging tool</title>
		<link>http://doctyper.com/archives/200912/rgba-makes-a-great-debugging-tool/</link>
		<comments>http://doctyper.com/archives/200912/rgba-makes-a-great-debugging-tool/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 22:31:09 +0000</pubDate>
		<dc:creator>doctyper</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Quick Tip]]></category>

		<guid isPermaLink="false">http://doctyper.com/?p=48</guid>
		<description><![CDATA[With 24 Ways pushing RGBa into the foreground today, I thought I&#8217;d share a quick debugging tip. Using RGBa can help while you&#8217;re debugging element positioning. For the adventurous, combine with a debug class:
.debug {
&#160;&#160;background: rgba(255, 0, 0, 0.5);
}
]]></description>
			<content:encoded><![CDATA[<p>With <a href="http://24ways.org/2009/working-with-rgba-colour">24 Ways</a> pushing RGBa into the foreground today, I thought I&#8217;d share a quick debugging tip. Using RGBa can help while you&#8217;re debugging element positioning. For the adventurous, combine with a debug class:</p>
<p><code>.debug {<br />
&nbsp;&nbsp;background: rgba(255, 0, 0, 0.5);<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://doctyper.com/archives/200912/rgba-makes-a-great-debugging-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixed positioning in Mobile Safari</title>
		<link>http://doctyper.com/archives/200808/fixed-positioning-on-mobile-safari/</link>
		<comments>http://doctyper.com/archives/200808/fixed-positioning-on-mobile-safari/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 00:34:07 +0000</pubDate>
		<dc:creator>doctyper</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://doctyper.com/?p=44</guid>
		<description><![CDATA[Update: An anonymous genius in the comments suggested using translateY instead of top for the animation. After some edits I&#8217;ve updated my demo, and it flies! The scrolling animation is smooth as silk. Apparently Webkit transforms are the only hardware-accelerated animations at this point. Thanks, random dude on the internet!
Update 2: This code is released [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> An anonymous genius in the comments suggested using translateY instead of top for the animation. After some edits I&#8217;ve updated my demo, and it flies! The scrolling animation is smooth as silk. Apparently Webkit transforms are the only hardware-accelerated animations at this point. Thanks, random dude on the internet!</p>
<p><strong>Update 2</strong>: This code is released to the public domain. You can use, modify, remix as you see fit.</p>
<p>Behold, fixed positioning on iPhone! <a href="http://doctyper.com/stuff/iphone/fixed/">http://doctyper.com/stuff/iphone/fixed/</a></p>
<p><a href="http://doctyper.com/stuff/iphone/fixed/fixed-positioning.mov">Here&#8217;s a video</a> for those without iPhones. This is running in the iPhone Simulator bundled with the SDK. Note that the animation is much choppier on an actual iPhone.</p>
<p>With the release of iPhone OS 2.0 came some great improvements over previous Mobile Safari versions. CSS animations are in (though buggy), as well as native touch events like touchstart, touchend, gesturechange, etc.</p>
<p>I played around with these new goodies while hunting for improvements to build into <a href="http://pickleview.com">Pickleview</a>. The most fascinating change to me was that you can now prevent the default behavior of elements with a simple preventDefault() call. It allows a user to drag an element around the screen without having to worry about the viewport wobbling about.</p>
<p>I grew curious as to what I could specifically call this on, and started testing out several elements. Turns out you can preventDefault on everything in the DOM, including the body element. This seemed incredibly useless for no other reason than the terrible usability it would bring if you couldn&#8217;t scroll the viewport. Then the proverbial light bulb went off: <em>fixed positioning</em>!</p>
<p>First, let&#8217;s recap why fixed positioning does not work off-the-bat. Mobile Safari uses a viewport to show you websites. Imagine a book in front of you. Take a piece of paper, cut a 320&#215;416 square in it, and lay it over the book. To read the book, move the paper around and position the hole over the words you want to see. This is exactly what Mobile Safari&#8217;s viewport is doing. When you flick and scroll, you&#8217;re moving the viewport around while the website behind it stays static.</p>
<p>This renders fixed positioning null and void on iPhone. An element that has its position fixed is affixed to the <em>body</em>, not the viewport. So it <em>is</em> actually working as intended, though most people would prefer it attached to the viewport.</p>
<p>There are workarounds in the wild, but these are inelegant. You can reposition an element onscroll, but a scroll event in Mobile Safari is only fired after scrolling has stopped. This results in an evident &#8220;glitch&#8221; since you have to a) flick to your desired position, throwing the element off-screen, and b) wait for the element to reappear in the viewport after scrolling has stopped.</p>
<p>By disabling the default scroll behavior on the body element, you essentially glue the viewport down to its initial starting point, where it&#8217;s unable to go anywhere. This limits the viewport to exactly 320&#215;416 pixels of space to show you. In this state, you have a perfectly useless experience.</p>
<p>This is where it gets interesting. In order to re-enable scrolling, I needed to only make the content area scrollable (think iframe, with header and footer above and below it). The touch and gesture events gives access to X/Y values, as well as timers and offset values. So by logging these and incrementing the top offset of the content area, we can create a scrollable block that does not affect the header or footer elements. A little spit and polish later: voila!</p>
<p>It&#8217;s pretty evident from my proof-of-concept that CSS animations need a lot of work. They&#8217;re promised to be &#8220;hardware-accelerated&#8221;, but there&#8217;s little proof of this. Most animations glitch, some to the point of non-use. The scrolling isn&#8217;t particularly smooth and even something as simple as animating a &#8216;top&#8217; CSS property takes its toll. Still it&#8217;s usable, though I hope later Mobile Safari builds will address these issues.</p>
<p>If you&#8217;re interested, I&#8217;ve bundled together the source files for my proof-of-concept. <a href="http://doctyper.com/stuff/iphone/fixed/fixed-positioning.zip">Grab &#8216;em here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://doctyper.com/archives/200808/fixed-positioning-on-mobile-safari/feed/</wfw:commentRss>
		<slash:comments>63</slash:comments>
<enclosure url="http://doctyper.com/stuff/iphone/fixed/fixed-positioning.mov" length="3815585" type="video/quicktime" />
		</item>
		<item>
		<title>Flow 1.0.2</title>
		<link>http://doctyper.com/archives/200807/flow-102/</link>
		<comments>http://doctyper.com/archives/200807/flow-102/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 19:19:52 +0000</pubDate>
		<dc:creator>doctyper</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Flow]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://doctyper.com/?p=41</guid>
		<description><![CDATA[I just pushed release 1.0.2 out the door.
Bug fix:
Flow will no longer choke with SWFObject.
Early this morning I received a report about Flow not playing nicely with SWFObject. After debugging, it turned out it was a case of doing too much.
SWFObject correctly cleans up after itself in IE by removing its generated code on unload. [...]]]></description>
			<content:encoded><![CDATA[<p>I just pushed release 1.0.2 out the door.</p>
<h4>Bug fix:</h4>
<p>Flow will no longer choke with SWFObject.</p>
<p>Early this morning I received a report about Flow not playing nicely with SWFObject. After debugging, it turned out it was a case of doing too much.</p>
<p>SWFObject correctly cleans up after itself in IE by removing its generated code on unload. The conflict appears because Flow does the same with its code, going as far as eliminating all extended element properties.</p>
<p>So when SWFObject tried to removeChild, it returned null because Flow extends that property, and by the time SWFObject got to it, it was already wiped out.</p>
<p>Flow now merely restores an extended property back to its original implementation, rather than nullifying the property. This will fix the error.</p>
<h4>Feature:</h4>
<p>dispatchEvent is now implemented in Flow. You can use it to fire events on elements from another element. Confusing? Here&#8217;s an example:</p>
<p><code>var test = document.getById(&quot;test&quot;);<br />
test.addEventListener(&quot;click&quot;, function() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;// console.log(this.id);<br />
}, false);<br />
&nbsp;<br />
document.getById(&quot;dispatcher&quot;).addEventListener(&quot;click&quot;, function() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;test.dispatchEvent(&quot;click&quot;);<br />
}, false);</code></p>
<p>You can pass any event type and it will fire all events coupled with that type.</p>
<p>As usual, you can download the Flow framework at <a href="http://flowjs.com">http://flowjs.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://doctyper.com/archives/200807/flow-102/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing Flow</title>
		<link>http://doctyper.com/archives/200805/introducing-flow/</link>
		<comments>http://doctyper.com/archives/200805/introducing-flow/#comments</comments>
		<pubDate>Fri, 09 May 2008 21:00:52 +0000</pubDate>
		<dc:creator>doctyper</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://doctyper.com/?p=40</guid>
		<description><![CDATA[This is a post I&#8217;ve been wanting to write for months now. For the past several months I&#8217;ve been spending my free time toiling over a personal project of mine.
It started with Dean Edwards and his release of the Base2 library. It scratched an itch that I&#8217;ve had for years: I wanted the ability to [...]]]></description>
			<content:encoded><![CDATA[<p>This is a post I&#8217;ve been wanting to write for months now. For the past several months I&#8217;ve been spending my free time toiling over a personal project of mine.</p>
<p>It started with Dean Edwards and his release of the <a href="http://dean.edwards.name/weblog/2007/03/yet-another/">Base2 library</a>. It scratched an itch that I&#8217;ve had for years: I wanted the ability to use the DOM API (Level 3) in all modern browsers. Base2 has since seen a second revision and is <a href="http://code.google.com/p/base2/">even more powerful</a> than before.<em> (Aside: Dean Edwards&#8217; is a freaking genius.)</em></p>
<p>But I wanted more. I wanted a hybrid API that would allow me to use the standard API, but would also contain helper functions, shorthand notation, chainability, etc. So I got to work.</p>
<p>After eight months of development, trials, tears and tribulations I am pleased to announce the initial release of <a href="http://flowjs.com/">The Flow Framework</a>.</p>
<p>Flow aims to fix and enhance the DOM Level 3 API. Flow extends API functionality to browsers that currently don&#8217;t support it. Additionaly, it adds powerful functionality on top for the best bang for your JavaScript buck.</p>
<p>A sample of the functions it implements cross-browser:</p>
<ul>
<li>getElementsByClassName / getElementsByAttribute</li>
<li>addEventListener / removeEventListener (with DOMContentLoaded support)</li>
<li>preventDefault / stopPropagation</li>
<li>addClass / removeClass / replaceClass</li>
<li>querySelector / querySelectorAll</li>
<li>shorthand notation (getById, getByTag, getByClass, etc)</li>
</ul>
<p>Hereâ€™s a snippet of what can be accomplished with Flow:</p>
<p>Find all: <code class="prettyprint">ul.checked li</code></p>
<h5>With Flow Core</h5>
<p><code>var uls = document.getElementsByClassName(&quot;checked&quot;).filter(function(e) {<br />
&nbsp;&nbsp;return e.nodeName.toLowerCase() == &quot;ul&quot;;<br />
});<br />
var lis = [];<br />
uls.forEach(function(ul) {<br />
&nbsp;&nbsp;ul.getElementsByTagName(&quot;li&quot;).forEach(function(li) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;lis.push(li);<br />
&nbsp;&nbsp;});<br />
});</code></p>
<h5>With Flow Extend</h5>
<p><code class="prettyprint">var lis = document.getByClass("checked").filter(function(e) {<br />
	return e.elementName() == "ul";<br />
}).getByTag("li");</code></p>
<h5>With Flow Query</h5>
<p><code>var lis = document.querySelectorAll(&quot;ul.checked li&quot;);</code></p>
<p>Want to open external links in new windows via JavaScript?<br />
<code>document.getByAttr(&quot;rel&quot;, &quot;external&quot;).setAttribute(&quot;target&quot;, &quot;_blank&quot;);</code></p>
<p>Want to return false on those pesky blank-anchor links?<br />
<code>document.getByAttr(&quot;href&quot;, &quot;#&quot;).addEventListener(&quot;click&quot;, function(e) {<br />
&nbsp;&nbsp;e.preventDefault();<br />
}, false);</code></p>
<p>There are more <a href="http://flowjs.com/examples/">code samples</a>, <a href="http://flowjs.com/docs/">documentation</a>, <a href="http://flowjs.com/test/unit/">unit tests</a> on the official site. Be sure to download a <a href="http://flowjs.com/download/">customized Flow build</a> and try it out!</p>
<p>For those that want to take a gander at the code, you can check out the source on Google Code: <a href="http://code.google.com/p/flowjs/">http://code.google.com/p/flowjs/</a>.</p>
<p>There&#8217;s already a website using Flow in the wild. <a href="http://southparkstudios.com/">South Park Studios</a> was unveiled a couple of months ago, and it&#8217;s been chugging along since. Unfortunately I was under gag order at the time while the final details were being hammered down. Now I can officially state that it&#8217;s using Flow and lovin&#8217; it.</p>
<p>Many, many thanks to <a href="http://schematic.com">Schematic</a> for supporting the release of this library, and to the many Schematicans who freely contributed to the library.</p>
<p>Thanks are also in order to the great JavaScript programmers who&#8217;ve turned us all on our heads: <a href="http://ejohn.org">John Resig</a>, <a href="http://dean.edwards.name/">Dean Edwards</a>, <a href="http://www.robertnyman.com/">Robert Nyman</a>, <a href="http://therealcrisp.xs4all.nl/blog/">Tino Zijdel</a>, <a href="http://www.ilinsky.com/">Sergey Ilinsky</a> and countless others.</p>
]]></content:encoded>
			<wfw:commentRss>http://doctyper.com/archives/200805/introducing-flow/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Pickleview 1.0</title>
		<link>http://doctyper.com/archives/200708/pickleview-10/</link>
		<comments>http://doctyper.com/archives/200708/pickleview-10/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 21:51:08 +0000</pubDate>
		<dc:creator>doctyper</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://doctyper.com/archives/200708/pickleview-10/</guid>
		<description><![CDATA[I&#8217;m proud to announce that we&#8217;ve just crossed this significant milestone. After weeks of crunching bugs and rolling out update after update, Pickleview is officially a 1.0 release.
What started as a simple itch to scratch has turned into a full-fledged iPhone application, used by true honest-to-goodness people. Really!
The feedback has been nothing short of spectacular. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m proud to announce that we&#8217;ve just crossed this significant milestone. After weeks of crunching bugs and rolling out update after update, <a href="http://pickleview.com" title="Pickleview 1.0">Pickleview</a> is officially a 1.0 release.</p>
<p>What started as a simple itch to scratch has turned into a full-fledged iPhone application, used by true honest-to-goodness people. Really!</p>
<p>The feedback has been nothing short of spectacular. We&#8217;ve <a href="http://ajaxian.com/archives/iphone-update-pickleview-dojo-chat-iui-generation-and-more">received</a> <a href="http://www.joehewitt.com/blog/iui_monotony.php">tons</a> of <a href="http://applephoneshow.com/index.php/archives/649">praise</a> and we&#8217;ve listened to your feedback, sometimes pushing out updates within hours of suggestions. A gigantic thank you to everyone who pushed us to keep upping the ante.</p>
<p>An extra amount of thanks to <a href="http://mlb.mlb.com" title="Major League Baseball">Major League Baseball</a> and <a href="http://twitter.com" title="Twitter">Twitter</a>, the entities responsible for providing us data. Without them Pickleview would not exist.</p>
<p>To commemorate this milestone, I&#8217;m happy to say that we&#8217;re releasing the Pickleview code under the <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0  License</a>. You are free to learn from it, distribute and modify (as long as you share alike). <a href="http://svn.iphonewebdev.com/pickleview/">View the source here</a>. Thanks to the good folk at iPhoneWebDev for hosting our files. We&#8217;re hoping it becomes the repository for open-source iPhone web applications.</p>
<p>Lastly, stay tuned. We&#8217;ve got things in the works, gears are grinding, and overtime is being spent.</p>
]]></content:encoded>
			<wfw:commentRss>http://doctyper.com/archives/200708/pickleview-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pickleview</title>
		<link>http://doctyper.com/archives/200707/pickleview/</link>
		<comments>http://doctyper.com/archives/200707/pickleview/#comments</comments>
		<pubDate>Fri, 13 Jul 2007 04:47:39 +0000</pubDate>
		<dc:creator>doctyper</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://doctyper.com/archives/200707/pickleview/</guid>
		<description><![CDATA[I want to talk a little bit about a side project that&#8217;s gleefully taken up most of my free time.
Over the weekend I attended iPhoneDevCamp, a gathering of web geeks from around the globe with one purpose: to create applications for iPhone.
I went into the event with little-to-no expectation of anything happening. It being my [...]]]></description>
			<content:encoded><![CDATA[<p>I want to talk a little bit about a <a href="http://pickleview.com">side project</a> that&#8217;s gleefully taken up most of my free time.</p>
<p>Over the weekend I attended <a href="http://barcamp.org/iphonedevcamp">iPhoneDevCamp</a>, a gathering of web geeks from around the globe with one purpose: to create applications for iPhone.</p>
<p>I went into the event with little-to-no expectation of anything happening. It being my first BarCamp I didn&#8217;t know the atmosphere, how we would mingle, etc.</p>
<p>What happened that weekend was something I won&#8217;t forget for some time. It was a great feeling to walk through the Adobe Town Hall and see energy popping from 300 minds at once. You could feel the electricity as people discovered loopholes and solved riddles that had puzzled iPhone developers since its release.</p>
<p>My story was rather interesting. After a canceled flight and barely making the 6:00pm start time (United: Never Again), I was sticking with my usual schtick: talk to no one, avoid eye contact. Twenty minutes in, I suddenly realized the magnitude of the event and was determined to talk to someone&#8211; <em>anyone</em>.</p>
<p>It was then I spotted a couple of individuals at a corner table, mingling away. I took a chance, and introduced myself. Ryan and Seto were their names. A short while later,  Estelle joined the small table, and we started brainstorming.</p>
<p>I&#8217;d been developing a small web app I dubbed LiveScore for a <a href="http://dodgers.cc">Dodgers&#8217; fan forum</a> that I run.  It gave real-time updates of Dodger scores, as well as some vital stats of each game. On a whim I opened up the app and showed it to the group. The gang really took to it, and from that point brainstorming focused around LiveScore.</p>
<p>Minutes later, we had a prototype: A web app/mashup that would combine live game tracking with the ability to chat along with friends on Twitter.</p>
<p>And so, <a href="http://pickleview.com">Pickleview</a> was born.</p>
<p>In the span of 36 hours, we four furiously coded together the required bytes to get the app off the ground, and wrapped it around a native-looking UI. It was thrilling to say the least, if not completely overwhelming. I don&#8217;t believe I&#8217;ve ever coded so much in so short a time.</p>
<p>We had our small moment in the sun, making some <a href="http://content.zdnet.com/2346-9595_22-93897-4.html">top ten lists</a> and being interviewed by the <a href="http://mercextra.com/video/2007/07/09/inside-the-iphone-devcamp/">San Jose Mercury Press</a>. But the real payoff was being able to release a very useful app for others to enjoy.</p>
<p>That, and comments that would make anyone jump for joy. Thanks again, <a href="http://joehewitt.com">Joe</a>.</p>
<p>Since the camp, we&#8217;ve been working hard to improve our little app that could. We&#8217;ve added features such as play-by-play, visual cues on score, balls/strikes tracking, and lots and lots of bug fixes. I have to say I&#8217;m enjoying the ride. All for an app I&#8217;m proud to be a part of.</p>
<p>I should reiterate that neither I nor Ryan nor Seto nor Estelle had ever met each other before Friday. It was a great experience to be able to accomplish so much with virtual strangers. Pickleview, however, is quickly making us closer acquaintances.</p>
]]></content:encoded>
			<wfw:commentRss>http://doctyper.com/archives/200707/pickleview/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTML vs. XHTML: Which is better?</title>
		<link>http://doctyper.com/archives/200704/html-vs-xhtml-which-is-better/</link>
		<comments>http://doctyper.com/archives/200704/html-vs-xhtml-which-is-better/#comments</comments>
		<pubDate>Wed, 04 Apr 2007 18:44:30 +0000</pubDate>
		<dc:creator>doctyper</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://doctyper.com/archives/200704/html-vs-xhtml-which-is-better/</guid>
		<description><![CDATA[If you are a client-side developer, this question has without a doubt been a topic of discussion. Should you use HTML, or XHTML? Does it matter? The answer is quite verbose, and takes a lot of consideration to determine:

application/xhtml+xml vs text/html

5.1. Internet Media Type
XHTML Documents which follow the guidelines&#8230; may also be labeled with the [...]]]></description>
			<content:encoded><![CDATA[<p>If you are a client-side developer, this question has without a doubt been a topic of discussion. Should you use HTML, or XHTML? Does it matter? The answer is quite verbose, and takes a lot of consideration to determine:</p>
<p><span id="more-14"></span></p>
<h3>application/xhtml+xml vs text/html</h3>
<blockquote>
<h4>5.1. Internet Media Type</h4>
<p>XHTML Documents which follow the guidelines&#8230; may also be labeled with the Internet Media Type &#8220;application/xhtml+xml&#8221; as defined in [<a href="http://www.w3.org/TR/xhtml1/#ref-rfc3236">RFC3236</a>]&#8230;</p>
<p><cite><a href="http://www.w3.org/TR/xhtml1/#issues">W3C XHTML 1.0 Guidelines</a></cite></p></blockquote>
<p>There are many who feel that an XHTML document without the proper application/xhtml+xml content type is no better than transitional markup, or even tag soup. This is preposterous. First and foremost, content served as application/xhtml+xml <em>will not render</em> in Internet Explorer. The world&#8217;s most popular browser will not render this content type. What more do you need to steer clear of this headache?</p>
<p>On the other side of the coin, strict XHTML served as text/html will take advantage of debugging tools (such as validators) to help you code a better page. text/html is allowed per the W3C specifications. It is not meant to be avoided, it is meant to aid your cross-browser needs.</p>
<h3>Transitional v. Strict</h3>
<p>For all intents and purposes, this is the real question that needs addressing. Not whether you should use (X)HTML, but whether you should use a transitional or a strict doctype. The answer is, <em>and always should be</em> a strict doctype.</p>
<p>In this day and age, it is imperative to think of the transitional doctype as deprecated. Quite honestly, the only thing a transitional doctype is useful for is a false sense of satisfaction when validating your markup. The transitional doctype was created to bridge the switch from HTML to XHTML. It&#8217;s treated that way by the W3C, and they go so far as to recommend a strict doctype.</p>
<p>The number one reason you should use strict over transitional is cross-browser compatibility. Believe it or not, the Gecko-based browsers render pages slightly differently when triggered by a transitional doctype. This is called &#8220;almost-standards mode&#8221;, and is defined in the <a href="http://developer.mozilla.org/en/docs/Gecko%27s_%22Almost_Standards%22_Mode">Mozilla Developer Center</a> documentation.</p>
<p>Using a strict doctype ensures that every browser renders your markup as closely as possible with the standardized specs.</p>
<h3>But&#8230; my markup isn&#8217;t valid in strict mode!</h3>
<p>Validity does not equal accessibility. An invalid strict page is always better than a valid transitional, as long as you recognize why it fails validation, and you&#8217;ve exhausted all options to correct the markup. True accessibility and semantically correct markup require a separation of content, design, and function. Many of the HTML attributes were created to aid design. Examples are the border, align, width and height attributes. These attributes are deprecated in strict doctypes.</p>
<p>Invalid markup in a strict doctype must be treated as invalid in a transitional doctype, regardless of validation output. HTML is an extremely forgiving language, something you must ignore to better your coding, and to better the web. Consider the error handling in languages such as PHP, ASP and XML. In each, an error will trigger the language to immediately stop rendering until the problem is rectified. There is no option to do otherwise.</p>
<p>Not so with client-side languages. HTML, CSS, and JS all will forgive (and sometimes, forget) errors it receives. This is the way it always will be, because the nature of the web depends on pages rendering <em>despite</em> bad coding practices. The sign of a great front-end developer is the ability to correctly parse the language without the need for error handling.</p>
<p>And so, I submit to you that this:</p>
<p><code>&lt;ul&gt;<br />
&nbsp;&nbsp;&lt;li&gt;something<br />
&nbsp;&nbsp;&lt;li&gt;something else<br />
&lt;/ul&gt;</code><br />
is no better than this (in XHTML):</p>
<p><code>&lt;br&gt;</code></p>
<p>is no better than this (in XHTML):</p>
<p><code>align=&quot;absmiddle&quot;</code></p>
<p>In the end, it is up to the developer to decide which of the two language types is most comfortable. Both have their charm, and both have their acceptable uses. But you <em>must</em> code using a strict doctype. It is the only way to eliminate browser quirks, and it is the best environment you will have to achieve cross-browser optimization.</p>
]]></content:encoded>
			<wfw:commentRss>http://doctyper.com/archives/200704/html-vs-xhtml-which-is-better/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firebug bundle for TextMate</title>
		<link>http://doctyper.com/archives/200703/firebug-bundle-for-textmate/</link>
		<comments>http://doctyper.com/archives/200703/firebug-bundle-for-textmate/#comments</comments>
		<pubDate>Fri, 30 Mar 2007 20:20:05 +0000</pubDate>
		<dc:creator>doctyper</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://doctyper.com/archives/200703/firebug-bundle-for-textmate/</guid>
		<description><![CDATA[My two most indispensable web development tools are Firebug and TextMate. I&#8217;m sure the same goes for many web developers the world round. Firebug brings with it a complete set of debuggers and problem-solvers that is unrivaled by any other application. And TextMate is the little text editor that could (and does). It&#8217;s versatility is [...]]]></description>
			<content:encoded><![CDATA[<p>My two most indispensable web development tools are <a href="http://getfirebug.com/">Firebug</a> and <a href="http://macromates.com" title="TextMate">TextMate</a>. I&#8217;m sure the same goes for many web developers the world round. Firebug brings with it a complete set of debuggers and problem-solvers that is unrivaled by any other application. And TextMate is the little text editor that could (and does). It&#8217;s versatility is unmatched. I constantly find myself shuttling between the two in the eternal edit/debug dance we webbies know all too well.</p>
<p>It seems odd to me that there isn&#8217;t (as of yet) <a href="http://www.google.com/search?q=Firebug%20bundle%20for%20TextMate&amp;sourceid=mozilla2&amp;ie=utf-8&amp;oe=utf-8">anything out there</a> that brings these two fan favorites together. <span class="pullquote">If any two applications are deserving of a mashup, it&#8217;s these two. So I said to myself, &#8220;Self, why not build your own?&#8221;</span></p>
<p>A few hours later, I had myself a bona-fide <a href="http://doctyper.com/archives/200703/firebug-bundle-for-textmate/#download" title="Skip to download">Firebug bundle for TextMate</a>.</p>
<p><span id="more-12"></span></p>
<p id="imageGallery"> <img src="/images/firebundle/firebundle-1.gif" title="Screenshot of first menu" alt="Screenshot of first menu" /><br />
<img src="/images/firebundle/firebundle-2.gif" title="Screenshot of second menu" alt="Screenshot of second menu" /><br />
<img src="/images/firebundle/firebundle-3.gif" title="Screenshot of workspace" alt="Screenshot of workspace" /><br />
<img src="/images/firebundle/firebundle-4.gif" title="Screenshot of documentation" alt="Screenshot of documentation" /></p>
<p>The bundle automates the console commands found in the <a href="http://getfirebug.com/console.html" title="Firebug API">Firebug API</a>. They&#8217;re all in there, every last one. One of the reasons I built the bundle is because I constantly found myself resorting to console.log for most of my debugging. I knew that Firebug offered many more commands to take advantage of, but I just never had the time to keep looking up commands. Fortunately, this bundle solves that problem. With a simple keystroke, all the console commands are at your disposal.</p>
<h3>Features</h3>
<h4>Keystrokes</h4>
<p>The default keystrokes are Command + D (D&#8230; <em>debug</em>, get it?) and Command + Shift + D. You can change the keystrokes to whatever you wish. Part of the TextMate versatility I was talking about.</p>
<p>I&#8217;ve split the commands into two sets, because of the number of console commands in the API, and because I wanted each command to have it&#8217;s own shortcut. Each set contains half of the commands organized in order of the documentation.</p>
<h4>Documentation</h4>
<p>In case you need a refresher on what a command does or what it outputs, I&#8217;ve added the Firebug Console API documentation in the bundle. Selecting it will open the TextMate web preview, with the complete documentation intact.</p>
<p>I also threw in a couple of features to help automate the edit/debug process:</p>
<h4>Debug with Firebug</h4>
<p>Debug with Firebug (Command + D, 9 in javascript; Command + D, 1 in HTML) will check to see if Firefox is running. If so, it switches focus to the browser, refreshes the current window, and then launches Firebug (if needed).</p>
<h4>Profile with Firebug</h4>
<p>Profile with Firebug (Command + D, 0 in javascript; Command + D, 2 in HTML) does the same, but it invokes the Firebug profiler, <em>then</em> refreshes the current window. After a short delay, it returns the captured events.</p>
<p>Both of these last two features require that you enable access for assistive devices. This is found under System Preferences &gt; Universal Access &gt; Enable access for assistive devices.</p>
<h3>Installation</h3>
<ol>
<li>Download <a href="http://doctyper.com/archives/200703/firebug-bundle-for-textmate/#download">Firebug.tmbundle.dmg</a>.</li>
<li>Mount the disk image.</li>
<li>Double click on Firebug.tmbundle. TextMate should launch, and the installation is complete.</li>
</ol>
<h3>Troubleshooting</h3>
<p>If you are selecting Debug with Firebug or Profile with Firebug and nothing happens, one of two things is wrong:</p>
<ol>
<li>Firefox is not running. Open Firefox and the page in need of debugging.</li>
<li>Access to assistive devices is disabled. See above for instruction on enabling access.</li>
</ol>
<p>If you find that the profiler returns too fast, it is possible to alter the length of time it waits:</p>
<ol>
<li>In TextMate, open the Bundle Editor (defaut: Control + Option + Command + B) and select the Firebug bundle.</li>
<li>Click on â€œProfile with Firebugâ€.</li>
<li>Find the value â€œdelay 2â€.</li>
<li>Tweak â€œ2â€ to your liking. I recommend incrementing by 1 until you hit your sweet spot.</li>
</ol>
<p>Please let me know of any bugs, or if you&#8217;d like to suggest an improvement.</p>
<p><a href="/downloads/Firebug.tmbundle.dmg" title="download" class="featureLink" name="download"><br />
<img src="/images/dmg.png" alt="Firebug.tmbundle" /><br />
Firebug.tmbundle.dmg<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://doctyper.com/archives/200703/firebug-bundle-for-textmate/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Show love to the &lt;body&gt; element</title>
		<link>http://doctyper.com/archives/200703/show-love-to-the-body-element/</link>
		<comments>http://doctyper.com/archives/200703/show-love-to-the-body-element/#comments</comments>
		<pubDate>Fri, 16 Mar 2007 02:15:21 +0000</pubDate>
		<dc:creator>doctyper</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://doctyper.com/archives/200703/show-love-to-the-body-element/</guid>
		<description><![CDATA[As you begin to wireframe your next big web thing, it&#8217;s a good idea to keep this in mind. The body element can be styled just like any other element.
Let&#8217;s get a disclaimer out of the way: I am a markup purist at heart. There&#8217;s nothing that tugs at my heartstrings than well-structured markup. So [...]]]></description>
			<content:encoded><![CDATA[<p>As you begin to wireframe your next big web thing, it&#8217;s a good idea to keep this in mind. The body element can be styled just like any other element.</p>
<p>Let&#8217;s get a disclaimer out of the way: I am a markup purist at heart. There&#8217;s nothing that tugs at my heartstrings than well-structured markup. So it pains me to see the body element so underused, especially when that #wrapper div you created can do exactly what &lt;body&gt; can.</p>
<p>There are situations where you will no doubt need that #wrapper element, and I&#8217;d bet it will have something to do with Internet Explorer. But the remainder of the time, I&#8217;d wager that element is just plain expendable. Let&#8217;s take a look at an example:</p>
<p><code>body {<br />
&nbsp;&nbsp;margin: 0;<br />
&nbsp;&nbsp;padding: 0;<br />
&nbsp;&nbsp;font: 76%/1.6 &quot;Comic Sans&quot;, Arial;<br />
&nbsp;&nbsp;text-align: center;<br />
}<br />
#wrapper {<br />
&nbsp;&nbsp;margin: 0 auto;<br />
&nbsp;&nbsp;padding: 1em;<br />
&nbsp;&nbsp;width: 750px;<br />
&nbsp;&nbsp;text-align: left;<br />
}</code></p>
<p>Here we have a sample of what I constantly see. Usually, margins, paddings, and maybe a font declaration is relegated to the body element, and then it is left alone to spend the rest of its days in CSS purgatory. Subsequent properties are then added to a superfluous and unnecessary element.</p>
<p>But the same feat can be accomplished with <em>just</em> a body element!</p>
<p><code>html {<br />
&nbsp;&nbsp;margin: 0;<br />
&nbsp;&nbsp;padding: 0;<br />
&nbsp;&nbsp;font: 76%/1.6 Helvetica, Arial;<br />
&nbsp;&nbsp;text-align: center;<br />
}<br />
body {<br />
&nbsp;&nbsp;margin: 0 auto;<br />
&nbsp;&nbsp;padding: 1em;<br />
&nbsp;&nbsp;width: 750px;<br />
&nbsp;&nbsp;text-align: left;<br />
}</code></p>
<p>Think of the Document Object Model as a staircase. By merely &#8220;stepping up&#8221; a level and utilizing the oft-ignored <html> element, we save ourselves a wasted element. It may seem like a small thing, but remember that a div element has no semantic value anyway. And search engines will adore you for making sure your content gets to them without crawling through another div.</p>
]]></content:encoded>
			<wfw:commentRss>http://doctyper.com/archives/200703/show-love-to-the-body-element/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
