Archive for October, 2011

File Under: HTML5, Web Standards

HTML5 Drops the Time Element [Updated]

[Update: The W3C has added <time> back to the HTML5 specification. See our follow up post for more details]

Ian Hickson, editor of the HTML5 specification, has decided to drop the proposed <time> element from HTML5. The loss of the time element means, among other things, that there will be no semantically meaningful way to specify publication dates in HTML5.

Hickson claims that the <time> element wasn’t being used for two of its primary use cases, namely easier CSS styling and to indicate publication dates for web documents. He goes on to argue that the third main use case for the time element — writing dates in a machine-readable format — is better handled by the more generic <data> element.

However, Hickson’s claim that <time> “does not seem to have much traction” on the web isn’t borne out by the facts.

In fact, support for the time element is already baked into the Opera web browser and it’s being used on popular sites like Reddit, the Boston Globe and in the default WordPress theme, to say nothing of the countless personal sites and blogs already using <time>. That’s more real-world support than many other HTML5 elements can boast (and those elements aren’t being cut from the HTML5 spec).

What makes the “it hasn’t caught on” argument even weaker is that HTML5 is not yet a finished spec, so claiming that no one is using the time element before officially endorsing the time element doesn’t make much sense. It’s a chicken-and-egg problem. For example, some Microformats could have been rewritten to use <time>, but the Microformats developers need the W3C to endorse HTML5 before they can suggest adding HTML5 elements like <time> to Microformats.

Opera’s Bruce Lawson has spoken out against dropping the <time> element, calling it “a bad decision,” and suggesting that the more generic <data> is less useful than <time>. Lawson defends <time>, writing:

(or its precursor, ) has an obvious semantic (easy to learn, easy to read). Because it’s restricted to dates and times, the datetime attribute has a specific syntax that can be checked by a validator. Conversely, it has no such built-in syntax, as it’s for arbitrary lumps of data, so it can’t be machine validated. This will lead to more erroneous dates being published. Therefore, the reliability and thus the utility of the information being communicated in machine-readable format diminishes.

Indeed, Lawson is only one of a handful of prominent web developers questioning Hickson’s decision. Developer Tantek Çelik suggests a compromise, writing that HTML5 should “keep <time>, expand its granularity, drop pubdate, introduce <data> and study how it’s used.”

The question for many developers is, should we continue to use <time>? The answer is that it depends. Hickson does not have a history of bending to popular opinion, but there has been a great deal of outcry surrounding the loss of time. There’s a chance, despite having an official status of “resolved, fixed” on the HTML5 bug tracker, that <time> might be added back into the spec.

Unfortunately that chance seems slim at the moment. Going forward the more conservative plan would be to use a Microformat like hAtom (or some of the similar efforts from schema.org) in conjunction with the HTML5 data element to create markup that’s valid HTML5, but also retains the semantic meaning lost with the removal of the time element.

See Also:

File Under: Browsers

Mozilla Brings Sharing to the Browser With ‘Firefox Share’

Sharing from the browser with Firefox Share

Mozilla wants to help stop the proliferation of “share this” badges currently cluttering the web. These days nearly every page you visit is plastered with dozens of icons offering to like, or tweet, or +1, or thumbs up, or otherwise tell your friends what you think of the page in question. The clutter can be distracting or even overwhelming and, if Mozilla has anything to say about it, unnecessary.

Firefox has a plan to clean up the clutter and move the sharing power into the browser itself. Mozilla Labs has announced a new project, Firefox Share, a Firefox add-on that makes it easy to share webpages on Twitter or Facebook right from the Firefox URL bar.

Firefox Share is currently an alpha quality release and may have some bugs, but if that doesn’t bother you head on over to the download page and install it (Firefox Share does not require a restart).

Once installed the new add-on adds a paper airplane icon to the URL bar; click that icon and a drop down panel allows you to post to Twitter or Facebook or e-mail a message to a friend.

If that sounds familiar it might be because an earlier Mozilla Labs project, known as F1, does essentially the same thing. So, why the new add-on? Well, part of the reason is that Firefox Share features a much better design, one that looks more like a native Firefox widget and looks Mac-like on a Mac, Windows-like on Windows, and Linux-like on Linux. The native look means that Firefox Share probably has a better chance of making it into a future release of Firefox.

Firefox Share is also totally different under the hood. The old F1 add-on used Mozilla’s servers as a middleman between your tweet and Twitter’s servers or your wall post and Facebook. The new Firefox Share eliminates the middleman and does all the work right in the browser, sending the message directly to Twitter or Facebook. That means Firefox Share is much easier to scale (should it one day be included in Firefox proper) and it also eliminates some possible security concerns.

While all of that makes Firefox Share an improvement over the older F1 add-on, it doesn’t come without some cost, namely far fewer supported services. F1 supported LinkedIn, Google Apps, Yahoo, Twitter, Facebook and even multiple accounts per service. Firefox Share is currently limited to just Twitter and Facebook and there’s no way to use multiple accounts at the same time.

However, while the current alpha release offers limited support for sharing services, the Mozilla Labs blog assures users that the company has “a plan in place to support a long-tail of service providers, so you won’t have to try and convince us to implement your favorite sharing provider.” In other words, this is an alpha, if your favorite service isn’t supported just be patient, or stick with F1 until Firefox Share catches up.

See Also:

File Under: Multimedia, Web Standards

Getting Started with Scalable Vector Graphics (SVG)

Scaling options for SVG images

Scalable Vector Graphics (SVG) have long been the ideal way to create images that need to scale without distorting. For example, SVG is a great format for an icon or logo that needs to be displayed at several sizes without pixelation or other distortion.

Unfortunately SVG’s usefulness on the web has always been curtailed by limited support in popular browsers. However, that’s changed recently with the release of Firefox 4 and Internet Explorer 9, both of which join Opera, Chrome and Safari in offering native support for SVG.

If you’d like to know more about SVG, how to use it and why you’d want to, Microsoft’s Jennifer Yu recently posted a nice overview on how to get started with SVG over at the IEBlog.

Yu covers the basic use cases for SVG, including scalable logos, selectable text within images (great for charts, infographics and the like) and dynamic graphics (for example, route lines overlayed on map tiles).

One thing you won’t get from Yu’s article is info on how to embed your SVG images in HTML. For most browsers you can simply use <img>, though for Firefox 3.6 and below, along with some other older browsers, you’ll need to use <object> (or <iframe>). It’s also now possible to write SVG inline with your HTML, though as Yu points out you’ll need to use the HTML5 doctype for that to work.

Keep in mind that if your site has a lot of traffic from older versions of IE (and that means anything prior to IE 9) you’ll need to have some sort of fallback in place. If you don’t mind involving some JavaScript in the equation, the Raphaël library allows you to easily create and work with SVG objects via JavaScript and will fallback to VML for IE 6+ and other legacy browsers.

For the record, yes, there is a certain irony in learning about SVG from Microsoft given that IE has long been the only web browser without SVG support, but don’t let that stop you from reading through an otherwise quite thorough and informative overview of SVG.

See Also:

File Under: Location, Web Services

Google Plans to Charge Maps Developers

Bad news, map hackers; the Google Maps free ride may be coming to and end. The Google Geo Developers blog recently detailed some changes to Google Maps API, including new rate limits and fees. Starting next year Google Maps will charge $4 per 1,000 map loads on sites where traffic exceeds 25,000 map loads per day.

The good news is that very small sites will remain unaffected since the Google Maps API will still be free for the first 25,000 views per day (those using the Google Maps styling features will be limited to 2,500 views a day).

The bad news is that once your app or website exceeds those limits you’ll be forking out $4 for every 1,000 people that hit your site (or view a map in your mobile app). Alternately, developers can cough up $10,000+ for a Google Maps API Premier licence, which, in addition to the unlimited access offers more advanced geocoding tools, tech support, and control over any advertising shown.

Google says the new fees are intended to make sure Google Maps remains free for small developers. “By introducing these limits we are ensuring that Google can continue to offer the Maps API for free to the vast majority of developers for many years to come,” writes Google Maps API manager Thor Mitchell.

The new rates will kick in next year and are unlikely to impact small sites, which will never exceed the limits, or large sites which can afford the Premier license. The real impact is in the middle — experimental sites that do something creative with Google Maps and end up going viral. No one wants a one-off experiment to end up costing a fortune.

Fortunately, according to the FAQ, sites that exceed the limits without setting up a payment system or buying a Premier license won’t immediately be shut down. “Your maps will continue to function,” says the Google FAQ, however, “a warning may be shown on your map and a Maps API Premier sales manager may contact you to discuss your licensing options.”

In other words, Google appears to be interested mainly in collecting fees from sites with consistently heavy traffic rather than experiments that see a one-time traffic spike. It doesn’t protect against every potentially expensive use case, but it should make map mashup fans breathe a little easier.

Developers worried about the potential costs of the Google Maps API can always use OpenStreetMap, which is free and, in many parts of the world, much more detailed than Google Maps. Of course, OpenStreetMap lacks some Google Maps features, most notably an equivalent to Street View.

See Also:

File Under: Browsers

Mozilla, Microsoft Join Forces for ‘Firefox With Bing’

Mozilla has announced a new special release of Firefox that integrates Microsoft’s Bing search engine into the open source browser. The special Firefox build, dubbed Firefox with Bing, makes Bing the default search provider in both the search bar and Awesome bar, and makes Bing.com the default homepage.

If you’d like to try Firefox with Bing, head on over to the new firefoxwithbing.com and download a copy. If you’re already using the standard version of Firefox the site will instead offer to install the Bing Search for Firefox add-on, giving you the same Bing features without downloading a new browser.

Not a fan of Bing? There’s no need to panic, Mozilla isn’t replacing Google with Bing in the official version of Firefox. Rather Firefox with Bing is part of Mozilla’s growing number of partnerships designed to tailor Firefox to niche markets. Similar special releases exist for Twitter, Yahoo and others.

Of course there’s always the possibility that Mozilla’s partnership with Microsoft will grow into something more. Some news sites have been speculating that Firefox with Bing is a sign of things to come when Mozilla’s contract with Google ends in November. It’s certainly a possibility, but given Google’s contribution to Mozilla’s bottom line it seems unlikely that Mozilla will walk away from its Google deal any time soon.

See Also:

File Under: Web Basics

The Future of the Web Needs to Include the Past

As much as we all love cutting edge web technologies and modern browsers running on fast hardware, sometimes it’s good to step back and remember what really makes the web great is the fact that anyone — using any browser running on any hardware — can use it. As software developer and web evangelist John Allsopp recently put it, “the power of the Web is in its universality.”

Part of that universality means making sure everyone can access the web. That’s why standards exist; why accessibility is important and planning for a future of non-PC devices is a smart move. But universality also means supporting older web browsers, less capable hardware and slower internet connections.

Allsopp’s comment about universality is part of his larger pushback against what he believes is an alarming trend — developers leveraging the latest and greatest features of a specific web browser at the expense of all the rest.

New tools are good and experiments help push the web forward, but excluding those using older browsers just because your killer design doesn’t work is a mistake. So is assuming everyone has the bandwidth to loading megabytes worth of JavaScript.

Progressive enhancement has always been the hallmark of well-crafted websites. That means starting with the least capable devices — an older phone, Lynx running on Windows 95 — and then adding more sophisticated features based on screen size, bandwidth and so on.

The irony of rejecting older browsers today is that it’s never been easier to support them thanks to hundreds of JavaScript shims and the collective hacking knowledge of all the developers who have made the web what it is today (and have probably already solved your problem somewhere along the way).

We’d hate to see anyone limiting what their site can do simply to support older browsers, but at the same time don’t just abandon users who, for whatever reason, are still using Internet Explorer 6 or an old Nokia mobile browser. There’s a middle ground to be found and where that middle lies will vary from site to site. Finding that middle ground is the challenge all developers face. As Allsopp writes, “the truth is, the challenge of universality is daunting. It is hard work. But to me at least, paying this forward is the quid pro quo of the enormous privilege I’ve been granted to work on the web.

[Long Road in Montana by Stuck in Customs/CC/Flickr]

See Also:

File Under: Browsers

Chrome 15 Released with… Improved Start Page

Google has rolled out version 15 of Chrome to its “stable” channel. The update brings some minor cosmetic changes, including a slightly cleaner new tab page, and Google has also redesigned the Chrome Web Store with a simpler layout.

The “new tab” page, which is displayed by default for blank tabs, currently shows a thumbnail grid of the user’s most-visited websites and provides shortcuts to the user’s installed Web applications. The new version is functionally identical, but the layout and behavior have been tweaked.

Chrome's slightly tweaked new tab page

Users can page between the application shortcuts and page thumbnails by clicking an arrow or by using the navigation bar at the bottom of the page. They can also create multiple pages for the application icons. The ability to “pin” a thumbnail to the grid is no longer available, but it’s possible to drag a thumbnail to one of the application pages. Right-clicking an application icon allows users to specify whether the app should open in a regular tab, a pinned tab, or in full screen.

Alongside these changes, Google also overhauled the Chrome Web Store. The design has been greatly simplified with a design that feels more application-like. The main content area displays a grid of installable extensions, applications, and themes. It will dynamically load more as you scroll down. A sidebar on the left lets you search or filter by category, while a navigation bar at the top shows bread crumbs indicating your current location in the navigation hierarchy.

The new version is currently being rolled out to end users, but it can also be downloaded manually from Google’s website.

This article originally appeared on Ars Technica, Wired’s sister site for in-depth technology news.

See Also:

File Under: CSS, Web Standards

Discover What’s New in CSS 4

CSS 3 is still slowly making its way onto the web, but the World Wide Web Consortium (W3C), the governing body that oversees the development of web standards, is already plotting the future of CSS with CSS 4. The W3C recently released the first draft of CSS 4, adding dozens of new rules to make web developers’ lives easier.

The CSS 4 spec is brand new and no web browser actually supports any of these rules yet, but if you’re curious what the next few years will mean for CSS, the first draft offers a sneak peek at what’s in store for web developers.

The biggest news in the current draft of CSS 4 is support for the much-requested parent or “subject” selector. In CSS, rules are typically applied to the innermost selected element. That is, given the chain body header h1, the actual CSS rule will be applied to the h1 element at the end of the chain. CSS 3 offers no way to, say, style the header tag but only if it has an h1 child element. CSS 4 changes that.

CSS 4 includes a means of controlling which element in the selection chain is actually being styled. The easiest way to understand the “subject” selector is by example. Say you want to style a list (ul), but only when the user has clicked on an item in the list. You add a class “clicked” to the item (ul li.clicked) when the user clicks on it, but how do you style the whole list from that class?

With the subject selector it’s simple:

$ul li.clicked {
    background: white;
}

The “$” means that the rule is applied to the ul, rather than the li.clicked as it normally would.

The dollar sign may not end up being the subject indicator and the exact syntax will likely change before the spec is finalized. But regardless of the way it ends up being implemented, the subject selector opens up a whole new realm of CSS possibilities.

Other highlights in CSS 4 include some new pseudo selectors like the :matches() pseudo-class which greatly simplifies the process of writing complex, nested CSS. For example, you could write:

:matches(section, article, aside, nav) h1 {
  font-size: 3em;
}

The :matches() syntax eliminates the need to write out section h1, article h1 and so on. It’s handy for even simple nestings like the example above, but it becomes really powerful when you’re selecting elements that are two or three levels deep. For more info on :matches(), check out our earlier write-up on Mozilla’s :any() selector, which is the basis for :matches().

Also new in CSS 4 is the :local-link pseudo-class which allows you to style links based on domain. For example, you could style all internal links with a simple selector like a:local-link(0). The number refers to the amount of the local URL path to match. For example, if the current address is http://www.mysite.com/some/post/, a:local-link(0) would match anything point to http://www.mysite.com/, a:local-link(1) would match anything pointing to http://www.mysite.com/some/ and so on.

CSS 4 offers some handy pseudo-classes for styling user interface elements based on state, including :enabled, :disabled, :checked and half a dozen others.

For more info on what’s coming in CSS 4, check out the W3C spec (fear not, it’s surprisingly readable as specs go). Also worth a read is W3C WG member David Storey’s blog where he did a nice write-up on CSS 4, including a few things not covered here, like the awesome-sounding “time-dimensional pseudo-classes.”

[CSS pumpkin by mauricesvay/CC/Flickr]

See Also:

File Under: Browsers, CSS

Opera 12 Swaps Scrolls for Swipes With New ‘Opera Reader’

Alice in Wonderland gets the fancy paged-layout treatment in Opera 12

Opera software has released an experimental labs build of Opera 12 with support for what the company is calling Opera Reader.

Håkon Wium Lie, Opera Software’s CTO and creator of cascading stylesheets, previously proposed a new set of CSS tools that transform longer web pages into a more book-like experience, where the reader flips from page to page instead of scrolling down one long screen.

The new Opera Reader feature in Opera 12 is the first implementation of Lie’s proposed Generated Content for Paged Media standard. To try out the new Opera Reader and its book-like browsing experience, head on over to the Opera Labs site and download the latest build of Opera 12.

At its core, the Paged Media standard would offer web developers a way to paginate content — that is, take a single webpage and break it into multiple “pages,” with each page automatically fitted to the screen size of the device you’re using. For example, this article might be two “pages” when viewed on an iPad. However, because the pagination is done with CSS and the HTML remains as it is, there’s no added load time when you flip to the next page. So it’s not a tool that can easily be abused by publishers to mine extra pageviews. It adds all the good things about multi-page layouts and none of the bad.

If you’ve got Opera 12 installed, visit the new Opera Reader demo site where you can see some early experiments including the Alice in Wonderland demo shown above (note that the previous link only works in the latest build of Opera 12).

Keep in mind that this is an early version and so far the demos (and the browser support) are still very limited. Still, if you’d like to dive right in and learn how you can create book-like websites using the new Paged Media layout tools, check out the Opera Labs blog, which walks you through all the new CSS rules and how to use them.

See Also:

File Under: Uncategorized

Adobe Fixes Flash Privacy Panel so Hackers Can’t Check You Out

Adobe has made changes to a page on an Adobe website that controls Flash user’s security settings—or more specifically, to the Flash .SWF file embedded in the page that opens the Flash website privacy settings panel. The changes are intended to prevent a clickjacking attack that uses the file to activate and access users’ webcams and microphones to spy on them.

The change comes a few days after a Stanford student revealed the vulnerability on his website. Feross Aboukhadijeh posted the exploit, along with a demo and a video demonstration, on October 18. He said in a blog post that he had notified Adobe weeks earlier of the problem, reporting the vulnerability to Adobe through the Stanford Security lab.

The exploit demonstrated by Aboukhadijeh uses an elaborate clickjack “game” that overlays the SWF panel over buttons in a transparent iframe. Here’s a screenshot of the panel before Adobe’s changes:

Through a series of clicks, the exploit was able to clear the privacy settings for Flash’s web camera controls and then authorize a new site to activate and access the camera video.The changes did not prompt any pop-ups or other user notifications.

The changes made by Adobe are to the behavior of the widgets in the privacy settings panel. Here’s a screenshot of the new panel, after the exploit was attempted:

While my test of the exploit still added feross.com to my list of sites in the privacy panel, it was only successfully added with an “always ask” setting for establishing a video link.

This article originally appeared on Ars Technica, Wired’s sister site for in-depth technology news.

See Also: