Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

HTML5 in the Web browser: Geolocation, JavaScript, and HTML5 extras

Peter Wayner | March 23, 2011
Geolocation, Web Workers, History manipulation, iFrame sandboxes, and other HTML5 specs laying the groundwork for a safer and smarter Web

The main effect is to make navigation a bit more fluid and open to experimentation. The draft of the spec encourages developers to think about "nonlinear" solutions, while advising them to use their newfound power with an eye toward avoiding the confusion it might create. Rewriting history could be vexing to users and even dangerous if exercised in the wrong way, but it could also help clean up much of the ugliness where the history object is too literal.

HTML5 undo history Many of these new features change the browser from an app that displays a distant file in a rectangle to one that allows the user to interact and change objects inside a rectangle. When humans change data, they often make mistakes and want to undo their changes. This is where the undo transaction history and the UndoManager object come in.

A major source of the events that end up in the undo transaction history list will be changes to the input boxes of forms. Giving the JavaScript programmer access to the UndoManager may make it possible to customize this interaction and produce more sophisticated forms.

HTML5 layout enhancements One of the biggest new developments in HTML5, at least in terms of raw features, is the large collection of tags added to mark different sections of the document. Although the original HTML offered tags to mark the beginning and end of significant parts of a document's structure, there weren't many of them beyond the header (<h1> through <h6>) and the paragraph (<p>) tags. The rest were largely devoted to typographic signals such as bold (<b>) and italics (<i>).

Many of the new layout tags recognize what Web developers have been building on their own. There are now tags like <header> and <footer> that tell the browser to put which information at the top and bottom of the pages. Some of these will add confusion. The <section> tag, for instance, operates similarly to the <div> tag, so there will be some who use <div> where others use <section> and vice versa.

Many of the basic elements are supported across all major browsers, but the same can't be said for a number of the elements that seem less obviously useful. At this moment, the <figure> tag for attaching a movable figure to a section of text will work in Firefox 4.0 but not in Safari. The <ruby> tag used to annotate Asian symbols sort of works with Safari but not with Firefox.

 

Previous Page  1  2  3  4  5  6  Next Page 

Sign up for Computerworld eNewsletters.