W3C

HTML 5

A vocabulary and associated APIs for HTML and XHTML

← 9. Rendering and user-agent behaviorTable of contentsIndex →

10. Things that you can't do with this specification because they are better handled using other technologies that are further described herein

This section is non-normative.

There are certain features that are not handled by this specification because a client side markup language is not the right level for them, or because the features exist in other languages that can be integrated into this one. This section covers some of the more common requests.

10.1 Localization

If you wish to create localized versions of an HTML application, the best solution is to preprocess the files on the server, and then use HTTP content negotiation to serve the appropriate language.

10.2 Declarative 2D vector graphics and animation

Embedding vector graphics into XHTML documents is the domain of SVG.

10.3 Declarative 3D scenes

Embedding 3D imagery into XHTML documents is the domain of X3D, or technologies based on X3D that are namespace-aware.

10.4 Timers

This section is expected to be moved to the Window Object specification in due course.

[NoInterfaceObject] interface WindowTimers {
  // timers
  long setTimeout(in TimeoutHandler handler, in long timeout);
  long setTimeout(in TimeoutHandler handler, in long timeout, arguments...);
  long setTimeout(in DOMString code, in long timeout);
  long setTimeout(in DOMString code, in long timeout, in DOMString language);
  void clearTimeout(in long handle);
  long setInterval(in TimeoutHandler handler, in long timeout);
  long setInterval(in TimeoutHandler handler, in long timeout, arguments...);
  long setInterval(in DOMString code, in long timeout);
  long setInterval(in DOMString code, in long timeout, in DOMString language);
  void clearInterval(in long handle);
};

interface TimeoutHandler {
  void handleEvent([Variadic] in any args);
};

The WindowTimers interface must be obtainable from any Window object using binding-specific casting methods.

Actually even better would be to just mix it straight into Window somehow.

The setTimeout and setInterval methods allow authors to schedule timer-based events.

The setTimeout(handler, timeout[, arguments...]) method takes a reference to a TimeoutHandler object and a length of time in milliseconds. It must return a handle to the timeout created, and then asynchronously wait timeout milliseconds and then invoke handleEvent() on the handler object. If any arguments... were provided, they must be passed to the handler as arguments to the handleEvent() function.

Alternatively, setTimeout(code, timeout[, language]) may be used. This variant takes a string instead of a TimeoutHandler object. That string must be parsed using the specified language (defaulting to ECMAScript if the third argument is omitted) and executed in the scope of the browsing context associated with the Window object on which the setTimeout() method was invoked.

Need to define language values.

The setInterval(...) variants must work in the same way as the setTimeout variants except that if timeout is a value greater than zero, the handler or code must be invoked again every timeout milliseconds, not just the once.

The clearTimeout() and clearInterval() methods take one integer (the value returned by setTimeout and setInterval respectively) and must cancel the specified timeout. When called with a value that does not correspond to an active timeout or interval, the methods must return without doing anything.

Timeouts must never fire while another script is executing. (Thus the HTML scripting model is strictly single-threaded and not reentrant.)