Abstract

Status of this document

Table of contents

1 Introduction

1.1 Is this HTML5?

1.2 Background

1.3 Audience

1.4 Scope

1.5 History

1.6 Design notes

1.6.1 Serializability of script execution

1.6.2 Compliance with other specifications

1.7 HTML vs XHTML

1.8 Structure of this specification

1.8.1 How to read this specification

1.8.2 Typographic conventions

1.9 A quick introduction to HTML

1.10 Conformance requirements for authors

1.10.1 Presentational markup

1.10.2 Syntax errors

1.10.3 Restrictions on content models and on attribute values

1.11 Recommended reading

2 Common infrastructure

2.1 Terminology

2.1.1 Resources

2.1.2 XML

2.1.3 DOM trees

2.1.4 Scripting

2.1.5 Plugins

2.1.6 Character encodings

2.2 Conformance requirements

2.3 Case-sensitivity and string comparison

2.4 Common microsyntaxes

2.4.2 Boolean attributes

2.4.3 Keywords and enumerated attributes

2.4.4 Numbers

2.4.5 Dates and times

2.4.6 Colors

2.4.7 Space-separated tokens

2.4.8 Comma-separated tokens

2.4.9 References

2.4.10 Media queries

2.5 URLs

2.5.1 Terminology

2.5.3 Interfaces for URL manipulation

2.7 Common DOM interfaces

2.7.1 Reflecting content attributes in IDL attributes

2.7.2 Collections

2.7.3 DOMTokenList

2.7.4 DOMSettableTokenList

2.7.6 DOMStringMap

2.7.7 DOM feature strings

2.7.8 Exceptions

2.8 Namespaces

3 Semantics, structure, and APIs of HTML documents

3.1 Documents

3.1.1 Documents in the DOM

3.1.2 Security

3.1.3 Resource metadata management

3.1.4 DOM tree accessors

3.1.5 Creating documents

3.2 Elements

3.2.1 Semantics

3.2.2 Elements in the DOM

3.2.3 Global attributes

3.2.4 Element definitions

3.2.5 Content models

3.2.6 Annotations for assistive technology products (ARIA)

3.3 APIs in HTML documents

3.5 Dynamic markup insertion

3.5.1 Opening the input stream

3.5.2 Closing the input stream

3.5.3 document.write()

3.5.4 document.writeln()

3.5.5 innerHTML

3.5.6 outerHTML

3.5.7 insertAdjacentHTML()

4 The elements of HTML

4.1 The root element

4.1.1 The html element

4.2 Document metadata

4.2.1 The head element

4.2.2 The title element

4.2.3 The base element

4.2.4 The link element

4.2.5 The meta element

4.2.6 The style element

4.2.7 Styling

4.3 Scripting

4.3.1 The script element

4.3.2 The noscript element

4.4 Sections

4.4.1 The body element

4.4.2 The section element

4.4.3 The nav element

4.4.4 The article element

4.4.5 The aside element

4.4.6 The h1, h2, h3, h4, h5, and h6 elements

4.4.7 The hgroup element

4.4.8 The header element

4.4.9 The footer element

4.4.10 The address element

4.4.11 Headings and sections

4.5 Grouping content

4.5.1 The p element

4.5.2 The hr element

4.5.3 The br element

4.5.4 The pre element

4.5.5 The blockquote element

4.5.6 The ol element

4.5.7 The ul element

4.5.8 The li element

4.5.9 The dl element

4.5.10 The dt element

4.5.11 The dd element

4.5.12 The figure element

4.5.13 The figcaption element

4.5.14 The div element

4.6 Text-level semantics

4.6.1 The a element

4.6.2 The em element

4.6.3 The strong element

4.6.4 The small element

4.6.5 The cite element

4.6.6 The q element

4.6.7 The dfn element

4.6.8 The abbr element

4.6.9 The time element

4.6.10 The code element

4.6.11 The var element

4.6.12 The samp element

4.6.13 The kbd element

4.6.14 The sub and sup elements

4.6.15 The i element

4.6.16 The b element

4.6.17 The mark element

4.6.18 The ruby element

4.6.19 The rt element

4.6.20 The rp element

4.6.21 The bdo element

4.6.22 The span element

4.6.23 Usage summary

4.7 Edits

4.7.1 The ins element

4.7.2 The del element

4.7.3 Attributes common to ins and del elements

4.7.4 Edits and paragraphs

4.7.5 Edits and lists

4.8 Embedded content

4.8.1 The img element

4.8.2 The iframe element

4.8.3 The embed element

4.8.4 The object element

4.8.5 The param element

4.8.6 The video element

4.8.7 The audio element

4.8.8 The source element

4.8.9 Media elements

4.8.10 The canvas element

4.8.11 The map element

4.8.12 The area element

4.8.13 Image maps

4.8.14 MathML

4.8.15 SVG

4.8.16 Dimension attributes

4.9 Tabular data

4.9.1 The table element

4.9.2 The caption element

4.9.3 The colgroup element

4.9.4 The col element

4.9.5 The tbody element

4.9.6 The thead element

4.9.7 The tfoot element

4.9.8 The tr element

4.9.9 The td element

4.9.10 The th element

4.9.11 Attributes common to td and th elements

4.9.13 Examples

4.10 Forms

4.10.1 Introduction

4.10.2 Categories

4.10.3 The form element

4.10.4 The fieldset element

4.10.5 The legend element

4.10.6 The label element

4.10.7 The input element

4.10.8 The button element

4.10.9 The select element

4.10.10 The datalist element

4.10.11 The optgroup element

4.10.12 The option element

4.10.13 The textarea element

4.10.14 The keygen element

4.10.15 The output element

4.10.16 The progress element

4.10.17 The meter element

4.10.18 Association of controls and forms

4.10.19 Attributes common to form controls

4.10.20 Constraints

4.10.21 Form submission

4.11 Interactive elements

4.11.1 The details element

4.11.2 The summary element

4.11.3 The command element

4.11.4 The menu element

4.11.5 Commands

4.11.6 The device element

4.12 Links

4.12.1 Hyperlink elements

4.12.3 Link types

4.13 Common idioms without dedicated elements

4.13.1 Tag clouds

4.13.2 Conversations

4.13.3 Footnotes

5 Microdata

5.1 Introduction

5.1.1 Overview

5.1.2 The basic syntax

5.1.3 Typed items

5.1.4 Global identifiers for items

5.1.5 Selecting names when defining vocabularies

5.1.6 Using the microdata DOM API

5.2 Encoding microdata

5.2.1 The microdata model

5.2.2 Items

5.2.3 Names: the itemprop attribute

5.2.4 Values

5.2.5 Associating names with items

5.3 Microdata DOM API

5.4 Microdata vocabularies

5.4.1 vCard

5.4.2 vEvent

5.4.3 Licensing works

6 Loading Web pages

6.1 Browsing contexts

6.1.1 Nested browsing contexts

6.1.2 Auxiliary browsing contexts

6.1.3 Secondary browsing contexts

6.1.6 Browsing context names

6.2 The Window object

6.2.2 APIs for creating and navigating browsing contexts by name

6.2.3 Accessing other browsing contexts

6.2.4 Named access on the Window object

6.2.6 Browser interface elements

6.3 Origin

6.3.1 Relaxing the same-origin restriction

6.4 Session history and navigation

6.4.1 The session history of browsing contexts

6.4.2 The History interface

6.4.3 The Location interface

6.5 Browsing the Web

6.5.9 History traversal

6.5.10 Unloading documents

6.6 Offline Web applications

6.6.1 Introduction

6.6.3 The cache manifest syntax

6.6.7 Expiring application caches

6.6.8 Application cache API

6.6.9 Browser state

7 Web application APIs

7.1 Scripting

7.1.1 Introduction

7.1.6 Events

7.2 Timers

7.3 User prompts

7.3.1 Simple dialogs

7.3.2 Printing

7.3.3 Dialogs implemented using separate documents

7.4 System state and capabilities

7.4.1 Client identification

7.4.2 Custom scheme and content handlers

7.4.3 Manually releasing the storage mutex

8 User interaction

8.1 The hidden attribute

8.2 Activation

8.3 Scrolling elements into view

8.4 Focus

8.4.1 Sequential focus navigation

8.4.3 Document-level focus APIs

8.4.4 Element-level focus APIs

8.5 The accesskey attribute

8.6 The text selection APIs

8.6.1 APIs for the browsing context selection

8.6.2 APIs for the text field selections

8.7 The contenteditable attribute

8.7.2 Making entire documents editable

8.8 Spelling and grammar checking

8.9 Drag and drop

8.9.1 Introduction

8.9.2 The DragEvent and DataTransfer interfaces

8.9.3 Events fired during a drag-and-drop action

8.9.5 The draggable attribute

8.10 Undo history

8.10.2 The UndoManager interface

8.10.5 The UndoManagerEvent interface and the undo and redo events

8.11 Editing APIs

9 Web workers

9.1 Introduction

9.1.1 Scope

9.1.2 Tutorial

9.2 Infrastructure

9.2.1 The global scope

9.2.2 Origins of workers

9.2.3 The event loop

9.2.4 The worker's lifetime

9.2.5 Processing model

9.2.6 Runtime script errors

9.2.7 Creating workers

9.3 APIs available to workers

9.3.1 Importing scripts and libraries

9.3.2 The WorkerNavigator object

9.3.3 APIs defined in other specifications

9.3.4 Interface objects and constructors

9.3.5 Worker locations

10 Communication

10.1 Event definitions

10.2 Server-sent events

10.2.1 Introduction

10.2.2 The EventSource interface

10.2.3 Processing model

10.2.4 Parsing an event stream

10.2.5 Interpreting an event stream

10.2.6 Notes

10.2.7 Connectionless push and other features

10.2.8 Garbage collection

10.2.9 IANA considerations

10.3 Web sockets

10.3.1 Introduction

10.3.2 The WebSocket interface

10.3.3 Feedback from the protocol

10.3.4 The WebSocket protocol

10.4 Cross-document messaging

10.4.1 Introduction

10.4.2 Security

10.4.3 Posting messages

10.5 Channel messaging

10.5.1 Introduction

10.5.2 Message channels

10.5.3 Message ports

11 Web storage

11.1 Introduction

11.2 The API

11.2.1 The Storage interface

11.2.2 The sessionStorage attribute

11.2.3 The localStorage attribute

11.2.4 The storage event

11.2.5 Threads

11.3 Disk space

11.4 Privacy

11.4.1 User tracking

11.4.2 Sensitivity of data

11.5 Security

11.5.1 DNS spoofing attacks

11.5.2 Cross-directory attacks

11.5.3 Implementation risks

12 The HTML syntax

12.1 Writing HTML documents

12.1.1 The DOCTYPE

12.1.2 Elements

12.1.3 Text

12.1.4 Character references

12.1.5 CDATA sections

12.1.6 Comments

12.5 Named character references

13 The XHTML syntax

15 Obsolete features

15.1 Obsolete but conforming features

15.2 Non-conforming features

16 IANA considerations

16.1 text/html

16.2 text/html-sandboxed

16.3 application/xhtml+xml

16.4 text/cache-manifest

16.5 text/ping

16.6 application/microdata+json

16.7 Ping-From

16.8 Ping-To

Index

Elements

Element content categories

Attributes

Interfaces

References

Acknowledgements