<?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>Tiffany B. Brown &#187; Browsers</title>
	<atom:link href="http://tiffanybbrown.com/category/browsers/feed/" rel="self" type="application/rss+xml" />
	<link>http://tiffanybbrown.com</link>
	<description>A web log about web development and internet culture with frequent detours into other stuff.</description>
	<lastBuildDate>Thu, 09 Feb 2012 18:48:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>input type=&quot;range&quot; and Android&#8217;s stock browser.</title>
		<link>http://tiffanybbrown.com/2012/02/07/input-typerange-and-androids-stock-browser/</link>
		<comments>http://tiffanybbrown.com/2012/02/07/input-typerange-and-androids-stock-browser/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 04:04:56 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[(x)HTML]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[WebKit]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[html5 forms]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=6629</guid>
		<description><![CDATA[Android&#8217;s stock browser supports the range input type, but in versions 3.x4.x and below (not sure about Android 4.x), it doesn&#8217;t actually display the UI. It does, however, support parts of the Shadow DOM. That means we can style this element, and give our users a visible control. The image below shows a rather garish [...]]]></description>
			<content:encoded><![CDATA[<p>Android&#8217;s stock browser supports the <code>range</code> input type, but in versions <del datetime="2012-02-09T14:40:47+00:00">3.x</del><ins datetime="2012-02-09T14:40:47+00:00">4.x</ins> and below <del datetime="2012-02-09T14:40:47+00:00"> (not sure about Android 4.x)</del>, it doesn&#8217;t actually display the UI.</p>
<p>It does, however, support parts of the <a href="http://glazkov.com/2011/01/14/what-the-heck-is-shadow-dom/">Shadow DOM</a>. That means we can style this element, and give our users a visible control.</p>
<p>The image below shows a rather garish green-and-orange version of the range user interface widget. This is after adding some styling, as it appears in the stock Android browser.</p>
<div class="image500"><img src="http://webinista.s3.amazonaws.com/images/uploads/2012/02/rangeui.png" alt="" title="safarirange" width="499" height="52" class="aligncenter size-full wp-image-6632"></div>
<p>And below is the CSS that gives us the above image.</p>
<pre><code>
input[type='range']{
    background: #0c0;
    height:10px;
}

input[type='range']::-webkit-slider-thumb{
    background:#f60;
    height:30px;
    width:30px;
    border-radius: 30px;
}
</code></pre>
<p>To date, this does <em>not</em> affect Chrome or Safari for the Desktop. <code>::-webkit-slider-thumb</code> does partially affect iOS Safari. I&#8217;ve included an image of what it looks like below (not to scale). Notice that the thumb color changes, but the slider background does not.</p>
<div class="image500"><img src="http://webinista.s3.amazonaws.com/images/uploads/2012/02/safarirange.png" alt="" title="safarirange" width="500" height="134" class="aligncenter size-full wp-image-6632"></div>
<p>This <em>may</em> also affect other browsers that use <a href="http://www.webkit.org/">Webkit</a> such as the Web Browser for S60 Nokia and Samsung&#8217;s Dolfin. I haven&#8217;t tested it yet, but if you have, please let us know in the comments.</p>
<p>Also keep in mind that this element has a pretty poor user interaction in Android browser. It&#8217;s not very responsive, and doesn&#8217;t operate all that intuitively. This is true of most mobile browsers, but in my opinion (and based on limited experience), Android is worst of all.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2012/02/07/input-typerange-and-androids-stock-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>input type=&quot;url&quot;, validation and user interfaces</title>
		<link>http://tiffanybbrown.com/2012/01/03/input-typeurl-validation-and-user-interfaces/</link>
		<comments>http://tiffanybbrown.com/2012/01/03/input-typeurl-validation-and-user-interfaces/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 06:54:33 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[(x)HTML]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[html5 forms]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=6580</guid>
		<description><![CDATA[Recently a friend messaged me about the url input type, and how to prevent Opera from automatically prepending http:// to the value of a URL input field if it is missing. I think I&#8217;ve found a workaround, but first, I want to discuss the url input type, and how different browsers handle it. HTML5 introduces [...]]]></description>
			<content:encoded><![CDATA[<p>Recently a friend messaged me about the <code>url</code> input type, and how to prevent Opera from automatically prepending http:// to the value of a URL input field if it is missing. I think I&#8217;ve found a workaround, but first, I want to discuss the <code>url</code> input type, and how different browsers handle it.</p>
<p>HTML5 introduces several additional <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html">types for the <code>input</code> element</a>. One goal of these additional types is to offload error checking from the JavaScript layer to the browser. The HTML5 specification includes rules and patterns for data validation, including for URLs with the <code>url</code> attribute value.</p>
<p>According to the HTML5 specification, a <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#valid-url">URL is valid</a> when it is <b>not an empty string</b>, and is a <q class="b">valid absolute URL.</q> A complete definition of what constitutes a valid URL can be found in <a href="http://tools.ietf.org/html/rfc3986">RFC 3986</a> and <a href="http://tools.ietf.org/html/rfc3987">RFC 3987</a>. The short version is that a valid URL <em>must</em>, at minimum, consist of a scheme (https://, ftp://, gopher://) and a host name. If it does not, validation should fail, and the browser should throw an error.</p>
<p>Now most recent browsers<a href="#n20120103">*</a> take the following steps when it encounters an invalid URL such as <code>foo.com</code> or <code>example:80</code>.</p>
<ol>
<li>Fire an <code>invalid</code> event on the element in question.</li>
<li>Display an error message to the user. </li>
<li>Prevent form submission.</li>
</ol>
<p>To prevent careless input errors and guarantee validation, Opera will <a href="http://tiffanybbrown.com/code/2012/forms_input_type/default/">automatically prepend <code>http://</code></a> to the value of a URL input field if it is missing when the field loses focus (and if no pattern attribute has been added). This means that the invalid event usually will not be fired.</p>
<p>Of course, &#8220;most recent browsers&#8221; does not mean &#8220;all.&#8221; To date, <b>Safari</b> will fire the <code>invalid</code> event, but it will <b>do so silently</b>. No error message will be shown to the user. Form submission will succeed. The value submitted will be the same as what was entered by the user. <b>Android&#8217;s WebKit</b> behaves much the same way.</p>
<p>Safari also does something else differently <b>on mobile devices</b>: it shows a keyboard layout that is optimized for typing URLs, complete with a <kbd>.com</kbd> virtual button.<br />
<img src="http://webinista.s3.amazonaws.com/images/uploads/2012/01/iossafari-kbd.jpg" width="320" alt="The iOS keyboard"></p>
<p>Back to my friend&#8217;s use case: he wanted the benefit of mobile Safari&#8217;s UI sugar, so he was using <code>&lt;input type="url"&gt;</code>. He was unconcerned with whether the URL was valid because he was using server-side validation. His <strong>primary goal was ease of data entry for domain names on iOS devices</strong>.</p>
<p>However: <b>that isn&#8217;t really the purpose of <code>&lt;input type="url"&gt;</code></b>. Validation is, and a domain name by itself is not a valid URL.</p>
<p>But since the ship has sailed, the horse has left the barn, and the chickens have flown the coop, let&#8217;s talk about how to prevent Opera from automatically prepending http:// to the value of a URL input field.</p>
<p>To do this, we need to do two things:
<ul>
<li>Add a <code>novalidate</code> attribute to the form element.</li>
<li>Add a null <code>pattern</code> attribute to the field element.</li>
</ul>
<p>For example:</p>
<pre>&lt;form action="../form.php" method="post" novalidate&gt;
    &lt;input type="url" name="uri" id="uri" value="" pattern=""&gt;
    &lt;button type="submit"&gt;submit&lt;/button&gt;
&lt;/form&gt;</pre>
<p>The <code>novalidate</code> attribute turns off client-side validation for the entire form. The pattern attribute override&#8217;s Opera&#8217;s native validation checking.</p>
<p>See <a href="http://tiffanybbrown.com/code/2012/forms_input_type/stopprepending/">for yourself</a>. This will still trigger the URL-entry keyboard layout in iOS browsers, while killing Opera&#8217;s prepending.</p>
<p>If you use this technique, keep in mind that <b>server-side validation is even more important</b>. Because we are not providing any constraints on this data, we have increased our chances of getting invalid or malicious data. You should be validating anyway, however, since it is not 100% possible to guarantee that the data reaching our form script has actually come from our form.</p>
<p class="footnote" id="n20120103">*And by &#8220;recent browsers,&#8221; I mean the latest versions of Opera, Chrome, Firefox, and the forthcoming Internet Explorer 10, but not IE9.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2012/01/03/input-typeurl-validation-and-user-interfaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 for AS3 Developers: cross-domain.xml and Cross-Origin Resource Sharing</title>
		<link>http://tiffanybbrown.com/2011/10/10/html5-for-as3-developers-cross-domain-xml-and-cross-origin-resource-sharing/</link>
		<comments>http://tiffanybbrown.com/2011/10/10/html5-for-as3-developers-cross-domain-xml-and-cross-origin-resource-sharing/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 10:00:47 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[ActionScript, Flash & Flex]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server management]]></category>
		<category><![CDATA[cors]]></category>
		<category><![CDATA[html5foras3devs]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=6226</guid>
		<description><![CDATA[This is the second post in an occasional series designed to bridge the gap between ActionScript 3.0 and emerging front-end technologies. Flash, like JavaScript, more-or-less adheres to a same-origin policy by default. Under a same-origin policy, requests for data must come from the same scheme, hostname, and port. If http://foo.example tries to request data from [...]]]></description>
			<content:encoded><![CDATA[<p class="editors-note">This is the <a href="http://tiffanybbrown.com/tag/html5foras3devs">second post</a> in an occasional series designed to bridge the gap between ActionScript 3.0 and emerging front-end technologies.</p>
<p>Flash, like JavaScript, more-or-less adheres to a <a href="http://www.w3.org/Security/wiki/Same_Origin_Policy">same-origin</a> policy by default. Under a same-origin policy, requests for data must come from the same scheme, hostname, and port. If <code>http://foo.example</code> tries to request data from <code>http://bar.example</code>, the request will usually fail.</p>
<p>Same-origin policies are designed to prevent the unauthorized leakage of data to a third-party server. Without it, a script or SWF hosted on <code>http://mightbeevil.foo</code> could read data hosted on <code>http://goodsite.foo</code> and send it to <code>http://muhahahaevilsite.foo</code>. This kind of cross-domain activity could be used to exploit cookie and authentication data. It&#8217;s clearly a bad thing.</p>
<p>Recent browsers have safeguarded against these kinds of cross-site scripting exploits by <a href="https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript">preventing</a> JavaScript from making cross-origin requests. <code>XMLHttpRequest</code>, for example, will throw a security exception if you attempt a cross-origin request.</p>
<p>Flash, meanwhile has long supported a means for enabling cross-origin requests: the <a href="https://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html">policy file</a>. The policy file is a way of white-listing requests for data or credentials from specific origins. It lives on the server from which you are requesting data, and gives the Flash player a &#8220;yay&#8221; or &#8220;nay&#8221; when asked whether the request from a specific origin should be allowed to complete.</p>
<p>Cross-origin restrictions, though necessary, are also quite limiting.  You can&#8217;t (or <em>couldn&#8217;t</em>), for example, request data for a mash-up using <code>XMLHttpRequest</code>. Though there are workarounds &#8212; using dynamic script insertion, or using the <a href="https://developer.mozilla.org/en/DOM/document.domain"><code>document.domain</code></a> &#8212; those workarounds also leave the DOM vulnerable to cross-site scripting. </p>
<p>To to mitigate the dangers of cross-site scripting while still enabling it, the W3C is developing the <a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a> (CORS) specification. It functions similarly to Flash&#8217;s cross-domain policy file, but uses HTTP headers instead of an XML configuration file. </p>
<p>CORS request headers are automatically generated by conforming browsers when a script attempts a cross-domain request. Response headers must be set in the server&#8217;s configuration file, or dynamically per URL using a server-side language.</p>
<p>Let&#8217;s compare a sample cross-domain.xml file to how we&#8217;d achieve the same thing using CORS.</p>
<h2>Cross-origin requests from Flash</h2>
<p>To use the domains from our example above, if <code>http://mightbeevil.foo</code> made a request to data hosted on <code>http://goodsite.foo</code>, <code>http://goodsite.foo</code> would need to permit the request by including mightbeevil.foo it in its policy file. For example:</p>
<pre>
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;!DOCTYPE cross-domain-policy SYSTEM &quot;http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd&quot;&gt;
&lt;cross-domain-policy&gt;
    &lt;allow-access-from domain=&quot;mightbeevil.foo&quot;/&gt;
&lt;/cross-domain-policy&gt;</pre>
<p>This file must be stored in the web root of <code>http://goodsite.foo</code>. It explicitly permits mightbeevil.foo &#8212; and permits only mightbeevil.foo &#8212; to make requests for its data (from within a Flash movie). </p>
<h2>Cross-origin requests from the DOM</h2>
<p>To reuse our example from above, let&#8217;s use <a href="http://www.w3.org/TR/XMLHttpRequest2/"><code>XMLHttpRequest</code></a> to make a request from <code>http://mightbeevil.foo</code> to <code>http://goodsite.foo</code>.</p>
<pre>
var xhr, onLoadHandler 

onLoadHandler = function(event){
     alert('It is done!');
}

xhr = new XMLHttpRequest();
xhr.open('GET','http://goodsite.foo/data.json');
xhr.onload = onLoadHandler;
xhr.send(null);
</pre>
<p>It looks just like a regular XHR request, except for the fact that we&#8217;re requesting data from another origin. Let&#8217;s take a look at our headers.</p>
<pre>Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Encoding:gzip, deflate
Accept-Language:en-us,en;q=0.5
Connection:keep-alive
Host:goodsite.foo
Origin:http://mightbeevil.foo
Referer:http://mightbeevil.foo/make_cross_domain_request/
User-Agent: Awesome/9.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0) FantasticEngine/8889876 Awesome Browser/9.0</pre>
<p>Notice that our headers include <code>Origin:http://mightbeevil.foo</code>. </p>
<p>Goodsite.foo responds with the following headers.</p>
<pre>Access-Control-Allow-Origin:http://mightbeevil.foo
Connection:Keep-Alive
Content-Length:1349
Content-Type:application/json
Date:Mon, 26 Sep 2011 04:44:50 GMT
Keep-Alive:timeout=5, max=100
Server:Apache/2.2.20</pre>
<p>Here we see that an <code>Access-Control-Allow-Origin</code> response header is returned by the server. Like <code>allow-access-from</code>, it indicates which domain(s) are allowed to make requests. Here, we want to know whether <code>mightbeevil.foo</code> is allowed to request data. It is, so the request will be completed. </p>
<p>Acceptable values for <code>Access-Control-Allow-Origin</code> include an origin (scheme + host + port), a comma-separated list of origins&dagger;, or a wildcard (*). As with cross-domain.xml, if the value of <code>Access-Control-Allow-Origin</code> had instead been <code>http://notevil.foo</code>, the request would have failed. Using a wildcard allows requests from <em>any</em> domain.</p>
<p>Of course, both specifications are more complex than what I have covered here. These examples illustrate how to enable a basic cross-origin request. It is also possible with both CORS and Flash to permit or exclude custom headers. And in the case of CORS, it is possible to use methods such as <code>PUT</code> or <code>DELETE</code> if the user agent supports it.</p>
<table class="browsersupport">
<caption>Browser support for Cross-Origin Resource Sharing as of 10 January 2012</caption>
<tr>
<th>Opera</th>
<th>Opera Mini</th>
<th>Opera Mobile</th>
<th>IE</th>
<th>Firefox</th>
<th>Chrome</th>
<th>Safari</th>
<th>iOS Safari</th>
<th>Android WebKit</th>
</tr>
<tr>
<td class="yes center">11.60+</td>
<td class="no center mobile">no</td>
<td class="no center mobile">no</td>
<td class="yes center">8.0+</td>
<td class="yes center">4.0+</td>
<td class="yes center">5.0+</td>
<td class="yes center">4.0+</td>
<td class="yes center mobile">3.2+</td>
<td class="yes center mobile">2.1+</td>
</tr>
</table>
<h2>Learn more</h2>
<ul>
<li><a href="https://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html">Flash cross-domain policy file specification</a></li>
<li><a href="http://www.w3.org/TR/cors/">Cross-origin Resource Sharing</a></li>
<li><a href="http://www.w3.org/TR/XMLHttpRequest2/">XMLHttpRequest Level 2</a></li>
</ul>
<p class="footnote">&dagger; Most browsers do not yet support multiple origin values. The specification is also a working draft, and subject to change.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/10/10/html5-for-as3-developers-cross-domain-xml-and-cross-origin-resource-sharing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Looping video in browsers that don&#8217;t yet support the loop attribute</title>
		<link>http://tiffanybbrown.com/2011/10/04/looping-video-in-browsers-that-dont-yet-support-the-loop-attribute/</link>
		<comments>http://tiffanybbrown.com/2011/10/04/looping-video-in-browsers-that-dont-yet-support-the-loop-attribute/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 10:00:43 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[(x)HTML]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[JavaScript/ECMAScript]]></category>
		<category><![CDATA[Web Development & Programming]]></category>
		<category><![CDATA[DOMScripting]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[html5 video]]></category>
		<category><![CDATA[multimedia]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=6314</guid>
		<description><![CDATA[To date, Firefox does not yet support the loop attribute of the &#60;video&#62; element. This snippet is a simple work-around. Once the video&#8217;s ended event is fired, it calls the play method. For more, consult the media events section of the HTML5 specification.]]></description>
			<content:encoded><![CDATA[<p>To date, Firefox does not yet support the <code>loop</code> attribute of the <code>&lt;video&gt;</code> element. This snippet is a simple work-around. Once the video&#8217;s  <code>ended</code> event is fired, it calls the <code>play</code> method.</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/webinista/eUvrc/embedded/"></iframe></p>
<p>For more, consult the <a href="http://dev.w3.org/html5/spec-author-view/media-elements.html#mediaevents">media events</a> section of the HTML5 specification.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/10/04/looping-video-in-browsers-that-dont-yet-support-the-loop-attribute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Broken or Jumpy CSS Transitions? Use the same unit of length</title>
		<link>http://tiffanybbrown.com/2011/09/28/broken-or-jumpy-css-transitions-use-the-same-unit-of-length/</link>
		<comments>http://tiffanybbrown.com/2011/09/28/broken-or-jumpy-css-transitions-use-the-same-unit-of-length/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 00:01:35 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[css transitions]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=6287</guid>
		<description><![CDATA[I came across an issue recently while trying to transition from left: 30px to left: 50%. The transition appeared to work, but it wasn&#8217;t smooth and transition-like. It was jumpy. Worse yet, another item I applied a transition to in the same document worked perfectly. It&#8217;s starting left value? 0px. Confusing, right? Not really. Browsers [...]]]></description>
			<content:encoded><![CDATA[<p>I came across an issue recently while trying to transition from <code>left: 30px</code> to <code>left: 50%</code>. The transition appeared to work, but it wasn&#8217;t smooth and transition-like. It was jumpy. Worse yet, another item I applied a transition to in the same document worked perfectly. It&#8217;s starting <code>left</code> value? <code>0px</code>. Confusing, right?</p>
<p>Not really. Browsers ignore the unit type when the value is 0. That&#8217;s why <code>margin: 0</code> is the same as <code>margin: 0em</code> and <code>margin: 0px</code>. If it&#8217;s zero, after all, what does the unit matter? That explains why the second item&#8217;s transition worked well. </p>
<p>But when there is a mis-match between the type of unit, most browsers &#8212; Firefox is the exception to date &#8212; won&#8217;t transition between the two values. The result? It jumps. The fix: make sure that you are transitioning between two values of the same unit (or transitioning from a 0 start value). </p>
<p>Since this is better shown than written about, this demo <a href="http://tiffanybbrown.com/code/2011/transitionunits/">illustrates what I mean</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/09/28/broken-or-jumpy-css-transitions-use-the-same-unit-of-length/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Opera Turbo and IP address blocking</title>
		<link>http://tiffanybbrown.com/2011/08/11/opera-turbo-and-ip-address-blocking/</link>
		<comments>http://tiffanybbrown.com/2011/08/11/opera-turbo-and-ip-address-blocking/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 11:00:32 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[Opera]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[justin.tv]]></category>
		<category><![CDATA[opera turbo]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=6105</guid>
		<description><![CDATA[IP-based blocking is sometimes necessary when abuses are coming from a particular location. However, for users of proxy servers &#8212; such as Opera Turbo &#8212; blocking one IP also blocks all people using that proxy. There is a workaround, but first, some background. What is Opera Turbo? Opera Turbo is a feature of Opera Mobile [...]]]></description>
			<content:encoded><![CDATA[<p>IP-based blocking is sometimes necessary when abuses are coming from a particular location. However, for users of proxy servers &#8212; such as Opera Turbo &#8212; blocking one IP also blocks all people using that proxy. There <em>is</em> a workaround, but first, some background.</p>
<h2>What is Opera Turbo?</h2>
<p><a href="http://www.opera.com/browser/turbo/">Opera Turbo</a> is a feature of <a href="http://www.opera.com/mobile/">Opera Mobile</a> and <a href="http://www.opera.com/browser/">Opera Desktop</a>. Turbo compresses data so that pages and images load faster over slower connections.</p>
<p>Compression takes place on one of Opera&#8217;s proxy servers. As with Opera Mini, the request goes from the desktop or mobile device to the proxy server. The proxy makes the request to the user-requested domain, receives and compresses the response, and returns it to the browser.</p>
<p>To see this in action, <a href="http://www.opera.com/download/">download Opera</a> if you haven&#8217;t already. Launch it, then visit <a href="http://whatismyip.com/">Whats My IP Address?</a>. Make note of the reported IP. Then turn on Turbo using the icon in the status bar (<img src="http://webinista.s3.amazonaws.com/images/uploads/2011/08/turbobutton.gif" alt="Opera Turbo Icon" width="29" height="19" class="alignnone size-full wp-image-6113" />) and refresh the page. </p>
<h2>When blocking by IP goes bad</h2>
<p>This generally works smoothly <em>until a server blocks a specific IP address</em>. For example, if you visit <a href="http://Justin.tv/">Justin.tv</a>, using Opera with Turbo enabled, you will received the following message: <q>You have been blocked from using Justin.tv services, for more information please <a href="http://community.justin.tv/mediawiki/index.php/Suspended_accounts">visit this page to learn more</a>.</q></p>
<p>A rogue user caused Opera&#8217;s server IP address to be blocked, but the IP that originated the abusive request was not. That&#8217;s, obviously, a bad thing for Opera Turbo users.</p>
<p>Similar problems occur can occur with sites that geo-restrict content by IP address.</p>
<h2>The <code>X-Forwarded-For</code> Header</h2>
<p>That&#8217;s where the <code>X-Forwarded-For</code> header comes in. When in Turbo mode (or when using Opera Mini), Opera sends an additional <code>X-Forwarded-For</code> header that includes the IP address of the originating device. </p>
<p>The headers below are an example of what Opera desktop sends when Turbo is disabled.</p>
<pre>
User-Agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; Edition Next; en) Presto/2.9.181 Version/12.00
Host: webinista.com
Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Accept-Language: en,en-US;q=0.9,ja;q=0.8,fr;q=0.7,de;q=0.6,es;q=0.5,it;q=0.4,pt;q=0.3,pt-PT;q=0.2,nl;q=0.1,sv;q=0.1,nb;q=0.1,da;q=0.1,fi;q=0.1,ru;q=0.1,pl;q=0.1,zh-CN;q=0.1,zh-TW;q=0.1,ko;q=0.1
Accept-Encoding: gzip, deflate
Cache-Control: no-cache
Connection: Keep-Alive
</pre>
<p>And this next set of headers is an example of what Opera sends when Turbo is enabled.</p>
<pre>
Host: webinista.com
Accept-Language: en,en-US;q=0.9,ja;q=0.8,fr;q=0.7,de;q=0.6,es;q=0.5,it;q=0.4,pt;q=0.3,pt-PT;q=0.2,nl;q=0.1,sv;q=0.1,nb;q=0.1,da;q=0.1,fi;q=0.1,ru;q=0.1,pl;q=0.1,zh-CN;q=0.1,zh-TW;q=0.1,ko;q=0.1
User-Agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; Edition Next; en) Presto/2.9.181 Version/12.00
Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
X-Forwarded-For: 78.93.91.42
</pre>
<p>Should you need to block a specific IP, you can check whether the <code>X-Forwarded-For</code> is included as a request header and if so, compare that IP to your list of blocked IPs.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/08/11/opera-turbo-and-ip-address-blocking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XHR2 + CORS Slides, some AppCache-fu, OpenWebCamp, and Opera News</title>
		<link>http://tiffanybbrown.com/2011/06/30/xhr2-cors-slides-some-appcache-fu-openwebcamp-and-opera-news/</link>
		<comments>http://tiffanybbrown.com/2011/06/30/xhr2-cors-slides-some-appcache-fu-openwebcamp-and-opera-news/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 01:00:49 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Tech Events]]></category>
		<category><![CDATA[Web Development & Programming]]></category>
		<category><![CDATA[appcache]]></category>
		<category><![CDATA[application cache]]></category>
		<category><![CDATA[base64_encode]]></category>
		<category><![CDATA[cors]]></category>
		<category><![CDATA[data uris]]></category>
		<category><![CDATA[html5la]]></category>
		<category><![CDATA[open web camp]]></category>
		<category><![CDATA[xhr2]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=6052</guid>
		<description><![CDATA[For the June meeting of the HTML5 &#038; CSS3 LA User Group, I spoke about XMLHttpRequest, Level 2 and Cross-Origin Resource Sharing headers. It&#8217;s always tough to present code. That goes double when you are sleep deprived, yet caffeinated and tongue-tied. In any case, the slides &#8212; which is really just one really long, really [...]]]></description>
			<content:encoded><![CDATA[<p>For the June meeting of the <a href="http://html5la.com/">HTML5 &#038; CSS3 LA User Group</a>, I spoke about XMLHttpRequest, Level 2 and Cross-Origin Resource Sharing headers. It&#8217;s always tough to present code. That goes double when you are sleep deprived, yet caffeinated and tongue-tied. </p>
<p>In any case, the slides &#8212; which is really just one really long, really heavy HTML file with inline CSS, JS, and images (thanks, data URIs!) &#8212; are <a href="http://tiffanybbrown.com/presentations/2011/xhr2/">now available</a>.</p>
<p><a href="http://en.wikipedia.org/wiki/Data_URI_scheme">Data URI</a>s have been available for quite a while now, though Internet Explorer versions 5-7 don&#8217;t support them. They are string representations of file data, typically base-64 encoded. When used as an <code>img</code> or <code>url()</code> source, they reduce the number of HTTP requests. And as we know, making fewer HTTP requests is the <a href="http://stevesouders.com/hpws/rule-min-http.php">number 1 rule</a> of web site optimization &#8230; except y&#8217;know when it creates a 1.8MB HTML file <img src='http://tiffanybbrown.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>It&#8217;s simple enough to convert files to a base64 encoded string with a few lines of code. Let&#8217;s assume we want to convert a file named &#8220;cars.png.&#8221; In PHP it might looks like this:</p>
<pre>$filename = 'cars.png';
$ext = pathinfo($filename,PATHINFO_EXTENSION);
switch($ext){
     case 'gif':
          $type = 'image/gif';
          break;
     case 'png':
          $type = 'image/png';
          break;
     case 'jpeg':
          $type = 'image/jpeg';
          break;
}
$fileHandler = fopen($filename,"r");
$data = fread($fileHandler, filesize($filename));
print 'data:'.$type.';base64,'.base64_encode($data);</pre>
<p>Despite the ginormous HTML file, I still think it&#8217;s useful for it to be a single-file package. After all, you only have to save and keep track of that one HTML file. </p>
<h2>Application Cache</h2>
<p>Bonus: you can view it offline because I took advantage of <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html">Application Cache</a>. </p>
<p>Application Cache is an awesome technique that can speed up load times by caching data locally. But it also ensures that if connectivity is lost or unavailable, you can still visit that URL and have access to the content. This assumes, of course, that you&#8217;re using a browser that supports AppCache. The latest versions of <a href="http://caniuse.com/#search=appcache">most major browsers</a>, <strong>including Opera 11+</strong>, do.</p>
<p>Application Cache is also quite simple &#8212; at least the basics of it are. First, add a manifest attribute to your &lt;html&gt; element.</p>
<pre>&lt;html manifest="/path/to/manifest.appcache"&gt;</pre>
<p>Then create a manifest file. It&#8217;s a simple, plain text file that <em>must</em> be sent with a <code>Content-type: text/cache-manifest</code> header. Typically the file name should have an .appcache extension, though it will work (for now, at least) if it&#8217;s named foo.manifest provided you send the correct content type header.</p>
<p>A basic manifest &#8212; the one I&#8217;ve used for the slides in fact &#8212; looks like this: </p>
<pre>CACHE MANIFEST

CACHE:
index.html
</pre>
<p>That&#8217;s it. We have told our browser to cache this page. You can also specify which files the browser should <em>always</em> retrieve from the server with <code>NETWORK</code>, or which files to use if you need to fall back.  It&#8217;s fascinating stuff. For more, check out HTML5 Doctor&#8217;s post, <a href="http://html5doctor.com/go-offline-with-application-cache/">Go offline with application cache</a>.</p>
<h2>I&#8217;ll be at Open Web Camp!</h2>
<p>I&#8217;ll be speaking more about AppCache and other things at <a href="http://openwebcamp.org/schedule" class="b">Open Web Camp</a> <b>July 16</b> at Stanford University in Palo Alto. Come say hi.</p>
<h2>Opera news, in case you missed it:</h2>
<ul>
<li><a href="http://my.opera.com/desktopteam/blog/2011/06/28/swordfish-jumps-out-of-the-water">Opera 11.50 was released Tuesday</a></li>
<li><a href="http://my.opera.com/ODIN/blog/2011/06/30/opera-mobile-11-1-new-features-and-additions">Opera Mini 6.1 and Opera Mobile 11.1</a> were released yesterday (6/29)</li>
</ul>
<p>I&#8217;m most excited that the Opera Mobile rendering engine is now running Presto 2.8 which means it now supports multi-layouts (we run on tablets too!), session history and navigation, and the <a href="http://www.w3.org/TR/FileAPI/">File API</a> (among other things).</p>
<p><h</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/06/30/xhr2-cors-slides-some-appcache-fu-openwebcamp-and-opera-news/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Launching remote debugging in Google Chrome Mac OS X</title>
		<link>http://tiffanybbrown.com/2011/05/18/launching-remote-debugging-in-google-chrome-mac-os-x/</link>
		<comments>http://tiffanybbrown.com/2011/05/18/launching-remote-debugging-in-google-chrome-mac-os-x/#comments</comments>
		<pubDate>Thu, 19 May 2011 01:12:27 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Chrome]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=5972</guid>
		<description><![CDATA[So while I was on vacation for Wedding Week, Google done went and made an announcement about new Chrome developer tools. It includes a fancy new remote debugging feature. I will explain to you how to get to it in a bit, since the directions are slightly different for Mac OS X users. Before I [...]]]></description>
			<content:encoded><![CDATA[<p>So while I was on vacation for <a href="http://">Wedding Week</a>, Google done went and made an announcement about new Chrome developer tools. It includes a fancy new remote debugging feature. I will explain to you how to get to it in a bit, since the <a href="http://code.google.com/chrome/devtools/docs/remote-debugging.html">directions</a> are slightly different for Mac OS X users.</p>
<p>Before I do that, though, let me say something.</p>
<p style="font-size:2em;">OPERA DRAGONFLY HAD REMOTE DEBUGGING FIRST.</p>
<p>Now:</p>
<ol>
<li>Make sure you are running the latest version of <a href="http://www.google.com/chrome/">Google Chrome</a> (<a href="http://tools.google.com/dlpage/chromesxs">or Chrome Canary</a>).</li>
<li>Fire up Terminal.app (or iTerm if that&#8217;s what you&#8217;re using).</li>
<li>Type
<pre>/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222</pre>
<p> and hit the return key  (note we&#8217;re escaping spaces with a \).</li>
</ol>
<p>This is a feature that has been added to the WebKit core. Expect to see it in Chromium, Safari, and other WebKit-based browsers in due time.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/05/18/launching-remote-debugging-in-google-chrome-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Make CSS3 Buttons Like A Bawse</title>
		<link>http://tiffanybbrown.com/2011/05/17/make-css3-buttons-like-a-bawse/</link>
		<comments>http://tiffanybbrown.com/2011/05/17/make-css3-buttons-like-a-bawse/#comments</comments>
		<pubDate>Tue, 17 May 2011 21:59:20 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Opera]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=5946</guid>
		<description><![CDATA[Shout out to Rick Ross for his pronunciation because &#8220;bawse&#8221; > &#8220;boss.&#8221; What Mazzola&#8217;s CSS3 buttons look like in Opera 11.10. In January, Chad Mazzola posted a Thoughtbot article titled Make CSS3 buttons like a boss (via nico604). It is a great read for designers, but it does have one glaring omission: no Opera support.* [...]]]></description>
			<content:encoded><![CDATA[<p class="editors-note">Shout out to Rick Ross for his pronunciation because &#8220;bawse&#8221; > &#8220;boss.&#8221;</p>
<div class="image640"><a href="http://webinista.s3.amazonaws.com/images/uploads/2011/05/bawsebuttons.png"><img src="http://webinista.s3.amazonaws.com/images/uploads/2011/05/bawsebuttons.png" alt="" title="bawsebuttons" width="610" height="100" class="alignnone size-full wp-image-5949" /></a>What Mazzola&#8217;s CSS3 buttons look like in Opera 11.10.</div>
<p>In January, Chad Mazzola posted a Thoughtbot article titled <a href="http://robots.thoughtbot.com/post/2718077289/make-css3-buttons-like-a-boss">Make CSS3 buttons like a boss</a> (via <a href="https://twitter.com/#!/nico604/status/70553848170823680">nico604</a>). It is a great read for designers, but it does have one glaring omission: no Opera support.<a href="#n20110517a">*</a> (I know right? <em>Who does that?</em>)</p>
<p>So let&#8217;s improve Mazzola&#8217;s code to add Opera support and use standard, prefix-less properties where we can.</p>
<h2>Opera and Linear gradients</h2>
<p>As Mazzola points out, the light source for these buttons is coming from overhead, giving highlights at the top edge, but darkness and shadows at the bottom. He starts with linear gradients for Firefox and Safari/Chrome.</p>
<pre>
button {
  background: #3b88d8;
  background: -moz-linear-gradient(0% 100% 90deg, #377ad0, #52a8e8);
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#52a8e8), to(#377ad0));
}
</pre>
<p>We will add a linear gradient style for Opera.</p>
<pre>
button {
  background: #3b88d8;
  background: -moz-linear-gradient(0% 100% 90deg, #377ad0, #52a8e8);
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#52a8e8), to(#377ad0));
  background: -o-linear-gradient(90deg, #377ad0 0%, #52a8e8 100%);
}
</pre>
<p>Note that Opera&#8217;s syntax is different from that of WebKit&#8217;s or Firefox&#8216;s implementation. It&#8217;s closer to the current version of the <a href="http://www.w3.org/TR/css3-images/#linear-gradients">specification</a>. Since this is a  simple gradient, we could also use a simpler syntax for Opera: <code>-o-linear-gradient(#377ad0, #52a8e8)</code>. Read more about <a href="http://dev.opera.com/articles/view/css3-linear-gradients">linear gradients in Opera</a>.</p>
<p>The syntax for borders is the same in Opera as it is in Firefox, Internet Explorer, Safari and Chrome. We can skip that section. But we can adjust Mazzola&#8217;s <code>box-shadow</code> styles to reflect current browser support.</p>
<p>Browsers have pretty much standardized their implementations of <code>box-shadow</code>. The appearance varies slightly, but the syntax is the same. That means this code:</p>
<pre>
button {
  -moz-box-shadow: inset 0 1px 0 0 #72b9eb, 0 1px 2px 0 #b3b3b3;
  -webkit-box-shadow: inset 0 1px 0 0 #72b9eb, 0 1px 2px 0 #b3b3b3;
}
</pre>
<p>can become:</p>
<pre>
button {
  box-shadow: inset 0 1px 0 0 #72b9eb, 0 1px 2px 0 #b3b3b3;
}
</pre>
<p>The above works in the latest versions of all major browsers, including Internet Explorer 9. If you&#8217;d like, you can retain the <code>-moz-</code> and <code>-webkit-</code> prefixes for older versions of those browsers.</p>
<p>Now let&#8217;s look at the styles for the <code>:hover</code> state. Here, Mazzola has applied a linear gradient and a box shadow. Again we will add a gradient for Opera and change the prefixed <code>box-shadow</code> properties to use the unprefixed ones. For future-compatibility, let&#8217;s also add an unprefixed, spec-compliant <code>linear-gradient</code> (which we can also do above).</p>
<pre>
button:hover {
  background: #2a81d7;
  background: -moz-linear-gradient(0% 100% 90deg, #206bcb, #3e9ee5);
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#3e9ee5), to(#206bcb));
  background: -o-linear-gradient(#206bcb, #3e9ee5); /* using the simpler syntax */
  background: linear-gradient(#206bcb, #3e9ee5);
  border-top: 1px solid #2a73a6;
  border-right: 1px solid #165899;
  border-bottom: 1px solid #07428f;
  border-left: 1px solid #165899;
  box-shadow: inset 0 1px 0 0 #62b1e9;
  cursor: pointer;
  text-shadow: 0 -1px 1px #1d62ab;
}
</pre>
<p>Repeat these replacements for the <code>button[disabled]</code> state.</p>
<p>Though Internet Explorer 9 doesn&#8217;t support CSS gradients, you could use an <a href="http://www.w3.org/TR/2003/REC-SVG11-20030114/pservers.html"><abbr title="scalable vector graphics">SVG</abbr> gradient</a> as a background image. You can also use a bitmap image file for older versions of all browsers.</p>
<p>And <em>that&#8217;s</em> how to make CSS3 buttons like a boss.</p>
<p id="n20110517a" class="footnote">*To be fair: Opera didn&#8217;t support linear gradients at the time. Support was added in Opera 11.10, released in March 2011. But Opera did support for prefix-less versions of <code>box-shadow</code> and <code>background-clip</code>. You do not, however, need to use <code>background-clip</code> to make these buttons work in Opera.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/05/17/make-css3-buttons-like-a-bawse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Last week in web development news: Opera Next and Rapid Release channels</title>
		<link>http://tiffanybbrown.com/2011/05/09/rapid-release-channel-opera-next/</link>
		<comments>http://tiffanybbrown.com/2011/05/09/rapid-release-channel-opera-next/#comments</comments>
		<pubDate>Mon, 09 May 2011 08:00:14 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Opera]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=5907</guid>
		<description><![CDATA[Last week&#8217;s big news in browser land: the release of an Opera development channel version: Opera Next. In April, Firefox announced its rapid release channel browser Aurora. And last week, Chrome/Chromium finally released Canary for Mac (Canary for Windows was released in July, 2010). What does this mean? In all three cases, it means we [...]]]></description>
			<content:encoded><![CDATA[<div class="img640">
<img src="http://www.opera.com/bitmaps/portal/next/1150a/product-live-extensions-lg.png"/>
</div>
<p>Last week&#8217;s big news in browser land: the release of an Opera development channel version: <a href="http://my.opera.com/desktopteam/blog/swordfish-and-opera-next">Opera Next</a>. In April, Firefox <a href="http://blog.mozilla.com/blog/2011/04/13/new-channels-for-firefox-rapid-releases/">announced</a> <em>its</em> rapid release channel browser <a href="http://blog.mozilla.com/blog/2011/04/13/new-channels-for-firefox-rapid-releases/">Aurora</a>. And  last week, <a href="http://blog.chromium.org/2011/05/adding-more-yellow-to-mac-color-scheme.html">Chrome/Chromium</a> finally released Canary for Mac (Canary for Windows was released in July, 2010). </p>
<p>What does this mean? In all three cases, it means we can now run pre-beta versions of browsers alongside stable versions. Upgrades to the dev channel happen automatically and won&#8217;t affect our main installations. Finally, we can run multiple browser version installs without tricks, hacks, or running a browser from a disk image.</p>
<p>Download Opera Next from our <a href="http://snapshot.opera.com/mac/alpha_11.50-1009/Opera-Next-11.50-1009.dmg">snapshot server</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/05/09/rapid-release-channel-opera-next/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The type attribute, spaces and Opera browser</title>
		<link>http://tiffanybbrown.com/2011/04/12/the-type-attribute-spaces-and-opera-browser/</link>
		<comments>http://tiffanybbrown.com/2011/04/12/the-type-attribute-spaces-and-opera-browser/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 08:02:50 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[(x)HTML]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[attributes]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[type]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=5864</guid>
		<description><![CDATA[Debugging is part of my day job at Opera. Today, I stumbled across an issue related to white spaces and values for the HTML type attribute that affects Opera. Take a look at the following code: var d = 'test.js'; var s = document.createElement('script'); s.setAttribute("type", " text/javascript"); // note the leading space s.src = d; [...]]]></description>
			<content:encoded><![CDATA[<p>Debugging is part of my day job at <a href="http://www.opera.com/">Opera</a>. Today, I stumbled across an issue related to white spaces and values for the HTML <code>type</code> attribute that affects Opera.</p>
<p>Take a look at the following code:</p>
<pre>
var d = 'test.js';
var s = document.createElement('script');
s.setAttribute("type", " text/javascript"); // note the leading space
s.src = d;
document.querySelector("body").appendChild(s);
</pre>
<p>That space between the &quot; and <code>text/javascript</code> will cause Opera to fail. The script won&#8217;t load and or execute. Other browsers will handle that space with no problem, however. If you aren&#8217;t testing your site in Opera, you would miss this issue. </p>
<p>Keep in mind that this isn&#8217;t really a <em>bug</em>. It&#8217;s a difference in implementation. Opera is more strict about spaces in attributes than most browsers. The specification is either muddy or silent on this issue (depending on which version you consult). Yes, it&#8217;s something the development team is aware of and discussing internally. Yes, this also applies to the &lt;script&gt; tag.</p>
<p>In the meantime, make sure that you don&#8217;t include spaces at the beginning or end of the value of your type attributes.*</p>
<p>(Or leave it out if you&#8217;re using the HTML5 doctype.)</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/04/12/the-type-attribute-spaces-and-opera-browser/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Thoughts on practices for CSS Gradients</title>
		<link>http://tiffanybbrown.com/2011/04/06/thoughts-on-practices-for-css-gradients/</link>
		<comments>http://tiffanybbrown.com/2011/04/06/thoughts-on-practices-for-css-gradients/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 23:35:48 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[WebKit]]></category>
		<category><![CDATA[gradients]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=5838</guid>
		<description><![CDATA[Examples of CSS gradients are cropping up in the wild, and with good reason. CSS gradients: don&#8217;t require the additional HTTP request of an image file. are easier to modify than image files. &#8220;weigh less&#8221; than most image files. That&#8217;s the ideal, at least. In their current state, gradients are actually a hot mess. The [...]]]></description>
			<content:encoded><![CDATA[<p>Examples of CSS gradients are cropping up in the wild, and with good reason. CSS gradients:</p>
<ul>
<li>don&#8217;t require the additional HTTP request of an image file.</li>
<li>are easier to modify than image files.</li>
<li>&#8220;weigh less&#8221; than most image files.</li>
</ul>
<p>That&#8217;s the ideal, at least. In their current state, gradients are actually a hot mess. The reality?</p>
<ul>
<li>The <a href="http://dev.w3.org/csswg/css3-images/#gradients">specification</a> is still in flux.</li>
<li>Full gradient support is not available in all modern browsers. (For now, Opera 11 only supports linear gradients.)</li>
<li>Many older, though relatively recent versions of browsers (Internet Explorer 8 &amp; 9, Opera 10 Desktop, Opera Mobile, and Opera Mini, for example) don&#8217;t suport CSS gradients at all.</li>
</ul>
<p>So, how can developers take advantage of gradients and still support older browsers? Let&#8217;s look at some approaches.</p>
<h2>Set a background color</h2>
<p>Take a look at the following CSS:</p>
<pre>
#linear{
    width:400px;
    height:300px;
    background-image: -moz-linear-gradient(top left, #f60 0%, #c09 50%, #fc0 100%);
    background-image: -webkit-gradient(linear, 0% 0%, 100% 100%, from(#f60), to(#fc0), color-stop(0.5,#c09) );
    background-image: -o-linear-gradient(top left, #f60 0%, #c09 50%, #fc0 100%);
}
</pre>
<p>This is a fairly common scenario. The developer (*cough*me*cough*) covered most of her bases, but forgot one: browsers that don&#8217;t support gradients at all. You can see what this looks like in Internet Explorer 9 (see <a href="#fig1_20110405">Figure 1</a>).</p>
<div class="img560" id="fig1_20110405"><img src="http://webinista.s3.amazonaws.com/images/uploads/2011/04/nogradientsupport.png" alt="What a gradient looks like in Internet Explorer 9"/>
<p>Figure 1. Internet Explorer 9 doesn&#8217;t yet support CSS gradients. This is what it looks like if you don&#8217;t supply a background color.</p>
</div>
<p>Now look at the following CSS:</p>
<pre>
#linear{
    width:400px;
    height:300px;
    background-color: #333;
    background-image: -moz-linear-gradient(top left, #f60 0%, #c09 50%, #fc0 100%);
    background-image: -webkit-gradient(linear, 0% 0%, 100% 100%, from(#f60), to(#fc0), color-stop(0.5,#c09) );
    background-image: -o-linear-gradient(top left, #f60 0%, #c09 50%, #fc0 100%);
}
</pre>
<p>Here we&#8217;ve set a background image, but we&#8217;ve also set a background color. Browsers that don&#8217;t support CSS gradients will ignore the last three lines. (Note: each browser also ignores the other browsers&#8217; vendor-specific prefixes.)</p>
<p>Setting a background color is the easiest fall back for older / less modern browsers.</p>
<h2>Set a background image using an external file</h2>
<p>Consider the following CSS.</p>
<pre>
#linear{
    width:400px;
    height:300px;
    background-image: url(migas.jpg);
    background-image: -moz-linear-gradient(top left, #f60 0%, #c09 50%, #fc0 100%);
    background-image: -webkit-gradient(linear, 0% 0%, 100% 100%, from(#f60), to(#fc0), color-stop(0.5,#c09) );
    background-image: -o-linear-gradient(top left, #f60 0%, #c09 50%, #fc0 100%);
}
</pre>
<p>In this example, we&#8217;re taking advantage of how browsers apply the cascade. As it turns out, Opera 11, Chrome whatever-the-heck-version-it&#8217;s-up-to, and Firefox 4 will not make the HTTP request for the external file. Safari, however, does (see <a href="#fig2_20110405">Figure 2</a>). Internet Explorer 9 (and less-modern browsers) will only load the external file. Depending on your audience, this may be an acceptable alternative.</p>
<div class="img560" id="fig2_20110405"><a href="http://webinista.s3.amazonaws.com/images/uploads/2011/04/safari-dowloads-migas.png"><img src="http://webinista.s3.amazonaws.com/images/uploads/2011/04/safari-dowloads-migas640.png" alt="Safari web inspector"/></a>
<p>Figure 2. Safari downloads all images. Click to embiggen.</p>
</div>
<p>Note: I have just barely tested this in mobile browsers. (Opera Mobile 11 doesn&#8217;t support gradients. Users will see the external image).</p>
<h2>Use SVG gradients to create a background image</h2>
<p>Internet Explorer 9 and Opera 10 (including Mobile) do not support CSS gradients. They do, however, both support the use of <abbr title="Scalable Vector Graphics">SVG</abbr> images as background images. Another alternative to using external images, then, is to use an SVG file.</p>
<pre>
#linear{
    width:400px;
    height:300px;
    background-image: url(gradient.gif);
    background-image: url(gradient.svg);
}
</pre>
<p>This example works in all current desktop browsers, and most mobile browsers. Safari 5, again, will download both images. Most others will download the latter SVG image. The advantages here are clarity and (arguably) ease of maintenance. Want a different gradient? Change the images. </p>
<p>You should be aware, though, that some recent(-ish) versions of mobile WebKit &#8212; such as the T-Mobile myTouch 4G browser &#8212; don&#8217;t support SVG backgrounds.  You&#8217;ll still need to add a linear gradient for those browsers, or set a background color.</p>
<h2>Or keep doing what we&#8217;ve been doing</h2>
<p>Of course, the growth of SVG and CSS gradients support doesn&#8217;t preclude using GIF, PNG or JPG gradients. The biggest point in favor of using bitmap images is that they still work in older browsers <em>and</em> current ones. </p>
<p>As with any aspect of web development, the right approach should balance concerns of maintainability, file size, and the browser distribution of your audience.</p>
<h2>You left out <code style="text-transform:lowercase;">linear-gradient</code>!</h2>
<p>I left it out of the examples above for two reasons: (1) simplicity; and (2) the syntax could change (though if I had to predict, it won&#8217;t change by much). Be forward-thinking! There are very few reasons not to include the proposed linear-gradient syntax in your code.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/04/06/thoughts-on-practices-for-css-gradients/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HTML5 does NOT allow &#8220;self-closing&#8221; tags …</title>
		<link>http://tiffanybbrown.com/2011/03/23/html5-does-not-allow-self-closing-tags/</link>
		<comments>http://tiffanybbrown.com/2011/03/23/html5-does-not-allow-self-closing-tags/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 16:31:34 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[(x)HTML]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[html5 parsing]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=5735</guid>
		<description><![CDATA[&#8230; on non-void elements, at least. One of the big misconceptions about HTML5 is that any tag can be self-closed. That&#8217;s not true, though it appears that way. What HTML5 does is provide parsing rules for handling mismatched tags and markup. While it seems like self-closing tags are acceptable, that&#8217;s not the case. This post [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230; on non-void elements, at least.</p>
<p>One of the big misconceptions about HTML5 is that <em>any</em> tag can be self-closed. <strong>That&#8217;s not true</strong>, though it appears that way. </p>
<p>What HTML5 does is provide <a href="http://dev.w3.org/html5/spec/parsing.html#parsing">parsing rules</a> for handling mismatched tags and markup. While it seems like self-closing tags are acceptable, that&#8217;s not the case. This post explains what&#8217;s really at play. Let&#8217;s take a look.</p>
<h2>&#8216;Self-closing&#8217;? Our old friend /&gt;</h2>
<p>Let&#8217;s separate void elements from empty tags that don&#8217;t contain content. You&#8217;re probably familiar with &quot;<a href="http://dev.w3.org/html5/spec/Overview.html#void-elements">void</a>&quot; elements &#8212; elements that can&#8217;t have any content. They include the <code>img</code>,  <code>br</code>,  <code>hr</code>, and <code>meta</code> elements. </p>
<p>In XHTML, we closed void elements according to the rules of XML syntax, which requires all elements to be closed with end tags or self-closing tags. That&#8217;s where we get the familiar space-slash (&nbsp;/&gt;) of XHTML. HTML5, however, uses HTML parsing syntax, making the &nbsp;/&gt; unnecessary for void elements. It is, however, valid to use it. Yes: <code>&lt;meta charset="UTF-8"&gt;</code> and <code>&lt;meta charset="UTF-8" /&gt;</code> are both acceptable.</p>
<p>Here&#8217;s the thing: a void element is not the same as an element that doesn&#8217;t contain any content. And &#8216;self-closing&#8217; does <em>not</em> mean the same thing as &#8220;the end tag is optional.&#8221;</p>
<p>To state it clearly:  <strong>Most HTML5 elements are <em>not</em> self-closing, but many elements do not require an end tag.</strong></p>
<h2>Wait, what? End tags are optional? It&#8217;s like HTML 3.2 all over again!</h2>
<p>Yes, some HTML5 elements do not require an end tag. Those circumstances are outlined in the <a href="http://dev.w3.org/html5/spec/Overview.html#normal-elements">HTML5 specification</a>. The <code>p</code> element, for example, does not require an end tag if <q>the <code>p</code> element is immediately followed by an <code>address</code>, <code>article</code>, <code>aside</code>, <code>blockquote</code>, <code>dir</code>, <code>div</code>, <code>dl</code>, <code>fieldset</code>, <code>footer</code>, <code>form</code>, <code>h1</code>, <code>h2</code>, <code>h3</code>, <code>h4</code>, <code>h5</code>, <code>h6</code>, <code>header</code>, <code>hgroup</code>, <code>hr</code>, <code>menu</code>, <code>nav</code>, <code>ol</code>, <code>p</code>, <code>pre</code>, <code>section</code>, <code>table</code>, or <code>ul</code>, element, or if there is no more content in the parent element and the parent element is not an <code>a</code> element.</q></p>
<p>In fact, some tags can be <a href="http://dev.w3.org/html5/spec/Overview.html#html-elements">omitted altogether</a>. Browsers with compliant HTML5 parsers (such as the recently released <a href="http://labs.opera.com/news/2011/02/22/">Opera 11.5 snapshot</a>) will add the end tags to the DOM.</p>
<p>But again: &quot;end-tag optional&quot; is a <em>different concept</em> than self-closing.</p>
<h2>How about some examples?</h2>
<p>Let&#8217;s take a look at the following bit of code:</p>
<pre>
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en-us&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;title&gt;HTML tag example&lt;/title&gt;
    &lt;link rel=&quot;stylesheet&quot; href=&quot;styles.css&quot; media=&quot;screen&quot;&gt;

&lt;/head&gt;
&lt;body&gt;

&lt;header&gt;
    &lt;hgroup&gt;
        &lt;h1&gt;When self-closing tags fail&lt;/h1&gt;
        &lt;h2&gt;Not all HTML5 elements are self closing, though some are &#8216;end tag optional&#8217;&lt;/h2&gt;
    &lt;/hgroup&gt;
&lt;/header&gt;

&lt;article&gt;
&lt;p&gt;This is to demonstrate that all HTML elements are &lt;em&gt;not&lt;/em&gt; actually self closing. There is a &quot;self-closed&quot; &lt;code&gt;p&lt;/code&gt; element following this closed paragraph. And it&#8217;s followed by a a &quot;self-closed&quot; &lt;code&gt;a&lt;/code&gt; tag and another paragraph.&lt;/p&gt;

&lt;p id=&quot;notaselfclosinggraf&quot; /&gt;&lt;a id=&quot;notaselfclosinganchor&quot; /&gt;

&lt;p&gt;As you can see, this paragraph is part of the preceeding link.&lt;/p&gt;

&lt;/article&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>You can <a href="http://tiffanybbrown/not-all-html5-tags-are-self-closing/index.html">view the code yourself</a>. Notice that the last paragraph is actually treated as the link text of the of the supposedly self-closed link before it. </p>
<p>Let&#8217;s take a look at <a href="http://tiffanybbrown/not-all-html5-tags-are-self-closing/">another example</a>:</p>
<pre>
&lt;!DOCTYPE html&gt;
&lt;html lang="en-us"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport" content="width=device-width,user-scalable=yes,initial-scale=1.0"/&gt;
    &lt;title&gt;HTML tag example&lt;/title&gt;
    &lt;link rel="stylesheet" href="styles.css" media="screen" /&gt;
    &lt;style&gt;
        .trigger1{
            background: #369;
            border-radius: 4px;
            display:block;
            padding:3px;
            color:#fff;
        }

        #tvFinderImg{
            background:#0c0;
            display:block;
            width: 10px;
            height:10px;
        }    

        #tvFinderImg h3{
            border:1px dashed #c09;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;header&gt;
    &lt;h1&gt;Spans aren't self-closing either&lt;/h1&gt;
&lt;/header&gt;

&lt;div&gt;
&lt;a
class="trigger1" href="#tvFindersrchd"&gt;Lorem ipsum &lt;span id="tvFinderImg" /&gt;&lt;/a&gt;
&lt;p&gt;This is some copy after the "self-closed" tag.&lt;/p&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>In older browsers &#8212; Internet Explorer 8, for example &#8212; the supposedly self-closed tags are handled like unclosed tags. In those browsers, you will see a pink border around <q>This is some copy after the &#8220;self-closed&#8221; tag.</q> </p>
<p><img src="http://webinista.s3.amazonaws.com/images/uploads/2011/03/html5parsingspans.png" alt="" title="html5parsingspans" width="640" height="356" class="alignnone size-full wp-image-5740" /></p>
<p>In browsers that <em>do</em> have HTML5-compliant parsers &#8212; Firefox 4, the Opera 11.5 labs build mentioned above &#8212; the browser re-writes the DOM and adds a closing span tag. Yep. HTML5 saves developers from ourselves by providing rules for handling bad markup. View the DOM of that page in Opera 11.5 with Dragonfly, or Firefox 4 using Firebug (or in Chrome, Safari or IE9 using their developer tools) to see what I mean.</p>
<p>Let me restate this point for clarity: <strong>it only <em>appears</em> that self-closing tags are permitted in HTML5. In actuality, the browser parser treats non-void, self-closed tags as start tags and closes them for you.</strong></p>
<p>Don&#8217;t believe me? Try running <a href="http://validator.w3.org/check?uri=http%3A%2F%2Ftiffanybbrown.com%2Fnot-all-html5-tags-are-self-closing%2Findex.html&#038;charset=%28detect+automatically%29&#038;doctype=Inline&#038;group=0">these</a> <a href="http://validator.w3.org/check?uri=http%3A%2F%2Ftiffanybbrown.com%2Fnot-all-html5-tags-are-self-closing%2Fwithspans.html&#038;charset=%28detect+automatically%29&#038;doctype=Inline&#038;group=0&#038;user-agent=W3C_Validator%2F1.2">pages</a> through the W3C Markup Validator. </p>
<h3>So I can go back to sloppy code?</h3>
<p><em>Maybe</em>. I think you can make an excellent argument for using relaxed markup rules when targeting end-users who may be paying per byte of bandwidth or who are on slow connections &#8212; Canadian mobile users, for example. Send less code. Make the browser handle it.</p>
<p>But keep in mind that older browsers do not have HTML5 parsers. Internet Explorer 7 &#038; 8 do not. Opera 11.10 beta does not. Opera Mobile does not. (Older versions of WebKit technically don&#8217;t either, but WebKit has long <a href="http://www.webkit.org/blog/1273/the-html5-parsing-algorithm/">supported the <code>/&gt;</code> syntax</a>.)  If you have a large proportion of older browser users in your audience, stick to the stricter, XML-style syntax: if you have a start tag, use an end tag. The space-slash is optional for void elements. Don&#8217;t forget to validate!</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/03/23/html5-does-not-allow-self-closing-tags/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>HTML is not XML</title>
		<link>http://tiffanybbrown.com/2011/03/10/html-is-not-xml/</link>
		<comments>http://tiffanybbrown.com/2011/03/10/html-is-not-xml/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 11:10:12 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[(x)HTML]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Opera]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=5688</guid>
		<description><![CDATA[Click to embiggen. View the page causing the error. The problem above was caused by three things working in concert. An HTML page was served with a Content-Type: application/xhtml+xml; response header. Here&#8217;s what the server response headers look like: HTTP/1.1 200 OK Cache-Control: no-cache Pragma: no-cache Content-Length: 4001 Content-Type: application/xhtml+xml; charset=utf-8 Expires: -1 Server: Microsoft-IIS/7.0 [...]]]></description>
			<content:encoded><![CDATA[<div class="image640"><a href="http://webinista.s3.amazonaws.com/images/uploads/2011/03/html_is_not_xml.png"><img src="http://webinista.s3.amazonaws.com/images/uploads/2011/03/html_is_not_xml-640x385.png" alt="H T M L is not X M L" title="html_is_not_xml" width="640" height="385" class="alignnone size-medium wp-image-5689" /></a><br />Click to embiggen. <a href="http://www.e-magin.se/v5/viewer/files/default_t.aspx?gKey=6vrcn3jg">View the page causing the error</a>.</div>
<p>The problem above was caused by three things working in concert.</p>
<ol>
<li>An HTML page was served with a <code>Content-Type: application/xhtml+xml;</code> response header. Here&#8217;s what the server response headers look like:
<pre>
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 4001
Content-Type: application/xhtml+xml; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.0
Set-Cookie: ASP.NET_SessionId=x0zeoofiwnk2lmz5q4pcso45; path=/; HttpOnly
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Wed, 09 Mar 2011 23:17:34 GMT
</pre>
<p>Opera then parsed it according to X(HT)ML rules instead of HTML rules. (Note: this seems to be a <a href="http://my.opera.com/karlcow/blog/2011/03/03/wrong-to-be-right-with-xhtml">problem with IIS servers</a>.)
</li>
<li>An empty element was not self-closed. That <code>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;</code> tag should be <code>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;</code>. Remember your space-slashes people! </li>
<li>A missing DOCTYPE means that even if errors 1 and 2 were fixed, Opera would still parse the document as XML instead of as XHTML. Opera users (and Firefox users) would get that lovely &#8220;This document had no style information&#8221; screen.</li>
</ol>
<p>While many browsers ignore mismatches between the document&#8217;s markup and the server response header, Opera does not. You also can&#8217;t be sure that future versions of common browsers won&#8217;t as more browsers adopt HTML5 parsing rules.*</p>
<p>In the current version of the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/">HTML specification</a>, a document served as text/html is supposed to be parsed according to HTML rules. A document served with an application/xhtml+xml MIME type must be parsed according to the stricter markup rules of X(HT)ML. </p>
<p>Let me emphasize the above point: <strong>server MIME types &#8212; not DOCTYPES &#8212; determine which  parsing rules the browser applies.**</strong></p>
<p>So what does this mean? It means <strong>you need to be a better coder</strong>. Make sure that what your server says agrees with what your document delivers. If you can&#8217;t configure the server, make sure you code your documents according to the MIME type your server says it is. Use a <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-xhtml-syntax.html#parsing-xhtml-documents">DOCTYPE</a>. Understand the differences between XHTML and HTML. And, as always, <a href="http://validator.w3.org/">validate your code</a>. </p>
<p class="footnote">* This is a bad name for it, but I can&#8217;t think of a better one.
</p>
<p class="footnote">** That&#8217;s how it&#8217;s <em>supposed to</em> work at least.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/03/10/html-is-not-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>border-radius support and the CSS 3 Backgrounds and Borders module</title>
		<link>http://tiffanybbrown.com/2011/02/12/border-radius-support-and-the-css-3-backgrounds-and-borders-module/</link>
		<comments>http://tiffanybbrown.com/2011/02/12/border-radius-support-and-the-css-3-backgrounds-and-borders-module/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 03:47:15 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=5626</guid>
		<description><![CDATA[Last week, the CSS 3 Backgrounds and Borders module became a Candidate Recommendation. That means the specification is stable. Browser vendors can implement these features without a vendor prefix if they haven&#8217;t already. border-radius support Preceding to this move from Working Draft to Candidate Recommendation: support for border-radius (and border-top-right-radius, etc.) in Opera 10.5+ (current [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, the <a href="http://www.w3.org/TR/css3-background/">CSS 3 Backgrounds and Borders</a> module became a <a href="http://lists.w3.org/Archives/Public/www-style/2011Feb/0357.html">Candidate Recommendation</a>. </p>
<p>That means the specification is stable. Browser vendors can implement these features <em>without a vendor prefix</em> if they haven&#8217;t already.</p>
<h2><code>border-radius</code> support</h2>
<p>Preceding to this move from Working Draft to Candidate Recommendation: support for <code>border-radius</code> (and <code>border-top-right-radius</code>, etc.) in <strong>Opera 10.5+</strong> (current version is 11.01), <strong>Safari 5+</strong> and <strong>Chrome 5+</strong> (current version &#8212; as of February 12, 2011 &#8212; is 9.0.597.102 beta).</p>
<p>That means this*: </p>
<pre>
div{
	-moz-border-radius: 10px;
	-webkit-border-radius: 10px;
}
</pre>
<p>Can safely become:</p>
<pre>
div{
	-moz-border-radius: 10px;
	border-radius: 10px;
}
</pre>
<p>Yep. You can drop <code>-webkit-</code> from your <code>border-radius</code> properties long as you don&#8217;t mind your sexy rounded corners not appearing in older versions of WebKit-based browsers (and you&#8217;ve been able to do so since June 7, 2010).</p>
<p>Versions of Opera prior to 10.5 didn&#8217;t support <code>border-radius</code>, even with a vendor prefix. Ditto Internet Explorer 7 and 8.</p>
<p>Internet Explorer 9 and Firefox 4 will both support <code>border-radius</code>. <abbr title="Internet Explorer">IE9</abbr> pushed its Release Candidate February 11, 2011. Firefox 4 released its <a href="http://www.mozilla.com/en-US/firefox/beta/">11th beta</a> February 8, 2011.</p>
<p class="footnote">* But the cool, forward-thinking kids were already including <code>border-radius</code>, even before Opera 10.5 supported it.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/02/12/border-radius-support-and-the-css-3-backgrounds-and-borders-module/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

