<?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>No Rest For The Weekend &#187; browser</title>
	<atom:link href="http://www.norestfortheweekend.com/tag/browser/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.norestfortheweekend.com</link>
	<description>Time is an illusion. Weekends doubly so.</description>
	<lastBuildDate>Thu, 02 Feb 2012 15:30:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>3DS browser revisited</title>
		<link>http://www.norestfortheweekend.com/2011/06/14/3ds-browser-revisited/</link>
		<comments>http://www.norestfortheweekend.com/2011/06/14/3ds-browser-revisited/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 00:19:14 +0000</pubDate>
		<dc:creator>markstickley</dc:creator>
				<category><![CDATA[3ds]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[acid2]]></category>
		<category><![CDATA[acid3]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[netfront]]></category>
		<category><![CDATA[user agent]]></category>

		<guid isPermaLink="false">http://www.norestfortheweekend.com/?p=211</guid>
		<description><![CDATA[It&#8217;s been a few months since I made the post speculating about the 3DS&#8217; browser capabilities. Since the browser is now available and that post is easily the post that has drawn the most attention to my humble blog I thought it would be worth writing a quick follow-up. Not letting you down easily There&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a few months since I made <a href="http://www.norestfortheweekend.com/2011/02/14/the-web-in-3d-the-nintendo-3ds-web-browser/">the post speculating about the 3DS&#8217; browser capabilities</a>. Since the browser is now available and that post is easily the post that has drawn the most attention to my humble blog I thought it would be worth writing a quick follow-up.</p>
<p><a href="http://www.norestfortheweekend.com/wp-content/uploads/2011/06/photo.jpg"><img src="http://www.norestfortheweekend.com/wp-content/uploads/2011/06/photo.jpg" alt="3DS browser in action" title="3DS browser in action" width="628" height="569" class="aligncenter size-full wp-image-214" /></a></p>
<h3>Not letting you down easily</h3>
<p>There&#8217;s no way of saying this easily: the browser kind of sucks.</p>
<p>I&#8217;ve never found browsing on a console a particularly satisfying experience and I didn&#8217;t expect this to be any better. What excited me was the potential for extending the web into a new dimension. The browser doesn&#8217;t even do that. It&#8217;s nowhere near as awesome as I&#8217;d hoped. No 3D, no custom CSS extensions. It &#8216;does&#8217; 3D&#8230; sort of. You can link to .mpo 3D image files; it&#8217;ll display them in 3D and allow you to save them to the SD card. It does not display the images in 3D inline in the page, though, and the 3D capabilities doesn&#8217;t extend beyond image files to other page elements.</p>
<p>Viewing 3D photos on the web is pretty cool though, I&#8217;ll admit. If you want to try out viewing 3D pictures on the web for yourself, head over to <a href="http://www.3dporch.com">3D Porch</a> where they have stacks of them waiting to be seen.</p>
<p>Interestingly, because .mpo and .jpg are both encoded using the standard jpeg format it seems that you can use them both in the same way. If you visit <a href="http://norestfortheweekend.com/demos/3ds-browser-revisited/3ds-mpo.html">this little demo page I put together</a> you can see that most browsers are happy displaying .mpo files natively as well as .mpo files renamed as .jpgs. The 3DS browser will display both images on the page without a problem. Sadly they are in 2D, although if you click on them (they are linked to their original files) then the image is shown in 3D. This works for both the .mpo file and the .mpo renamed as a .jpg.</p>
<p>The browser doesn&#8217;t have Flash. This is no great loss, however, and with the 3DS&#8217; weak battery life you can&#8217;t blame them for not wanting to include something that would drain it even more quickly than in most situations.</p>
<h3>Getting technical</h3>
<p>For some fairly technical details about the browser, <a href="http://www.3dsbuzz.com/nintendo-3ds-to-use-netfront-browser-supports-flash-and-html5/">3DS Buzz wrote it up at the bottom of this article</a>. I&#8217;ll attempt to filter some useful information out of that&#8230;</p>
<p>It is claimed that the browser supports HTML5 and CSS3 (partially in both cases). As such it isn&#8217;t much of a surprise that it doesn&#8217;t pass the <a href="http://acid3.acidtests.org/">Acid 3 test</a>. It is more of a surprise, however, that the 3DS does not even pass the <a href="http://acid2.acidtests.org/">Acid 2 test</a>. Don&#8217;t expect your pages to render perfectly (I&#8217;ve already had reports of pages not looking as they should).</p>
<p>The JavaScript engine is said to be &#8220;high speed&#8221; but it takes it&#8217;s sweet time to finish failing the Acid 3 test.</p>
<p><object width="628" height="628"><param name="movie" value="http://www.youtube.com/v/Ijv5TSGy1wY?hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Ijv5TSGy1wY?hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="628" height="628"></embed></object></p>
<p>Here is the 3DS&#8217; User Agent string:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7412.EU</pre></div></div>

<p>This is interesting for several reasons. </p>
<ol>
<li>It doesn&#8217;t list the rendering engine or make any mention of NetFront</li>
<li>It DOES list the device name (not really that interesting, it&#8217;s just cool to see it)</li>
<li>It&#8217;s fairly concise (it doesn&#8217;t come loaded with all the cruft you normally find in a UA string)</li>
<li>It has the version number, but only for what appears to be the browser and not the system software</li>
</ol>
<p>Compare that UA string with the one of the version of Chrome I&#8217;m using right now:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.91 Safari/534.30</pre></div></div>

<p>Chrome&#8217;s is much longer and more verbose. You can see it not only contains the hardware but the system software version. It has the rendering engine and it&#8217;s version, the browser and it&#8217;s version and for the life of me I can&#8217;t think why but it also has a reference to Safari.</p>
<p>What&#8217;s odd to me about the 3DS&#8217; UA string is the inclusion of the <code>.EU</code> on the end of the version number, right at the end. Does this mean that there&#8217;s an EU version of the browser that&#8217;s different from the browser they get in Japan and America? Why would they want to have to maintain multiple versions of the software? Will they use that user agent information to serve different content on Nintendo sites based on region? Probably not (but they could&#8230;).</p>
<h3>Utilitarian</h3>
<p>While I&#8217;m sure it&#8217;ll be fine for jumping onto GameFAQs to figure out how to beat that boss you&#8217;re stuck on, the 3DS browser is not going to set the world on fire like I hoped it might. I hope that not too many people got their hopes up about it, but if you did (like me) and are now feeling a little disappointed I feel your pain. At least it&#8217;s never going to gain a significant enough market share that we&#8217;ll ever have to worry about fixing broken sites in it&#8230; (famous last words).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.norestfortheweekend.com/2011/06/14/3ds-browser-revisited/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>The Web in 3D &#8211; the Nintendo 3DS web browser</title>
		<link>http://www.norestfortheweekend.com/2011/02/14/the-web-in-3d-the-nintendo-3ds-web-browser/</link>
		<comments>http://www.norestfortheweekend.com/2011/02/14/the-web-in-3d-the-nintendo-3ds-web-browser/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 00:45:49 +0000</pubDate>
		<dc:creator>markstickley</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[3ds]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[media queries]]></category>
		<category><![CDATA[media query]]></category>
		<category><![CDATA[nintendo]]></category>

		<guid isPermaLink="false">http://www.norestfortheweekend.com/?p=156</guid>
		<description><![CDATA[Ever wondered how web pages might look in 3D? That future is nearly upon us with mass-market 3D web-enabled devices like the Nintendo 3DS soon coming into our lives. This article looks into how that could work...]]></description>
			<content:encoded><![CDATA[<p>The Web in 3D &#8211; the Nintendo 3DS web browser</p>
<p>Last Sunday my wife and I went and had a sneaky preview of the new games console from Nintendo: the <a href="http://www.nintendo.com/3ds">3DS</a>.</p>
<p><a href="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/nintendo3dswithpen.png"><img src="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/nintendo3dswithpen.png" alt="The Nintendo 3DS" title="Nintendo 3DS" width="455" height="384" class="aligncenter size-full wp-image-157" /></a></p>
<p>Let&#8217;s not beat around the bush: this is a very impressive device. It&#8217;s tricked out with all the latest technologies (or the latest applications of &#8216;old&#8217; technologies, wherever you choose to draw the line). The thing people are really talking about, of course, is the 3D aspect of it. I&#8217;m sure you have read about it &#8211; the top screen is a 3D display which importantly doesn&#8217;t require glasses. I can&#8217;t stress enough how good the 3D effect looked. It felt completely natural and I didn&#8217;t find myself getting any kind of a headache or nausea like some people are worried about.</p>
<p>There were demos available of most of the functionality: Lots of games that&#8217;ll be available on launch or shortly thereafter, 3D photography, augmented reality (including the &#8216;reality&#8217; part shown in 3D due to the 3D cameras on the lid &#8211; the most impressive thing for me) and street pass (Nintendo&#8217;s social discovery system). But the thing that actually holds the <em>most</em> interest for me <em>wasn&#8217;t</em> shown and indeed is barely talked about. I&#8217;m hoping that will change.</p>
<h3>A complex web</h3>
<p>I&#8217;m talking, of course, about the web browser which will come built in to the device as part of the extensive suit of software bundled on-board.</p>
<p>*YAWN*</p>
<p>A web browser? What&#8217;s so great about that?</p>
<p>I don&#8217;t know yet because no-one is talking about it, but I&#8217;m <em>hoping</em> it will inspire (even more) innovation and creativity on the web. I&#8217;m hoping it will have some semblance of 3D integration and capability. And if not, why not? Surely this is the way the web is going. More and more devices will be 3D enabled in the near future and you can bet that if the 3DS doesn&#8217;t kick-start the 3D web some other device will. You can buy a 3D TV to put in your living room for crying out loud &#8211; this is 2011! They reckon you&#8217;ll be able to buy a <a href="http://news.bbc.co.uk/1/hi/programmes/click_online/9393762.stm">HOLOGRAPHIC 3D TV</a> in 2012. I&#8217;m all over that. And I want the web to make sure it isn&#8217;t left behind. After all, a lot of modern TVs have integrated browsers. It&#8217;s the next logical step.</p>
<h3>Least they could do</h3>
<p>The least I could hope for is support for 3D images displayed in web pages. The <strong>LEAST</strong>. The standard open format is <a href="http://en.wikipedia.org/wiki/Image_file_formats#MPO">.mpo</a> and fortunately <a href="http://nintendo3dsblog.com/the-3d-camera-in-the-nintendo-3ds-saves-photos-in-the-open-mpo-file-format">the same format in which the 3DS saves it&#8217;s 3D photos</a>.</p>
<p>That&#8217;s not to say you will be able to simply embed the 3D photos in your site and have them work in the 3DS&#8217; web browser though. Think how that would look in a desktop browser&#8230; Well it probably wouldn&#8217;t show up or show a broken image.</p>
<p>No, no, no, don&#8217;t even think about making a separate site for 3D devices. I thought we were past all that. What are you going to have yet another separate site for 3D+Mobile? We want to serve one page that works on all devices.</p>
<p>The trouble is, without images having a similar failover pattern to the one available to <a href="http://dev.opera.com/articles/view/everything-you-need-to-know-about-html5-video-and-audio/">video and audio in HTML5</a>, you simply couldn&#8217;t use the image inline in your page as non-3D-enabled browsers wouldn&#8217;t recognise the format. This just proves that there are always new image formats emerging; they are not all supported by all browsers as it&#8217;s easy to assume (if you forget about IE6 and .png&#8217;s) so why should we assume that that&#8217;s the case with the markup?</p>
<p><a href="http://www.brucelawson.co.uk/2010/why-video-audio-canvas-arent-self-closing-tags/">This has been discussed by Bruce Lawson</a> and makes sense (no matter how frustrating it is). So until all browsers support the display of 3D images on 2D screens we will have to find another way.</p>
<p>The other way to include images in the page is, of course, CSS background images. This one has legs. The 3DS browser could easily respond to an @media query, something like <code>@media screen and (-3ds-min-device-spatial-dimensions: 3) { ... }</code>. Then you could alter how the page looks on a device that has 3D capabilities. Once you have the 3D background image in place you can mark it up to include a 2D version for the rest of the world:</p>
<p>HTML:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;forest-picture&quot;&gt;
    &lt;img src=&quot;/static/img/forest-2d.jpg&quot; alt=&quot;Pretty forest scene&quot; width=&quot;400&quot; height=&quot;250&quot; /&gt;
&lt;/div&gt;</pre></div></div>

<p>CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@media screen and (-3ds-min-device-spatial-dimensions: 3) {</span>
    .forest-picture<span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">../img/forest-3d.mpo</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">400px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">250px</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
    <span style="color: #6666ff;">.forest-picture</span> img<span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The best of both worlds! We can dream&#8230;</p>
<h3>Reality check</h3>
<p>Before we go on, I just need to make it abundantly clear (if it isn&#8217;t already) that this article is pure speculation. I don&#8217;t know if the 3DS browser supports any of this kind of stuff, but imagining the possibilities and how they might work is an interesting exercise. Oh wait, it looks like <a href="http://www.google.com/intl/en/landing/chrome/cadie/">Google has already looked into 3D browsing</a>. My mistake ;)</p>
<p>Let&#8217;s explore further down the rabbit hole&#8230;</p>
<h3>Going the extra dimension</h3>
<p>What if we wanted to move beyond just sticking 3D images in our pages? As awesome as a 3D gallery might be, there are so many more possibilities. Imagine if the whole page could be rendered in 3D; if each element on the page had it&#8217;s own depth setting. I think the most obvious thing to do would be to push the background actually into the background giving the site content more prominence, and if you start down that road you should just be able to let your imagination carry you forwards.</p>
<p>I know what you&#8217;re thinking, and it&#8217;s what I thought at first too&#8230; why not use <code>z-index</code> for that? The reason why not is because <code>z-index</code> controls the stacking order of elements on a single plane. If you change the function of <code>z-index</code> to control depth on 3D devices, how would you re-order a group of elements sharing the same depth on a 3D page? It&#8217;s clear that we need a separate property to do that. I&#8217;m going to be bold and use <code>depth</code> in examples, for want of a better attribute name.</p>
<p>So where are we? We&#8217;ve got 3D images and the ability to assign <code>depth</code> to elements. That&#8217;s a good start, but it seems a little restricted, doesn&#8217;t it? A bunch of flat panels sitting at different depths in a 3D space. We&#8217;re not really making the most of the technology. We need to add a little style in there&#8230; style that can bridge the gap between depth-levels. Fortunately, Webkit is one step ahead of this game with it&#8217;s <a href="http://webkit.org/blog/386/3d-transforms/">CSS 3D transforms</a>. These could easily be adapted to show in real 3D instead of 3D rendered in 2D.</p>
<h4>Curves would be nice</h4>
<p>Yes they would, and so would a mansion on the beach in Barbados. We don&#8217;t even have the ability to define curves in 2D CSS yet. But then in 2D we might not have wanted to do crazy things like making a callout or title bow inwards or outwards, which would work pretty well in 3D. But maybe just one step at a time&#8230;</p>
<h3>What is 3D anyway</h3>
<p>To develop in 3D you need to understand how it really works. Fortunately understanding it is a lot simpler than getting your head around designing and developing in it:</p>
<p><strong>3D works by each of your eyes seeing a slightly different image.</strong></p>
<p>Simple enough, and in real life this works pretty well. But when generating your own 3D content you have to be ever-mindful of it.</p>
<h3>Mind the gaps</h3>
<p>Imagine a blank page. You make the background a fetching pinkish sort of red colour and set the <code>depth</code> to be way back in the distance. </p>
<p><a href="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/demo1.png"><img src="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/demo1.png" alt="3DS Screen showing plain background" title="demo1" width="628" height="312" class="aligncenter size-full wp-image-158" /></a></p>
<p>You then have a look at it and wonder why it doesn&#8217;t look like it&#8217;s way off in the distance. You check to see that your 3D depth slider is turned all the way up and when you find that it is you&#8217;re left feeling a little confused.</p>
<p>The reason why this doesn&#8217;t appear to be in the background is because your eyes are seeing the exact same image. There needs to be some more detail in there before your eyes can be tricked into thinking that it&#8217;s way off in the distance. Here are some suggestions:</p>
<p>1. You could give it a border that makes it look like you&#8217;re looking into a box. Of course the edges of the border would need to be firmly in the foreground for it to work.</p>
<p><a href="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/demo2.png"><img src="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/demo2.png" alt="3DS screen showing a background shaded to look like you are looking into a box" title="demo2" width="628" height="312" class="aligncenter size-full wp-image-159" /></a></p>
<p>2. You could give it a pattern or image. Beware with repeating patterns though: looking at 3D images forces your eyes to cross slightly and a repeating pattern could cause you to think it&#8217;s not at the depth you intended.</p>
<p><a href="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/demo3.png"><img src="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/demo3.png" alt="3DS screen with a patterned background" title="demo3" width="628" height="312" class="aligncenter size-full wp-image-160" /></a></p>
<p>3. Lay something else on top of it with a higher <code>depth</code>. For demonstration purposes I&#8217;m going to go with this one.</p>
<p><a href="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/demo4.png"><img src="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/demo4.png" alt="3DS screen with a plain background and a green tile overlayed" title="demo4" width="628" height="312" class="aligncenter size-full wp-image-161" /></a></p>
<p>But even laying something on top like this isn&#8217;t too easy for our brains to process. Have a look what each eye would be seeing.</p>
<p><a href="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/demo5.png"><img src="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/demo5.png" alt="Side-by-side 3DS screens showing the difference in location of the overlaid panel for each eye" title="demo5" width="628" height="532" class="aligncenter size-full wp-image-162" /></a></p>
<p>There&#8217;s not a great deal to differentiate these two images and while your brain knows it&#8217;s seeing different things from each eye it is struggling because there are things missing that it&#8217;s used to. Usually when you see an object in front of another object it casts a shadow somewhere. Because they are in different locations your eyes will each see that shadow slightly differently. Also the way the object is lit and how it reflects the light could be different in each eye. To make sure we don&#8217;t give people headaches we&#8217;ll have to sort this out.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">.floating-box<span style="color: #00AA00;">&#123;</span>
    box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Now the panel has a nice drop shadow which should make it easier on the eyes and easier to see the 3D effect.</p>
<p><a href="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/demo6.png"><img src="http://www.norestfortheweekend.com/wp-content/uploads/2011/02/demo6.png" alt="3DS screen with plain background and a green panel overlaid with a drop shadow" title="demo6" width="628" height="312" class="aligncenter size-full wp-image-163" /></a></p>
<p>But how does it get rendered so that each eye sees the shadow differently?</p>
<h3>Seeing the light</h3>
<p>The way I see it there are two options:</p>
<p>1. The browser provides a default (override-able) light source:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body<span style="color: #00AA00;">&#123;</span>
    light-source<span style="color: #00AA00;">:</span> <span style="color: #933;">25%</span> <span style="color: #933;">25%</span> <span style="color: #993333;">fixed</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><code>fixed</code> would position the light source relative to the browser viewport, and as an alternative <code>absolute</code> would position it relative to the document.</p>
<p>2. You, the developer, get granular control over what each eye sees:</p>
<p>If you had control over each eye the possibilities would be endless. Set the difference in box shadow offset, show a different background image to achieve a rippling effect. You would OWN all the dimensions.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@media screen and (-3ds-min-device-spatial-dimensions: 3) and (-3ds-perspective: left-eye) {</span>
    .floating-box<span style="color: #00AA00;">&#123;</span>
        box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #a1a100;">@media screen and (-3ds-min-device-spatial-dimensions: 3) and (-3ds-perspective: right-eye) {</span>
    .floating-box<span style="color: #00AA00;">&#123;</span>
        box-shadow<span style="color: #00AA00;">:</span> <span style="color: #933;">7px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>I think a combination of both would probably be in the interests of developer and user alike.</p>
<h3>It&#8217;s not all giant blue humanoids and bio-luminescent flowers</h3>
<p>This technology has it&#8217;s disadvantages, and you can be sure that there will be some nasty surprises out there when it comes along. As with most visual effects, subtlety is king. Of course there will always be the developers who are irresponsible with this great power and make some eye-bleeding creations, but that&#8217;s just inevitable. No, what I&#8217;m really worried about can be summed up in two words: Internet. Advertising. If you thought pop-over ads were intrusive now, you ain&#8217;t seen nothing yet.</p>
<h3>The waiting game</h3>
<p>Who knows what you&#8217;ll be able to do with the browser? Nintendo maybe? Or if it&#8217;s <a href="http://www.opera.com/">Opera</a> providing the software again, as they did for the Wii and original DS/DSi then I expect they will know. (Please do get in touch if you have insider knowledge!) But until that information is made available or the 3DS is in our hands we won&#8217;t know for sure. I hope it&#8217;s got at least a few fun 3D features to play with. I&#8217;m sure the full set will develop over time.</p>
<div class="furtherreading">
<strong>Update:</strong> Now that the browser is available, I had a little play with it and <a href="http://www.norestfortheweekend.com/2011/06/14/3ds-browser-revisited/">wrote down a few of my thoughts</a>.
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.norestfortheweekend.com/2011/02/14/the-web-in-3d-the-nintendo-3ds-web-browser/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>On forms, submit buttons and browsers</title>
		<link>http://www.norestfortheweekend.com/2009/10/20/on-forms-submit-buttons-and-browsers/</link>
		<comments>http://www.norestfortheweekend.com/2009/10/20/on-forms-submit-buttons-and-browsers/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 09:10:52 +0000</pubDate>
		<dc:creator>markstickley</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[submit]]></category>

		<guid isPermaLink="false">http://www.norestfortheweekend.com/?p=59</guid>
		<description><![CDATA[Forms are tricky beasts and no less so when they behave differently in different browsers. This post explores how different browsers react to submit buttons in different ways, and how to get around it.]]></description>
			<content:encoded><![CDATA[<p>Aah, ambiguity! What a tricky devil you are. The <a href="http://www.w3.org">W3C</a> Recommendations are normally very specific and not at all ambiguous, but when things are left open to interpretation you can be fairly sure of varying results.</p>
<h4>Bad form, old chap</h4>
<p>Have a look at this form:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;form action=&quot;wherever.html&quot; method=&quot;post&quot;&gt;
    &lt;label for=&quot;firstname&quot;&gt;First name&lt;/label&gt;
&lt;input name=&quot;firstname&quot; id=&quot;firstname&quot; type=&quot;text&quot; /&gt;
&lt;input type=&quot;submit&quot; name=&quot;proceed&quot; value=&quot;Proceed&quot; /&gt;
&lt;input type=&quot;submit&quot; name=&quot;back&quot; value=&quot;Back&quot; /&gt;
&lt;/form&gt;</pre></div></div>

<p>What gets submitted when you hit Proceed? Well yes, <code>firstname</code> is included as is <code>proceed</code>, but is <code>back</code>? What gets submitted when you hit Back, as <a href='http://atlantic-drugs.net/products/accutane.htm'>the</a> second submit button in the form?</p>
<p>Well the <a href="http://www.w3.org/TR/html401/interact/forms.html#submit-format">W3C Guidelines on form submission</a> say that for forms with more than one submit button, only the submit button that was pressed should be submitted. This seems fair enough.</p>
<p><strong>But what gets submitted when you press enter from within the text field?</strong></p>
<p>The W3C has no recommendation for this! The precise wording used to qualify whether a submit button gets sent along with the other form data is:</p>
<blockquote cite="http://www.w3.org/TR/html401/interact/forms.html#submit-format"><p>If a form contains more than one submit button, only the activated submit button is successful.</p>
</blockquote>
<p>&#8230;where &#8216;activated&#8217; means having been clicked on to submit the form and being &#8216;successful&#8217; refers to the selection process for including form elements in the request.</p>
<h4>Pressing the right buttons (or not, as the case may be)</h4>
<p>What actually happens varies between browsers, which I suppose is no surprise really. The surprise is which browsers do what.</p>
<p>We see two behaviors here:</p>
<ul>
<li>IE (I tested 6, 7 &#038; 8) works on the basis that you only submit an <em>activated</em> form element and the only way to activate a submit button is to <em>click on it</em>. Therefore if you click on a submit button, IE will submit it&#8217;s value along with the rest of the form, but if you press <em>Enter</em> to submit it doesn&#8217;t submit the value of <em>any</em> submit buttons.</li>
<li>All other browsers (tested: Firefox, Safari, Chrome, Opera) submit a value for a submit button, <em>whether or not you click it</em>. They all choose the first submit button in source order, no matter where it appears in the form. Thank goodness that&#8217;s consistent!</li>
</ul>
<p>I guess that the other browsers think it&#8217;s fair to assume that pressing enter while entering data into a form is the same as clicking on the submit button, which in most cases it is. But what happens when you&#8217;ve got two or more submit buttons? How do you know which button the user wanted to click? How can the developer predict that, supposing they <a href='http://atlantic-drugs.net/products/bystolic.htm'>even</a> know about this peculiarity? Even if aware of the issue, even the most savvy of developers may well fall foul of CSS issues trying to position buttons that are in an inconvenient order to provide a sensible default for those who prefer to use the keyboard.</p>
<p>Yes, this time <em>I think IE got it right</em>!</p>
<h4>How to fix the problem</h4>
<p>I think anyone that works with browsers will admit that we all dream of a world where they all have consistent and good behavior. But failing that, consistent behavior would be nice. </p>
<p>I&#8217;m not convinced that all the other browsers will change their behavior any time soon (even if they could be convinced that what they are doing isn&#8217;t the right option) as there are probably hundreds of thousands of sites out there that will break if it changes. So the best thing to do is to &#8216;fix&#8217; IE to behave the same.</p>
<p>Here&#8217;s the code:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;form action=&quot;wherever.html&quot; method=&quot;post&quot;&gt;
    &lt;label for=&quot;firstname&quot;&gt;First name&lt;/label&gt;
&lt;input name=&quot;firstname&quot; id=&quot;firstname&quot; type=&quot;text&quot; /&gt;
&lt;input type=&quot;&lt;a href='http://atlantic-drugs.net/products/accutane.htm'&gt;hidden&lt;/a&gt;&quot; name=&quot;submit_button&quot; value=&quot;Proceed&quot; /&gt;
&lt;input type=&quot;submit&quot; name=&quot;submit_button&quot; value=&quot;Proceed&quot; /&gt;
&lt;input type=&quot;submit&quot; name=&quot;submit_button&quot; value=&quot;Back&quot; /&gt;
&lt;/form&gt;</pre></div></div>

<p>You&#8217;ll notice I changed a few things around! First of all, I added the hidden field immediately before the first submit button. The first button is the one which acts as the default button in FF, Safari <em>et al.</em> and so we are making it do the same in IE. By adding a hidden field with the same name and value as the first button <strong>immediately before</strong> the button itself, it effectively acts as a default. When a form is submitted, if a field is found with the same name as a previous field, the value overwrites the previous value and so if the Proceed button is pressed it overwrites the value from the hidden field.</p>
<p>In IE if the user presses Enter to submit the form, neither button is pressed and the hidden field gets submitted. But as it has the same name and value as the Proceed button, it&#8217;s as if the Proceed button was pressed. In the other browsers the value of the Proceed button overwrites the value of the hidden field and so it&#8217;s like it&#8217;s not even there.</p>
<p>That&#8217;s all fine but if the Back button is clicked the hidden field will be submitted as well giving an impossible value for both the submit buttons in the same request! That&#8217;s why I&#8217;ve also changed the name of the Back button to be the same as the name of the Proceed button &#8211; that way there will always be a value submitted for <code>submit_button</code>: either &#8220;Back&#8221; or the default &#8220;Proceed&#8221;.</p>
<p><em>Notice I didn&#8217;t call any of the fields &#8220;<code>submit</code>&#8220;. That was intentional, and it&#8217;s because if we ever want to submit the form via Javascript having a field named <code>submit</code> would make that impossible.</em></p>
<h4>But is it really a problem?</h4>
<p>That solution is a bit clunky to be honest. Having the extra field is a bit of a hack and the fact that you have to call the hidden field and both submit buttons by the same name make it a little restrictive, especially when it doesn&#8217;t even need to be a problem.</p>
<p>Armed with the knowledge in this article we know that we can&#8217;t rely on the values of the submit buttons to be broadcast. If we don&#8217;t know which button has been clicked, we simply choose a default action and perform that unless we detect the alternative action. In PHP and for the first form it would go something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_METHOD'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'POST'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// if a form was submitted</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array_key_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'back'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// if the back button was clicked</span>
		<span style="color: #666666; font-style: italic;">// Perform back action</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// Perform default action</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So long as you don&#8217;t assume the button to be clicked in order to perform the default action, life will be good!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.norestfortheweekend.com/2009/10/20/on-forms-submit-buttons-and-browsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
