The WHATWG Blog

Please leave your sense of logic at the door, thanks!

WHATWG Weekly: translate attribute and other changes to HTML

Since the last WHATWG Weekly, almost a month ago now, over a hundred changes have been committed to the HTML standard. This is the WHATWG Weekly and it will cover those changes so you don’t have to. Also, remember kids, that fancy email regular expression is non-normative.

translate attribute

To aid translators and automated translation HTML sports a translate since revision 6971. By default everything can be translated. You can override that by setting the translate attribute to the "no" value. This can be used for names, computer code, expressions that only make sense in a given language, etc.

Selector and CSS related changes

In revision 6888 the :valid and :invalid pseudo-classes were made applicable to the form element. This way you can determine whether all controls in a given form are correctly filled in.

Revision 6898 made the wbr element less magical. Well, it defined the element fully in terms of CSS rather than using prose.

A new CSS feature was introduced in revision 6935. The @global at-rule allows for selectors to “escape” scoped stylesheets as it were, by letting them apply to the whole document. It will likely be moved out of HTML and into a CSS once a suitable location has been found.

APIs; teehee!

It turns out that clearTimeout() and clearInterval() can be used interchangeably. Revision 6949 makes sure that new implementors make it work that way too.

Per a request from Adrian Bateman revision 6957 added a fourth argument to the window.onerror callback, providing scripts with the script error column position.

Speaking of scripts, in revision 6964 script elements gained two new events. beforescriptexecute which is dispatched before the script executes and can be cancelled to prevent execution altogether. And afterscriptexecute for when script execution has completed.

Revision 6966 implemented a change that allows browsers to not execute alert(), showModalDialog(), and friends during pagehide, beforeunload, and unload events. This can improve the end user experience.

Posted in Weekly Review | 3 Comments »

WHATWG Weekly: Happy New Year!

Happy new year everyone! We made great progress in standardizing the platform in 2011 and plan to continue doing just that with your help. You can join our mailing list to discuss issues with web development or join IRC if you prefer more lively interaction.

I will be taking the remainder of the month off and as nobody has volunteered thus far, WHATWG Weekly is unlikely to be updated in January. All the more reason to follow email and IRC.

Since last time the toBlob() method of the canvas element has been updated in revisions 6879 and 6880 to make sure it honors the same-origin policy (for exposure of image data) and handles the empty grid.

In the land of ECMAScript a proposal was made to avoid versioning by David Herman, which if successful will keep ECMAScript simple and more in line with other languages used on the web.

Posted in Weekly Review | 3 Comments »

WHATWG Weekly: Shadow DOM and more encoding fun!

You might have missed this. Because of this lengthy thread on throwing for atob() space characters will no longer cause the method to throw from revision>6874 onwards. This is the WHATWG Weekly, with some standards related updates just before the world slacks off to feast and watch reindeer on Google Earth.

Shadow DOM

Dimitri Glazkov (from good morning, WHATWG!) published Shadow DOM. A while earlier he also published, together with Dominic Cooney, Web Components Explained. The general idea is to be able to change the behavior and style of elements without changing their intrinsic semantics. A very basic example would be adding a bunch of children to a certain element to have more styling hooks (since this is the shadow DOM the children will not appear as actual children in the normal DOM, but can be styled).

Encoding Standard

Two weeklies ago you were informed about the encoding problem we have on the platform. While HTML already took quite a few steps to tighten up things (discouraging support for UTF-7, UTF-32, etc. defining encoding label matching more accurately), more were needed. Especially when it comes to actually decoding and encoding with legacy encodings. The Encoding Standard aims to tackle these issues and your input is much appreciated. Especially with regards to the implementation details of multi-octet encodings.

Posted in Weekly Review | 2 Comments »

WHATWG Weekly: Stream API and better autocomplete

James Hawkins proposed the intent element in a way that brings back memories of HTML4. Happy to be reminded we are over SGML now. This is the WHATWG Weekly.

Better autocomplete

Overnight a complete proposal for better autocomplete appeared on the WHATWG Wiki, apparently already experimentally implemented in Chrome (prefixed). It proposes a new autocompletetype attribute that takes values such as birthday and cc-number. The advantage over ECML is that changes only need to happen on the frontend. The backend can stay the same.

File API

Adrian Bateman proposed to remove the readAsBinaryString() method from the File API standard. Everyone else seems to be on board so it will likely go away soon. Thanks to ArrayBuffer the method became useless.

He also proposed a new argument for createObjectURL() to indicate the resource will only be used once and can then be garbage collected.

Stream API

Sort of analogous to Blob objects a new Stream object has been proposed by Microsoft and it comes with a bunch of friends too so you can interact with it. Combined with XMLHttpRequest this will allow streaming data to the server or downloading large amounts of data and processing it as it comes in.

Posted in Weekly Review | 1 Comment »

WHATWG Weekly: Encoding woes and WebVTT

If you want to contribute to the WHATWG Blog or Wiki, join IRC (#whatwg on Freenode). We had to shut down user registration unfortunately due to excessive spam. Welcome to another WHATWG Weekly. If it were themed, this would be about Sinterklaas.

Encoding problem

In response to Faruk Ateş' plea for defaulting to UTF-8, David Baron explained the platform encoding problem. The problem is that currently the default encoding varies per user (depending on locale primarily) and sites rely on locale-specific default encodings. Such sites visited by a user using a Dutch computer and a user using a Chinese computer, will render differently. In particular, their byte streams will be decoded using a different encoding. The implication is that the web is less global than it should be. How exactly we are to overcome the platform encoding problem, without everyone explicitly opting in to an encoding using <meta charset=utf-8> (please do so if you are a web developer), is still unclear. Ideas welcome!

WebVTT

Revision 6837 made it possible for WebVTT to be published as a standalone Living Standard. It will primarily be developed by the Web Media Text Tracks Community Group on the public-texttracks@w3.org mailing list. WebVTT is the platform's captioning and subtitle format (for HTML video) and its development can be tracked on Twitter via @webvtt.

Video conferencing

The same revision that let WebVTT be published as standalone document, removed everything related to peer-to-peer connections and video conferencing. The W3C Web Real-Time Communications Working Group forked our work in WebRTC 1.0: Real-time Communication Between Browsers and we (the WHATWG) are okay with them working on it instead.

Miscellaneous

My colleague Karl has been blogging again on the W3C Blog, read his summaries from the weeks of November 14 and November 21.

Yours truly added native JSON support to XMLHttpRequest. Just set responseType to "json" and response will give you a JSON-decoded object once fetching is done.

Posted in Weekly Review | 9 Comments »