From a0cf975f2286185400ecdb9e2c42ffc6728f25bd Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Tue, 16 May 2023 14:20:04 +0800 Subject: [PATCH 1/3] wangyongfei6@huawei.com update parse5 version Signed-off-by: yfwang6 --- .editorconfig | 12 + .eslintignore | 6 + .eslintrc.json | 57 + .gitattributes | 3 + .gitignore | 10 + .gitmodules | 6 + .husky/pre-commit | 4 + .prettierignore | 5 + .prettierrc | 3 + README.OpenSource | 11 - README.en.md | 25 - README.md | 54 +- SECURITY.md | 10 + bench/.eslintrc.js | 9 - bench/.eslintrc.json | 6 + bench/memory/named-entity-data.js | 15 - bench/memory/sax-parser.js | 57 +- bench/package.json | 9 +- bench/perf/index.js | 116 +- bundle.json | 30 - docs/list-of-packages.md | 1 - docs/version-history.md | 231 +- lerna.json | 5 - package-lock.json | 15398 ++++++++++------ package.json | 82 +- .../parse5-html-rewriting-stream/README.md | 4 +- .../docs/index.md | 259 - .../parse5-html-rewriting-stream/lib/index.js | 92 - .../parse5-html-rewriting-stream/lib/index.ts | 177 + .../parse5-html-rewriting-stream/package.json | 17 +- .../test/rewriting-stream.test.js | 272 - .../test/rewriting-stream.test.ts | 347 + .../tsconfig.json | 10 + .../parse5-htmlparser2-tree-adapter/README.md | 4 +- .../docs/comment-node.md | 130 - .../docs/document-fragment.md | 140 - .../docs/document-type.md | 140 - .../docs/document.md | 150 - .../docs/element.md | 212 - .../docs/index.md | 22 - .../docs/text-node.md | 130 - .../lib/index.js | 348 - .../lib/index.ts | 292 + .../package.json | 21 +- .../tsconfig.json | 9 + packages/parse5-parser-stream/README.md | 5 +- packages/parse5-parser-stream/docs/index.md | 122 - packages/parse5-parser-stream/lib/index.js | 83 - packages/parse5-parser-stream/lib/index.ts | 147 + packages/parse5-parser-stream/package.json | 14 +- .../parse5-parser-stream/test/.eslintrc.js | 6 - ...ion-info.test.js => location-info.test.ts} | 24 +- .../test/parser-stream.test.js | 22 - .../test/parser-stream.test.ts | 42 + .../test/scripting.test.js | 89 - .../test/scripting.test.ts | 78 + .../test/utils/parse-chunked.js | 24 - .../test/utils/parse-chunked.ts | 32 + packages/parse5-parser-stream/tsconfig.json | 9 + .../README.md | 5 +- .../docs/index.md | 63 - .../lib/index.js | 21 - .../lib/index.ts | 40 + .../package.json | 16 +- ...s => plain-text-conversion-stream.test.ts} | 32 +- .../tsconfig.json | 9 + packages/parse5-sax-parser/README.md | 4 +- packages/parse5-sax-parser/docs/index.md | 198 - .../docs/sax-parser-options.md | 20 - .../parse5-sax-parser/docs/tokens/comment.md | 30 - .../parse5-sax-parser/docs/tokens/doctype.md | 51 - .../parse5-sax-parser/docs/tokens/end-tag.md | 30 - .../docs/tokens/start-tag.md | 49 - .../parse5-sax-parser/docs/tokens/text.md | 30 - .../parse5-sax-parser/lib/dev-null-stream.js | 11 - .../parse5-sax-parser/lib/dev-null-stream.ts | 7 + packages/parse5-sax-parser/lib/index.js | 166 - packages/parse5-sax-parser/lib/index.ts | 294 + .../lib/parser-feedback-simulator.js | 159 - .../lib/parser-feedback-simulator.ts | 221 + packages/parse5-sax-parser/package.json | 14 +- .../test/location-info.test.js | 48 - .../test/location-info.test.ts | 49 + .../test/parser-feedback-simulator.test.js | 16 - .../test/parser-feedback-simulator.test.ts | 10 + .../parse5-sax-parser/test/sax-parser.test.js | 151 - .../parse5-sax-parser/test/sax-parser.test.ts | 140 + packages/parse5-sax-parser/tsconfig.json | 9 + packages/parse5-serializer-stream/LICENSE | 19 - packages/parse5-serializer-stream/README.md | 34 - .../parse5-serializer-stream/docs/index.md | 50 - .../parse5-serializer-stream/lib/index.js | 29 - .../parse5-serializer-stream/package.json | 28 - .../test/serializer-stream.test.js | 16 - packages/parse5/README.md | 4 +- packages/parse5/docs/index.md | 111 - .../parse5/docs/options/parser-options.md | 48 - .../parse5/docs/options/serializer-options.md | 22 - .../source-code-location/element-location.md | 100 - .../docs/source-code-location/end-location.md | 48 - .../docs/source-code-location/location.md | 69 - .../start-tag-location.md | 79 - .../docs/tree-adapter/default/attribute.md | 50 - .../docs/tree-adapter/default/comment-node.md | 49 - .../tree-adapter/default/document-fragment.md | 30 - .../tree-adapter/default/document-type.md | 50 - .../docs/tree-adapter/default/document.md | 40 - .../docs/tree-adapter/default/element.md | 80 - .../tree-adapter/default/interface-list.md | 12 - .../docs/tree-adapter/default/text-node.md | 51 - .../parse5/docs/tree-adapter/interface.md | 608 - .../lib/common/{doctype.js => doctype.ts} | 77 +- packages/parse5/lib/common/error-codes.js | 65 - packages/parse5/lib/common/error-codes.ts | 70 + packages/parse5/lib/common/foreign-content.js | 265 - packages/parse5/lib/common/foreign-content.ts | 256 + packages/parse5/lib/common/html.js | 272 - packages/parse5/lib/common/html.ts | 570 + packages/parse5/lib/common/token.ts | 104 + packages/parse5/lib/common/unicode.js | 109 - packages/parse5/lib/common/unicode.ts | 77 + .../extensions/error-reporting/mixin-base.js | 43 - .../error-reporting/parser-mixin.js | 52 - .../error-reporting/preprocessor-mixin.js | 24 - .../error-reporting/tokenizer-mixin.js | 17 - .../location-info/open-element-stack-mixin.js | 35 - .../extensions/location-info/parser-mixin.js | 223 - .../location-info/tokenizer-mixin.js | 146 - .../position-tracking/preprocessor-mixin.js | 64 - packages/parse5/lib/index.js | 29 - packages/parse5/lib/index.ts | 95 + .../lib/parser/formatting-element-list.js | 181 - .../parser/formatting-element-list.test.ts} | 181 +- .../lib/parser/formatting-element-list.ts | 154 + packages/parse5/lib/parser/index.js | 3034 --- packages/parse5/lib/parser/index.test.ts | 109 + packages/parse5/lib/parser/index.ts | 3495 ++++ .../parser/open-element-stack.test.ts} | 557 +- ...element-stack.js => open-element-stack.ts} | 436 +- .../lib/parser/parser-location-info.test.ts | 287 + packages/parse5/lib/serializer/index.js | 176 - packages/parse5/lib/serializer/index.test.ts | 59 + packages/parse5/lib/serializer/index.ts | 230 + packages/parse5/lib/tokenizer/index.js | 2196 --- packages/parse5/lib/tokenizer/index.test.ts | 9 + packages/parse5/lib/tokenizer/index.ts | 3126 ++++ .../parse5/lib/tokenizer/named-entity-data.js | 5 - .../{preprocessor.js => preprocessor.ts} | 207 +- .../tokenizer-location-info.test.ts} | 162 +- packages/parse5/lib/tree-adapters/default.js | 221 - packages/parse5/lib/tree-adapters/default.ts | 324 + .../parse5/lib/tree-adapters/interface.ts | 296 + packages/parse5/lib/utils/merge-options.js | 13 - packages/parse5/lib/utils/mixin.js | 39 - packages/parse5/package.json | 21 +- .../parse5/test/location-info-parser.test.js | 182 - packages/parse5/test/parser.test.js | 91 - packages/parse5/test/serializer.test.js | 27 - packages/parse5/test/tokenizer.test.js | 28 - packages/parse5/tsconfig.json | 9 + scripts/.eslintrc.js | 6 - scripts/generate-named-entity-data/README.md | 92 - .../array-mapped-radix-tree.js | 100 - scripts/generate-named-entity-data/index.js | 25 - .../generate-named-entity-data/radix-tree.js | 195 - .../generate-named-entity-data/tree-node.js | 37 - .../generate-parser-feedback-test/index.js | 91 - .../generate-parser-feedback-test/index.ts | 136 + test/.eslintrc.js | 6 - test/data/location-info/cern/data.html | 524 +- test/data/location-info/dx/data.html | 3284 ++-- .../location-info/github-parse5/data.html | 1846 +- test/data/location-info/whatwg-html/data.html | 2608 +-- test/data/location-info/wiki-42/data.html | 6280 +++---- test/data/parser-feedback/adoption01.test | 62 + test/data/parser-feedback/adoption02.test | 2 + test/data/parser-feedback/blocks.test | 1852 ++ test/data/parser-feedback/comments01.test | 44 + test/data/parser-feedback/doctype01.test | 57 +- test/data/parser-feedback/domjs-unsafe.test | 57 +- test/data/parser-feedback/entities01.test | 95 + test/data/parser-feedback/entities02.test | 26 + .../parser-feedback/foreign-fragment.test | 1306 +- test/data/parser-feedback/html5test-com.test | 24 + test/data/parser-feedback/inbody01.test | 4 + test/data/parser-feedback/isindex.test | 4 + test/data/parser-feedback/main-element.test | 3 + test/data/parser-feedback/math.test | 226 +- .../parser-feedback/menuitem-element.test | 20 + .../namespace-sensitivity.test | 1 + test/data/parser-feedback/noscript01.test | 453 +- ...ending-spec-changes-plain-text-unsafe.test | 1 + .../parser-feedback/pending-spec-changes.test | 3 + .../parser-feedback/plain-text-unsafe.test | 43 +- test/data/parser-feedback/ruby.test | 21 + test/data/parser-feedback/scriptdata01.test | 27 + test/data/parser-feedback/search-element.test | 129 + test/data/parser-feedback/svg.test | 227 + test/data/parser-feedback/tables01.test | 17 + test/data/parser-feedback/template.test | 153 + test/data/parser-feedback/tests1.test | 114 + test/data/parser-feedback/tests10.test | 54 + test/data/parser-feedback/tests11.test | 13 + test/data/parser-feedback/tests12.test | 2 + test/data/parser-feedback/tests14.test | 7 + test/data/parser-feedback/tests15.test | 18 +- test/data/parser-feedback/tests16.test | 394 +- test/data/parser-feedback/tests17.test | 13 + test/data/parser-feedback/tests18.test | 372 + test/data/parser-feedback/tests19.test | 105 + test/data/parser-feedback/tests2.test | 78 +- test/data/parser-feedback/tests20.test | 624 + test/data/parser-feedback/tests21.test | 25 + test/data/parser-feedback/tests22.test | 5 + test/data/parser-feedback/tests23.test | 5 + test/data/parser-feedback/tests24.test | 8 + test/data/parser-feedback/tests25.test | 173 + test/data/parser-feedback/tests26.test | 104 +- test/data/parser-feedback/tests3.test | 64 +- test/data/parser-feedback/tests4.test | 124 +- test/data/parser-feedback/tests5.test | 44 + test/data/parser-feedback/tests6.test | 326 +- test/data/parser-feedback/tests7.test | 58 +- test/data/parser-feedback/tests8.test | 43 +- test/data/parser-feedback/tests9.test | 27 + .../parser-feedback/tests_innerHTML_1.test | 1550 +- test/data/parser-feedback/tricky01.test | 37 +- test/data/parser-feedback/webkit01.test | 106 +- test/data/parser-feedback/webkit02.test | 242 + test/data/serialization/tests.json | 11 + .../gh40_form_in_template.dat | 13 - test/package.json | 6 + test/tsconfig.json | 12 + test/utils/common.js | 146 - test/utils/common.ts | 133 + ...=> generate-location-info-parser-tests.ts} | 163 +- test/utils/generate-parsing-tests.js | 116 - test/utils/generate-parsing-tests.ts | 163 + test/utils/generate-serializer-tests.js | 23 - test/utils/generate-serializer-tests.ts | 34 + test/utils/generate-tokenization-tests.js | 216 - test/utils/generate-tokenization-tests.ts | 233 + ...t-data.js => load-sax-parser-test-data.ts} | 27 +- .../{parse-dat-file.js => parse-dat-file.ts} | 49 +- ...mat.js => serialize-to-dat-file-format.ts} | 46 +- tsconfig.json | 30 + 246 files changed, 39413 insertions(+), 28436 deletions(-) create mode 100644 .editorconfig create mode 100644 .eslintignore create mode 100644 .eslintrc.json create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 .husky/pre-commit create mode 100644 .prettierignore create mode 100644 .prettierrc delete mode 100644 README.OpenSource delete mode 100644 README.en.md create mode 100644 SECURITY.md delete mode 100644 bench/.eslintrc.js create mode 100644 bench/.eslintrc.json delete mode 100644 bench/memory/named-entity-data.js delete mode 100644 bundle.json delete mode 100644 lerna.json delete mode 100644 packages/parse5-html-rewriting-stream/docs/index.md delete mode 100644 packages/parse5-html-rewriting-stream/lib/index.js create mode 100644 packages/parse5-html-rewriting-stream/lib/index.ts delete mode 100644 packages/parse5-html-rewriting-stream/test/rewriting-stream.test.js create mode 100644 packages/parse5-html-rewriting-stream/test/rewriting-stream.test.ts create mode 100644 packages/parse5-html-rewriting-stream/tsconfig.json delete mode 100644 packages/parse5-htmlparser2-tree-adapter/docs/comment-node.md delete mode 100644 packages/parse5-htmlparser2-tree-adapter/docs/document-fragment.md delete mode 100644 packages/parse5-htmlparser2-tree-adapter/docs/document-type.md delete mode 100644 packages/parse5-htmlparser2-tree-adapter/docs/document.md delete mode 100644 packages/parse5-htmlparser2-tree-adapter/docs/element.md delete mode 100644 packages/parse5-htmlparser2-tree-adapter/docs/index.md delete mode 100644 packages/parse5-htmlparser2-tree-adapter/docs/text-node.md delete mode 100644 packages/parse5-htmlparser2-tree-adapter/lib/index.js create mode 100644 packages/parse5-htmlparser2-tree-adapter/lib/index.ts create mode 100644 packages/parse5-htmlparser2-tree-adapter/tsconfig.json delete mode 100644 packages/parse5-parser-stream/docs/index.md delete mode 100644 packages/parse5-parser-stream/lib/index.js create mode 100644 packages/parse5-parser-stream/lib/index.ts delete mode 100644 packages/parse5-parser-stream/test/.eslintrc.js rename packages/parse5-parser-stream/test/{location-info.test.js => location-info.test.ts} (45%) delete mode 100644 packages/parse5-parser-stream/test/parser-stream.test.js create mode 100644 packages/parse5-parser-stream/test/parser-stream.test.ts delete mode 100644 packages/parse5-parser-stream/test/scripting.test.js create mode 100644 packages/parse5-parser-stream/test/scripting.test.ts delete mode 100644 packages/parse5-parser-stream/test/utils/parse-chunked.js create mode 100644 packages/parse5-parser-stream/test/utils/parse-chunked.ts create mode 100644 packages/parse5-parser-stream/tsconfig.json delete mode 100644 packages/parse5-plain-text-conversion-stream/docs/index.md delete mode 100644 packages/parse5-plain-text-conversion-stream/lib/index.js create mode 100644 packages/parse5-plain-text-conversion-stream/lib/index.ts rename packages/parse5-plain-text-conversion-stream/test/{plain-text-conversion-stream.test.js => plain-text-conversion-stream.test.ts} (35%) create mode 100644 packages/parse5-plain-text-conversion-stream/tsconfig.json delete mode 100644 packages/parse5-sax-parser/docs/index.md delete mode 100644 packages/parse5-sax-parser/docs/sax-parser-options.md delete mode 100644 packages/parse5-sax-parser/docs/tokens/comment.md delete mode 100644 packages/parse5-sax-parser/docs/tokens/doctype.md delete mode 100644 packages/parse5-sax-parser/docs/tokens/end-tag.md delete mode 100644 packages/parse5-sax-parser/docs/tokens/start-tag.md delete mode 100644 packages/parse5-sax-parser/docs/tokens/text.md delete mode 100644 packages/parse5-sax-parser/lib/dev-null-stream.js create mode 100644 packages/parse5-sax-parser/lib/dev-null-stream.ts delete mode 100644 packages/parse5-sax-parser/lib/index.js create mode 100644 packages/parse5-sax-parser/lib/index.ts delete mode 100644 packages/parse5-sax-parser/lib/parser-feedback-simulator.js create mode 100644 packages/parse5-sax-parser/lib/parser-feedback-simulator.ts delete mode 100644 packages/parse5-sax-parser/test/location-info.test.js create mode 100644 packages/parse5-sax-parser/test/location-info.test.ts delete mode 100644 packages/parse5-sax-parser/test/parser-feedback-simulator.test.js create mode 100644 packages/parse5-sax-parser/test/parser-feedback-simulator.test.ts delete mode 100644 packages/parse5-sax-parser/test/sax-parser.test.js create mode 100644 packages/parse5-sax-parser/test/sax-parser.test.ts create mode 100644 packages/parse5-sax-parser/tsconfig.json delete mode 100644 packages/parse5-serializer-stream/LICENSE delete mode 100644 packages/parse5-serializer-stream/README.md delete mode 100644 packages/parse5-serializer-stream/docs/index.md delete mode 100644 packages/parse5-serializer-stream/lib/index.js delete mode 100644 packages/parse5-serializer-stream/package.json delete mode 100644 packages/parse5-serializer-stream/test/serializer-stream.test.js delete mode 100644 packages/parse5/docs/index.md delete mode 100644 packages/parse5/docs/options/parser-options.md delete mode 100644 packages/parse5/docs/options/serializer-options.md delete mode 100644 packages/parse5/docs/source-code-location/element-location.md delete mode 100644 packages/parse5/docs/source-code-location/end-location.md delete mode 100644 packages/parse5/docs/source-code-location/location.md delete mode 100644 packages/parse5/docs/source-code-location/start-tag-location.md delete mode 100644 packages/parse5/docs/tree-adapter/default/attribute.md delete mode 100644 packages/parse5/docs/tree-adapter/default/comment-node.md delete mode 100644 packages/parse5/docs/tree-adapter/default/document-fragment.md delete mode 100644 packages/parse5/docs/tree-adapter/default/document-type.md delete mode 100644 packages/parse5/docs/tree-adapter/default/document.md delete mode 100644 packages/parse5/docs/tree-adapter/default/element.md delete mode 100644 packages/parse5/docs/tree-adapter/default/interface-list.md delete mode 100644 packages/parse5/docs/tree-adapter/default/text-node.md delete mode 100644 packages/parse5/docs/tree-adapter/interface.md rename packages/parse5/lib/common/{doctype.js => doctype.ts} (73%) delete mode 100644 packages/parse5/lib/common/error-codes.js create mode 100644 packages/parse5/lib/common/error-codes.ts delete mode 100644 packages/parse5/lib/common/foreign-content.js create mode 100644 packages/parse5/lib/common/foreign-content.ts delete mode 100644 packages/parse5/lib/common/html.js create mode 100644 packages/parse5/lib/common/html.ts create mode 100644 packages/parse5/lib/common/token.ts delete mode 100644 packages/parse5/lib/common/unicode.js create mode 100644 packages/parse5/lib/common/unicode.ts delete mode 100644 packages/parse5/lib/extensions/error-reporting/mixin-base.js delete mode 100644 packages/parse5/lib/extensions/error-reporting/parser-mixin.js delete mode 100644 packages/parse5/lib/extensions/error-reporting/preprocessor-mixin.js delete mode 100644 packages/parse5/lib/extensions/error-reporting/tokenizer-mixin.js delete mode 100644 packages/parse5/lib/extensions/location-info/open-element-stack-mixin.js delete mode 100644 packages/parse5/lib/extensions/location-info/parser-mixin.js delete mode 100644 packages/parse5/lib/extensions/location-info/tokenizer-mixin.js delete mode 100644 packages/parse5/lib/extensions/position-tracking/preprocessor-mixin.js delete mode 100644 packages/parse5/lib/index.js create mode 100644 packages/parse5/lib/index.ts delete mode 100644 packages/parse5/lib/parser/formatting-element-list.js rename packages/parse5/{test/formatting-element-list.test.js => lib/parser/formatting-element-list.test.ts} (45%) create mode 100644 packages/parse5/lib/parser/formatting-element-list.ts delete mode 100644 packages/parse5/lib/parser/index.js create mode 100644 packages/parse5/lib/parser/index.test.ts create mode 100644 packages/parse5/lib/parser/index.ts rename packages/parse5/{test/open-element-stack.test.js => lib/parser/open-element-stack.test.ts} (35%) rename packages/parse5/lib/parser/{open-element-stack.js => open-element-stack.ts} (32%) create mode 100644 packages/parse5/lib/parser/parser-location-info.test.ts delete mode 100644 packages/parse5/lib/serializer/index.js create mode 100644 packages/parse5/lib/serializer/index.test.ts create mode 100644 packages/parse5/lib/serializer/index.ts delete mode 100644 packages/parse5/lib/tokenizer/index.js create mode 100644 packages/parse5/lib/tokenizer/index.test.ts create mode 100644 packages/parse5/lib/tokenizer/index.ts delete mode 100644 packages/parse5/lib/tokenizer/named-entity-data.js rename packages/parse5/lib/tokenizer/{preprocessor.js => preprocessor.ts} (34%) rename packages/parse5/{test/location-info-tokenizer.test.js => lib/tokenizer/tokenizer-location-info.test.ts} (35%) delete mode 100644 packages/parse5/lib/tree-adapters/default.js create mode 100644 packages/parse5/lib/tree-adapters/default.ts create mode 100644 packages/parse5/lib/tree-adapters/interface.ts delete mode 100644 packages/parse5/lib/utils/merge-options.js delete mode 100644 packages/parse5/lib/utils/mixin.js delete mode 100644 packages/parse5/test/location-info-parser.test.js delete mode 100644 packages/parse5/test/parser.test.js delete mode 100644 packages/parse5/test/serializer.test.js delete mode 100644 packages/parse5/test/tokenizer.test.js create mode 100644 packages/parse5/tsconfig.json delete mode 100644 scripts/.eslintrc.js delete mode 100644 scripts/generate-named-entity-data/README.md delete mode 100644 scripts/generate-named-entity-data/array-mapped-radix-tree.js delete mode 100644 scripts/generate-named-entity-data/index.js delete mode 100644 scripts/generate-named-entity-data/radix-tree.js delete mode 100644 scripts/generate-named-entity-data/tree-node.js delete mode 100644 scripts/generate-parser-feedback-test/index.js create mode 100644 scripts/generate-parser-feedback-test/index.ts delete mode 100644 test/.eslintrc.js create mode 100644 test/data/parser-feedback/blocks.test create mode 100644 test/data/parser-feedback/search-element.test create mode 100644 test/data/parser-feedback/svg.test delete mode 100644 test/data/tree-construction-regression/gh40_form_in_template.dat create mode 100644 test/package.json create mode 100644 test/tsconfig.json delete mode 100644 test/utils/common.js create mode 100644 test/utils/common.ts rename test/utils/{generate-location-info-parser-tests.js => generate-location-info-parser-tests.ts} (31%) delete mode 100644 test/utils/generate-parsing-tests.js create mode 100644 test/utils/generate-parsing-tests.ts delete mode 100644 test/utils/generate-serializer-tests.js create mode 100644 test/utils/generate-serializer-tests.ts delete mode 100644 test/utils/generate-tokenization-tests.js create mode 100644 test/utils/generate-tokenization-tests.ts rename test/utils/{load-sax-parser-test-data.js => load-sax-parser-test-data.ts} (31%) rename test/utils/{parse-dat-file.js => parse-dat-file.ts} (38%) rename test/utils/{serialize-to-dat-file-format.js => serialize-to-dat-file-format.ts} (65%) create mode 100644 tsconfig.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..eefcf89 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 4 diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..91e0bf6 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +test/data/html5lib-tests +test/data/html5lib-tests-fork +packages/*/dist/ +test/dist/ +docs/build/ +node_modules diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..e3d430e --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,57 @@ +{ + "env": { + "es2020": true, + "node": true, + "jest": true + }, + "extends": ["eslint:recommended", "prettier", "plugin:unicorn/recommended"], + "rules": { + "no-console": "error", + "curly": ["error", "all"], + "prefer-arrow-callback": "error", + "one-var": ["error", "never"], + "no-var": "error", + "prefer-const": "error", + "object-shorthand": "error", + "prefer-destructuring": [ + "error", + { + "object": true, + "array": false + } + ], + "prefer-template": "error", + "arrow-body-style": ["error", "as-needed"], + + "unicorn/no-null": "off", + "unicorn/prevent-abbreviations": "off", + "unicorn/prefer-string-slice": "off", + "unicorn/prefer-code-point": "off", + "unicorn/no-array-push-push": "off", + "unicorn/no-for-loop": "off", + "unicorn/consistent-destructuring": "off", + "unicorn/prefer-switch": ["error", { "emptyDefaultCase": "do-nothing-comment" }] + }, + "parserOptions": { + "sourceType": "module" + }, + "overrides": [ + { + "files": "*.ts", + "extends": [ + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "prettier" + ], + "rules": { + "@typescript-eslint/no-non-null-assertion": "warn", + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/explicit-function-return-type": "error", + "@typescript-eslint/no-duplicate-imports": "error", + "@typescript-eslint/consistent-type-imports": "error", + + "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }] + } + } + ] +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..09948ef --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Exclude the HTML files from GitHub's language statistics +# https://github.com/github/linguist#using-gitattributes +test/data/* linguist-vendored diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..faaca97 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +.DS_Store +.idea +.vscode +node_modules +docs/build +docs/05_api_reference.md +packages/*/dist/ +test/dist/ +.DS_Store +tsconfig.tsbuildinfo diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..56b0a57 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "html5lib-tests-fork"] + path = test/data/html5lib-tests-fork + url = https://github.com/HTMLParseErrorWG/html5lib-tests +[submodule "html5lib-tests"] + path = test/data/html5lib-tests + url = https://github.com/html5lib/html5lib-tests.git diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..d0612ad --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run pre-commit diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..4aeb576 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +packages/*/dist/ +test/dist/ +docs +test/data/html5lib-tests +test/data/html5lib-tests-fork \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..ca3f154 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +printWidth: 120 +tabWidth: 4 +singleQuote: true diff --git a/README.OpenSource b/README.OpenSource deleted file mode 100644 index dd3ed57..0000000 --- a/README.OpenSource +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "Name": "parse5", - "License": "MIT", - "License File": "NOTICE", - "Version Number": " 6.0.1", - "Owner": "sunbingxin@huawei.com", - "Upstream URL": "https://github.com/inikulin/parse5.git", - "Description": "HTML parser and serializer." - } -] diff --git a/README.en.md b/README.en.md deleted file mode 100644 index ff43d00..0000000 --- a/README.en.md +++ /dev/null @@ -1,25 +0,0 @@ -# third_party_parse5 - -#### Description -HTML parser and serializer. - -#### License -Copyright (c) 2013-2019 Ivan Nikulin (ifaaan@gmail.com, https://github.com/inikulin) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 77f07f3..dd36002 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,39 @@ -# third_party_parse5 +

+ + parse5 + +

-#### 介绍 -HTML parser and serializer. +

+HTML parsing/serialization toolset for Node.js. WHATWG HTML Living Standard (aka HTML5)-compliant. +

-#### License -Copyright (c) 2013-2019 Ivan Nikulin (ifaaan@gmail.com, https://github.com/inikulin) +

+ Build Status + NPM Version + Downloads + Downloads total +

-Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +

+parse5 provides nearly everything you may need when dealing with HTML. It's the fastest spec-compliant HTML parser +for Node to date. It parses HTML the way the latest version of your browser does. It has proven itself reliable in such projects +as jsdom, Angular, +Lit, Cheerio, +rehype and many more. +

-The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +--- -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +

+ List of parse5 toolset packages +

+ +

+ Online playground +

+ +

+ Changelog +

+

diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..07eb929 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,10 @@ +# Security Policy + +## Supported Versions + +Only the current release is supported. Please make sure to update to the latest release. + +## Reporting a Vulnerability + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. diff --git a/bench/.eslintrc.js b/bench/.eslintrc.js deleted file mode 100644 index 401a667..0000000 --- a/bench/.eslintrc.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - extends: ['../.eslintrc.js'], - rules: { - 'no-console': 'off' - }, - parserOptions: { - ecmaVersion: 8 - } -}; diff --git a/bench/.eslintrc.json b/bench/.eslintrc.json new file mode 100644 index 0000000..1cb404c --- /dev/null +++ b/bench/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": ["../.eslintrc.json"], + "rules": { + "no-console": "off" + } +} diff --git a/bench/memory/named-entity-data.js b/bench/memory/named-entity-data.js deleted file mode 100644 index bca60f0..0000000 --- a/bench/memory/named-entity-data.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -const format = require('human-format'); - -main(); - -function main() { - const before = process.memoryUsage().rss; - - require('../../packages/parse5/lib/tokenizer/named-entity-data'); - - const after = process.memoryUsage().rss; - - console.log('Initial memory consumption: ', format(after - before, { unit: 'B' })); -} diff --git a/bench/memory/sax-parser.js b/bench/memory/sax-parser.js index d1e893c..0460035 100644 --- a/bench/memory/sax-parser.js +++ b/bench/memory/sax-parser.js @@ -1,43 +1,36 @@ -'use strict'; - -const fs = require('fs'); -const format = require('human-format'); -const promisifyEvent = require('promisify-event'); -const memwatch = require('node-memwatch'); -const SAXParser = require('../../packages/parse5-sax-parser/lib'); +import { readFile } from 'node:fs/promises'; +import format from 'human-format'; +import memwatch from '@airbnb/node-memwatch'; +import { SAXParser } from '../../packages/parse5-sax-parser/dist/index.js'; +import { finished } from 'parse5-test-utils/dist/common.js'; main(); async function main() { - let parsedDataSize = 0; - let maxMemUsage = 0; - let startDate = null; - let endDate = null; const heapDiffMeasurement = new memwatch.HeapDiff(); - let heapDiff = null; - memwatch.on('stats', stats => { - maxMemUsage = Math.max(maxMemUsage, stats['current_base']); + let maxMemUsage = 0; + + memwatch.on('stats', (stats) => { + maxMemUsage = Math.max(maxMemUsage, stats.used_heap_size); }); - startDate = new Date(); + const statsPromise = new Promise((resolve) => memwatch.once('stats', resolve)); - const parserPromise = parse().then(dataSize => { - parsedDataSize = dataSize; - endDate = new Date(); - heapDiff = heapDiffMeasurement.end(); - }); + const startDate = new Date(); + + const parsedDataSize = await parse(); + const endDate = new Date(); + const heapDiff = heapDiffMeasurement.end(); - await Promise.all([ - parserPromise, - promisifyEvent(memwatch, 'stats') // NOTE: we need at least one `stats` result - ]); + // NOTE: we need at least one `stats` result to get maxMemUsage + await statsPromise; printResults(parsedDataSize, startDate, endDate, heapDiff, maxMemUsage); } async function parse() { - const data = fs.readFileSync('../test/data/huge-page/huge-page.html', 'utf8'); + const data = await readFile(new URL('../../test/data/huge-page/huge-page.html', import.meta.url), 'utf8'); let parsedDataSize = 0; const stream = new SAXParser(); @@ -48,7 +41,7 @@ async function parse() { stream.end(); - await promisifyEvent(stream, 'finish'); + await finished(stream); return parsedDataSize; } @@ -57,16 +50,16 @@ function getDuration(startDate, endDate) { const scale = new format.Scale({ seconds: 1, minutes: 60, - hours: 3600 + hours: 3600, }); - return format((endDate - startDate) / 1000, { scale: scale }); + return format((endDate - startDate) / 1000, { scale }); } function printResults(parsedDataSize, startDate, endDate, heapDiff, maxMemUsage) { console.log('Input data size:', format(parsedDataSize, { unit: 'B' })); - console.log('Duration: ', getDuration(startDate, endDate)); - console.log('Memory before: ', heapDiff.before.size); - console.log('Memory after: ', heapDiff.after.size); - console.log('Memory max: ', format(maxMemUsage, { unit: 'B' })); + console.log('Duration:', getDuration(startDate, endDate)); + console.log('Memory before:', heapDiff.before.size); + console.log('Memory after:', heapDiff.after.size); + console.log('Memory max:', format(maxMemUsage, { unit: 'B' })); } diff --git a/bench/package.json b/bench/package.json index dbb9794..cd8b234 100644 --- a/bench/package.json +++ b/bench/package.json @@ -1,14 +1,15 @@ { "name": "parse5-benchmarks", + "private": "true", + "type": "module", "version": "1.0.0", "description": "parse5 regression benchmarks", "author": "Ivan Nikulin ", "license": "MIT", "dependencies": { "benchmark": "^2.1.4", - "human-format": "^0.7.0", - "node-memwatch": "^1.0.1", - "parse5": "*", - "promisify-event": "^1.0.0" + "human-format": "^1.0.0", + "@airbnb/node-memwatch": "^2.0.0", + "parse5": "npm:parse5" } } diff --git a/bench/perf/index.js b/bench/perf/index.js index ae87e04..2306eab 100644 --- a/bench/perf/index.js +++ b/bench/perf/index.js @@ -1,37 +1,38 @@ -'use strict'; - -const { join } = require('path'); -const { readFileSync, createReadStream, readdirSync } = require('fs'); -const Benchmark = require('benchmark'); -const { loadTreeConstructionTestData } = require('../../test/utils/generate-parsing-tests'); -const loadSAXParserTestData = require('../../test/utils/load-sax-parser-test-data'); -const { treeAdapters, WritableStreamStub } = require('../../test/utils/common'); +import { readFileSync, createReadStream, readdirSync } from 'node:fs'; +import Benchmark from 'benchmark'; +import { loadTreeConstructionTestData } from 'parse5-test-utils/dist/generate-parsing-tests.js'; +import { loadSAXParserTestData } from 'parse5-test-utils/dist/load-sax-parser-test-data.js'; +import { treeAdapters, WritableStreamStub, finished } from 'parse5-test-utils/dist/common.js'; +import * as parse5 from '../../packages/parse5/dist/index.js'; +import { ParserStream as parse5Stream } from '../../packages/parse5-parser-stream/dist/index.js'; +import * as parse5Upstream from 'parse5'; + +const hugePagePath = new URL('../../test/data/huge-page/huge-page.html', import.meta.url); +const treeConstructionPath = new URL('../../test/data/html5lib-tests/tree-construction', import.meta.url); +const saxPath = new URL('../../test/data/sax/', import.meta.url); //HACK: https://github.com/bestiejs/benchmark.js/issues/51 /* global workingCopy, WorkingCopyParserStream, upstreamParser, hugePage, microTests, runMicro, runPages, files */ -global.workingCopy = require('../../packages/parse5/lib'); -global.WorkingCopyParserStream = require('../../packages/parse5-parser-stream/lib'); -global.upstreamParser = require('parse5'); +global.workingCopy = parse5; +global.WorkingCopyParserStream = parse5Stream; +global.upstreamParser = parse5Upstream; // Huge page data -global.hugePage = readFileSync(join(__dirname, '../../test/data/huge-page/huge-page.html')).toString(); +global.hugePage = readFileSync(hugePagePath).toString(); // Micro data -global.microTests = loadTreeConstructionTestData( - [join(__dirname, '../../test/data/html5lib-tests/tree-construction')], - treeAdapters.default -) +global.microTests = loadTreeConstructionTestData(treeConstructionPath, treeAdapters.default) .filter( - test => - //NOTE: this test caused stack overflow in parse5 v1.x + (test) => + //NOTE: this test caused a stack overflow in parse5 v1.x test.input !== ' +or cancel + + + + + + +JavaScript + + + +
+
+ + +
+ + + + + + +
+ + +branch: +master + + +
+ +
+
+Switch branches/tags + +
+ +
+
+ +
+
+ +
+
+ +
+ +
+ + +
+ +master +
+
+ +
+ +
+

Create branch:

+from ‘master’ +
+ + + +
+ +
+ +
+
+ + +
+ +v0.6.0 +
+
+ +0.6.1 +
+
+ +
Nothing to show
+
+ +
+
+
+ + + +
+ + + + +
+ + +
+

+htmlparser2 tree adapter tested + +

+
+ +latest commit 3397219353 + +
+Ivan Nikulin + +authored + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +Octocat-spinner-32 + +lib + +htmlparser2 tree adapter tested +
+ +Octocat-spinner-32 + +test + +htmlparser2 tree adapter tested +
+ +Octocat-spinner-32 + +.gitignore + +Merge +
+ +Octocat-spinner-32 + +LICENSE + +Merge +
+ +Octocat-spinner-32 + +README.md + +Add a Bitdeli badge to README +
+ +Octocat-spinner-32 + +index.js + +Implementation of the htmlparser2 tree support started +
+ +Octocat-spinner-32 + +package.json + +Expose Tokenizer +
+
+ +
+ + +README.md + + +

+parse5

+ +

Fast full-featured HTML parser for Node. Based on WHATWG HTML5 specification.
+To build TestCafé we needed fast and ready for production HTML parser for node.js, which will parse HTML as a modern browser's parser. +Existing solutions were either too slow or their output was too inaccurate. So, this is how parse5 was born.

+ +

+Install

+ +
$ npm install parse5
+
+ +

+Usage and API

+ +
var Parser = require('parse5').Parser;
+
+//Instantiate parser
+var parser = new Parser();
+
+//Then feed it with an HTML document
+var document = parser.parse('<!DOCTYPE html><html><head></head><body>Hi there!</body></html>')
+
+//Now let's parse HTML-snippet
+var fragment = parser.parseFragment('<title>Parse5 is &#102;&#117;&#99;&#107;ing awesome!</title><h1>42</h1>');
+
+
+ +

+Is it fast?

+ +

Check out this benchmark.

+ +
Starting benchmark. Fasten your seatbelts...
+html5 (https://github.com/aredridel/html5) x 0.18 ops/sec ±5.92% (5 runs sampled)
+htmlparser (https://github.com/tautologistics/node-htmlparser/) x 3.83 ops/sec ±42.43% (14 runs sampled)
+htmlparser2 (https://github.com/fb55/htmlparser2) x 4.05 ops/sec ±39.27% (15 runs sampled)
+parse5 (https://github.com/inikulin/parse5) x 3.04 ops/sec ±51.81% (13 runs sampled)
+Fastest is htmlparser2 (https://github.com/fb55/htmlparser2),parse5 (https://github.com/inikulin/parse5)
+
+ +

So, parse5 is as fast as simple specification incompatible parsers and ~15-times(!) faster than the current specification compatible parser available for the node.

+ +

+Testing

+ +

Test data is adopted from html5lib project. Parser is covered by more than 8000 test cases. +To run tests:

+ +
$ node test/run_tests.js
+
+ +

+Custom tree adapter

+ +

You can create a custom tree adapter so parse5 can work with your own DOM-tree implementation. +Just pass your adapter implementation to the parser's constructor as an argument:

+ +
var Parser = require('parse5').Parser;
+
+var myTreeAdapter = {
+//Adapter methods...
+};
+
+//Instantiate parser
+var parser = new Parser(myTreeAdapter);
+
+ +

Sample implementation can be found here. +The custom tree adapter should implement all methods exposed via exports in the sample implementation.

+ +

+Questions or suggestions?

+ +

If you have any questions, please feel free to create an issue here on github.

+ +

+Author

+ +

Ivan Nikulin (ifaaan@gmail.com)

+ +

Bitdeli Badge

+
+ + + + + + + + + + + + +
+ +
+ + +
+
+
+ +
+
+
+
+
+
+
+ + + + + + +
+
+ + + +
+ + +Something went wrong with that request. Please try again. +
+ + + + \ No newline at end of file diff --git a/test/data/location-info/whatwg-html/data.html b/test/data/location-info/whatwg-html/data.html index ffffa58..77ed8fe 100644 --- a/test/data/location-info/whatwg-html/data.html +++ b/test/data/location-info/whatwg-html/data.html @@ -1,1305 +1,1305 @@ - -HTML Standard - -

Table of contents

- - -
  1. 1 Introduction -
    1. 1.1 Where does this specification fit?
    2. -
    3. 1.2 Is this HTML5?
    4. -
    5. 1.3 Background
    6. -
    7. 1.4 Audience
    8. -
    9. 1.5 Scope
    10. -
    11. 1.6 History
    12. -
    13. 1.7 Design notes -
      1. 1.7.1 Serializability of script execution
      2. -
      3. 1.7.2 Compliance with other specifications
      4. -
      5. 1.7.3 Extensibility
    14. -
    15. 1.8 HTML vs XHTML
    16. -
    17. 1.9 Structure of this specification -
      1. 1.9.1 How to read this specification
      2. -
      3. 1.9.2 Typographic conventions
    18. -
    19. 1.10 Privacy concerns
    20. -
    21. 1.11 A quick introduction to HTML -
      1. 1.11.1 Writing secure applications with HTML
      2. -
      3. 1.11.2 Common pitfalls to avoid when using the scripting APIs
      4. -
      5. 1.11.3 How to catch mistakes when writing HTML: validators and conformance checkers
    22. -
    23. 1.12 Conformance requirements for authors -
      1. 1.12.1 Presentational markup
      2. -
      3. 1.12.2 Syntax errors
      4. -
      5. 1.12.3 Restrictions on content models and on attribute values
    24. -
    25. 1.13 Suggested reading
  2. -
  3. 2 Common infrastructure -
    1. 2.1 Terminology -
      1. 2.1.1 Resources
      2. -
      3. 2.1.2 XML
      4. -
      5. 2.1.3 DOM trees
      6. -
      7. 2.1.4 Scripting
      8. -
      9. 2.1.5 Plugins
      10. -
      11. 2.1.6 Character encodings
    2. -
    3. 2.2 Conformance requirements -
      1. 2.2.1 Conformance classes
      2. -
      3. 2.2.2 Dependencies
      4. -
      5. 2.2.3 Extensibility
      6. -
      7. 2.2.4 Interactions with XPath and XSLT
    4. -
    5. 2.3 Case-sensitivity and string comparison
    6. -
    7. 2.4 Common microsyntaxes -
      1. 2.4.1 Common parser idioms
      2. -
      3. 2.4.2 Boolean attributes
      4. -
      5. 2.4.3 Keywords and enumerated attributes
      6. -
      7. 2.4.4 Numbers -
        1. 2.4.4.1 Signed integers
        2. -
        3. 2.4.4.2 Non-negative integers
        4. -
        5. 2.4.4.3 Floating-point numbers
        6. -
        7. 2.4.4.4 Percentages and lengths
        8. -
        9. 2.4.4.5 Lists of integers
        10. -
        11. 2.4.4.6 Lists of dimensions
      8. -
      9. 2.4.5 Dates and times -
        1. 2.4.5.1 Months
        2. -
        3. 2.4.5.2 Dates
        4. -
        5. 2.4.5.3 Yearless dates
        6. -
        7. 2.4.5.4 Times
        8. -
        9. 2.4.5.5 Local dates and times
        10. -
        11. 2.4.5.6 Time zones
        12. -
        13. 2.4.5.7 Global dates and times
        14. -
        15. 2.4.5.8 Weeks
        16. -
        17. 2.4.5.9 Durations
        18. -
        19. 2.4.5.10 Vaguer moments in time
      10. -
      11. 2.4.6 Colors
      12. -
      13. 2.4.7 Space-separated tokens
      14. -
      15. 2.4.8 Comma-separated tokens
      16. -
      17. 2.4.9 References
      18. -
      19. 2.4.10 Media queries
    8. -
    9. 2.5 URLs -
      1. 2.5.1 Terminology
      2. -
      3. 2.5.2 Resolving URLs
      4. -
      5. 2.5.3 Dynamic changes to base URLs
    10. -
    11. 2.6 Fetching resources -
      1. 2.6.1 Terminology
      2. -
      3. 2.6.2 Processing model
      4. -
      5. 2.6.3 Encrypted HTTP and related security concerns
      6. -
      7. 2.6.4 Determining the type of a resource
      8. -
      9. 2.6.5 Extracting character encodings from meta elements
      10. -
      11. 2.6.6 CORS settings attributes
      12. -
      13. 2.6.7 CORS-enabled fetch
    12. -
    13. 2.7 Common DOM interfaces -
      1. 2.7.1 Reflecting content attributes in IDL attributes
      2. -
      3. 2.7.2 Collections -
        1. 2.7.2.1 HTMLAllCollection
        2. -
        3. 2.7.2.2 HTMLFormControlsCollection
        4. -
        5. 2.7.2.3 HTMLOptionsCollection
        6. -
        7. 2.7.2.4 HTMLPropertiesCollection
      4. -
      5. 2.7.3 DOMStringMap
      6. -
      7. 2.7.4 DOMElementMap
      8. -
      9. 2.7.5 Transferable objects
      10. -
      11. 2.7.6 Safe passing of structured data
      12. -
      13. 2.7.7 Callbacks
      14. -
      15. 2.7.8 Garbage collection
    14. -
    15. 2.8 Namespaces
  4. -
  5. 3 Semantics, structure, and APIs of HTML documents -
    1. 3.1 Documents -
      1. 3.1.1 The Document object
      2. -
      3. 3.1.2 Resource metadata management
      4. -
      5. 3.1.3 DOM tree accessors
      6. -
      7. 3.1.4 Loading XML documents
    2. -
    3. 3.2 Elements -
      1. 3.2.1 Semantics
      2. -
      3. 3.2.2 Elements in the DOM
      4. -
      5. 3.2.3 Element definitions -
        1. 3.2.3.1 Attributes
      6. -
      7. 3.2.4 Content models -
        1. 3.2.4.1 Kinds of content -
          1. 3.2.4.1.1 Metadata content
          2. -
          3. 3.2.4.1.2 Flow content
          4. -
          5. 3.2.4.1.3 Sectioning content
          6. -
          7. 3.2.4.1.4 Heading content
          8. -
          9. 3.2.4.1.5 Phrasing content
          10. -
          11. 3.2.4.1.6 Embedded content
          12. -
          13. 3.2.4.1.7 Interactive content
          14. -
          15. 3.2.4.1.8 Palpable content
          16. -
          17. 3.2.4.1.9 Script-supporting elements
        2. -
        3. 3.2.4.2 Transparent content models
        4. -
        5. 3.2.4.3 Paragraphs
      8. -
      9. 3.2.5 Global attributes -
        1. 3.2.5.1 The id attribute
        2. -
        3. 3.2.5.2 The title attribute
        4. -
        5. 3.2.5.3 The lang and xml:lang attributes
        6. -
        7. 3.2.5.4 The translate attribute
        8. -
        9. 3.2.5.5 The xml:base attribute (XML only)
        10. -
        11. 3.2.5.6 The dir attribute
        12. -
        13. 3.2.5.7 The class attribute
        14. -
        15. 3.2.5.8 The style attribute
        16. -
        17. 3.2.5.9 Embedding custom non-visible data with the data-* attributes
      10. -
      11. 3.2.6 Requirements relating to the bidirectional algorithm -
        1. 3.2.6.1 Authoring conformance criteria for bidirectional-algorithm formatting characters
        2. -
        3. 3.2.6.2 User agent conformance criteria
      12. -
      13. 3.2.7 WAI-ARIA
  6. -
  7. 4 The elements of HTML -
    1. 4.1 The root element -
      1. 4.1.1 The html element
    2. -
    3. 4.2 Document metadata -
      1. 4.2.1 The head element
      2. -
      3. 4.2.2 The title element
      4. -
      5. 4.2.3 The base element
      6. -
      7. 4.2.4 The link element
      8. -
      9. 4.2.5 The meta element -
        1. 4.2.5.1 Standard metadata names
        2. -
        3. 4.2.5.2 Other metadata names
        4. -
        5. 4.2.5.3 Pragma directives
        6. -
        7. 4.2.5.4 Other pragma directives
        8. -
        9. 4.2.5.5 Specifying the document's character encoding
      10. -
      11. 4.2.6 The style element -
        1. 4.2.6.1 The @global rule
      12. -
      13. 4.2.7 Interactions of styling and scripting
    4. -
    5. 4.3 Sections -
      1. 4.3.1 The body element
      2. -
      3. 4.3.2 The article element
      4. -
      5. 4.3.3 The section element
      6. -
      7. 4.3.4 The nav element
      8. -
      9. 4.3.5 The aside element
      10. -
      11. 4.3.6 The h1, h2, h3, h4, h5, and -h6 elements
      12. -
      13. 4.3.7 The hgroup element
      14. -
      15. 4.3.8 The header element
      16. -
      17. 4.3.9 The footer element
      18. -
      19. 4.3.10 The address element
      20. -
      21. 4.3.11 Headings and sections -
        1. 4.3.11.1 Creating an outline
        2. -
        3. 4.3.11.2 Sample outlines
      22. -
      23. 4.3.12 Usage summary -
        1. 4.3.12.1 Article or section?
    6. -
    7. 4.4 Grouping content -
      1. 4.4.1 The p element
      2. -
      3. 4.4.2 The hr element
      4. -
      5. 4.4.3 The pre element
      6. -
      7. 4.4.4 The blockquote element
      8. -
      9. 4.4.5 The ol element
      10. -
      11. 4.4.6 The ul element
      12. -
      13. 4.4.7 The li element
      14. -
      15. 4.4.8 The dl element
      16. -
      17. 4.4.9 The dt element
      18. -
      19. 4.4.10 The dd element
      20. -
      21. 4.4.11 The figure element
      22. -
      23. 4.4.12 The figcaption element
      24. -
      25. 4.4.13 The main element
      26. -
      27. 4.4.14 The div element
    8. -
    9. 4.5 Text-level semantics -
      1. 4.5.1 The a element
      2. -
      3. 4.5.2 The em element
      4. -
      5. 4.5.3 The strong element
      6. -
      7. 4.5.4 The small element
      8. -
      9. 4.5.5 The s element
      10. -
      11. 4.5.6 The cite element
      12. -
      13. 4.5.7 The q element
      14. -
      15. 4.5.8 The dfn element
      16. -
      17. 4.5.9 The abbr element
      18. -
      19. 4.5.10 The data element
      20. -
      21. 4.5.11 The time element
      22. -
      23. 4.5.12 The code element
      24. -
      25. 4.5.13 The var element
      26. -
      27. 4.5.14 The samp element
      28. -
      29. 4.5.15 The kbd element
      30. -
      31. 4.5.16 The sub and sup elements
      32. -
      33. 4.5.17 The i element
      34. -
      35. 4.5.18 The b element
      36. -
      37. 4.5.19 The u element
      38. -
      39. 4.5.20 The mark element
      40. -
      41. 4.5.21 The ruby element
      42. -
      43. 4.5.22 The rt element
      44. -
      45. 4.5.23 The rp element
      46. -
      47. 4.5.24 The bdi element
      48. -
      49. 4.5.25 The bdo element
      50. -
      51. 4.5.26 The span element
      52. -
      53. 4.5.27 The br element
      54. -
      55. 4.5.28 The wbr element
      56. -
      57. 4.5.29 Usage summary
    10. -
    11. 4.6 Edits -
      1. 4.6.1 The ins element
      2. -
      3. 4.6.2 The del element
      4. -
      5. 4.6.3 Attributes common to ins and del elements
      6. -
      7. 4.6.4 Edits and paragraphs
      8. -
      9. 4.6.5 Edits and lists
      10. -
      11. 4.6.6 Edits and tables
    12. -
    13. 4.7 Embedded content -
      1. 4.7.1 The img element -
        1. 4.7.1.1 Requirements for providing text to act as an alternative for images -
          1. 4.7.1.1.1 General guidelines
          2. -
          3. 4.7.1.1.2 A link or button containing nothing but the image
          4. -
          5. 4.7.1.1.3 A phrase or paragraph with an alternative graphical representation: charts, diagrams, graphs, maps, illustrations
          6. -
          7. 4.7.1.1.4 A short phrase or label with an alternative graphical representation: icons, logos
          8. -
          9. 4.7.1.1.5 Text that has been rendered to a graphic for typographical effect
          10. -
          11. 4.7.1.1.6 A graphical representation of some of the surrounding text
          12. -
          13. 4.7.1.1.7 A purely decorative image that doesn't add any information
          14. -
          15. 4.7.1.1.8 A group of images that form a single larger picture with no links
          16. -
          17. 4.7.1.1.9 A group of images that form a single larger picture with links
          18. -
          19. 4.7.1.1.10 A key part of the content
          20. -
          21. 4.7.1.1.11 An image not intended for the user
          22. -
          23. 4.7.1.1.12 An image in an e-mail or private document intended for a specific person who is known to be able to view images
          24. -
          25. 4.7.1.1.13 Guidance for markup generators
          26. -
          27. 4.7.1.1.14 Guidance for conformance checkers
        2. -
        3. 4.7.1.2 Adaptive images
      2. -
      3. 4.7.2 The iframe element
      4. -
      5. 4.7.3 The embed element
      6. -
      7. 4.7.4 The object element
      8. -
      9. 4.7.5 The param element
      10. -
      11. 4.7.6 The video element
      12. -
      13. 4.7.7 The audio element
      14. -
      15. 4.7.8 The source element
      16. -
      17. 4.7.9 The track element
      18. -
      19. 4.7.10 Media elements -
        1. 4.7.10.1 Error codes
        2. -
        3. 4.7.10.2 Location of the media resource
        4. -
        5. 4.7.10.3 MIME types
        6. -
        7. 4.7.10.4 Network states
        8. -
        9. 4.7.10.5 Loading the media resource
        10. -
        11. 4.7.10.6 Offsets into the media resource
        12. -
        13. 4.7.10.7 Ready states
        14. -
        15. 4.7.10.8 Playing the media resource
        16. -
        17. 4.7.10.9 Seeking
        18. -
        19. 4.7.10.10 Media resources with multiple media tracks -
          1. 4.7.10.10.1 AudioTrackList and VideoTrackList objects
          2. -
          3. 4.7.10.10.2 Selecting specific audio and video tracks declaratively
        20. -
        21. 4.7.10.11 Synchronising multiple media elements -
          1. 4.7.10.11.1 Introduction
          2. -
          3. 4.7.10.11.2 Media controllers
          4. -
          5. 4.7.10.11.3 Assigning a media controller declaratively
        22. -
        23. 4.7.10.12 Timed text tracks -
          1. 4.7.10.12.1 Text track model
          2. -
          3. 4.7.10.12.2 Sourcing in-band text tracks
          4. -
          5. 4.7.10.12.3 Sourcing out-of-band text tracks
          6. -
          7. 4.7.10.12.4 Guidelines for exposing cues in various formats as text track cues
          8. -
          9. 4.7.10.12.5 Text track API
          10. -
          11. 4.7.10.12.6 Text tracks describing chapters
          12. -
          13. 4.7.10.12.7 Event handlers for objects of the text track APIs
          14. -
          15. 4.7.10.12.8 Best practices for metadata text tracks
        24. -
        25. 4.7.10.13 User interface
        26. -
        27. 4.7.10.14 Time ranges
        28. -
        29. 4.7.10.15 The TrackEvent interface
        30. -
        31. 4.7.10.16 Event summary
        32. -
        33. 4.7.10.17 Security and privacy considerations
        34. -
        35. 4.7.10.18 Best practices for authors using media elements
        36. -
        37. 4.7.10.19 Best practices for implementors of media elements
      20. -
      21. 4.7.11 The map element
      22. -
      23. 4.7.12 The area element
      24. -
      25. 4.7.13 Image maps -
        1. 4.7.13.1 Authoring
        2. -
        3. 4.7.13.2 Processing model
      26. -
      27. 4.7.14 MathML
      28. -
      29. 4.7.15 SVG
      30. -
      31. 4.7.16 Dimension attributes
    14. -
    15. 4.8 Links -
      1. 4.8.1 Introduction
      2. -
      3. 4.8.2 Links created by a and area elements
      4. -
      5. 4.8.3 Following hyperlinks
      6. -
      7. 4.8.4 Downloading resources -
        1. 4.8.4.1 Hyperlink auditing
      8. -
      9. 4.8.5 Link types -
        1. 4.8.5.1 Link type "alternate"
        2. -
        3. 4.8.5.2 Link type "author"
        4. -
        5. 4.8.5.3 Link type "bookmark"
        6. -
        7. 4.8.5.4 Link type "external"
        8. -
        9. 4.8.5.5 Link type "help"
        10. -
        11. 4.8.5.6 Link type "icon"
        12. -
        13. 4.8.5.7 Link type "license"
        14. -
        15. 4.8.5.8 Link type "nofollow"
        16. -
        17. 4.8.5.9 Link type "noreferrer"
        18. -
        19. 4.8.5.10 Link type "pingback"
        20. -
        21. 4.8.5.11 Link type "prefetch"
        22. -
        23. 4.8.5.12 Link type "search"
        24. -
        25. 4.8.5.13 Link type "sidebar"
        26. -
        27. 4.8.5.14 Link type "stylesheet"
        28. -
        29. 4.8.5.15 Link type "tag"
        30. -
        31. 4.8.5.16 Sequential link types -
          1. 4.8.5.16.1 Link type "next"
          2. -
          3. 4.8.5.16.2 Link type "prev"
        32. -
        33. 4.8.5.17 Other link types
    16. -
    17. 4.9 Tabular data -
      1. 4.9.1 The table element -
        1. 4.9.1.1 Techniques for describing tables
        2. -
        3. 4.9.1.2 Techniques for table design
      2. -
      3. 4.9.2 The caption element
      4. -
      5. 4.9.3 The colgroup element
      6. -
      7. 4.9.4 The col element
      8. -
      9. 4.9.5 The tbody element
      10. -
      11. 4.9.6 The thead element
      12. -
      13. 4.9.7 The tfoot element
      14. -
      15. 4.9.8 The tr element
      16. -
      17. 4.9.9 The td element
      18. -
      19. 4.9.10 The th element
      20. -
      21. 4.9.11 Attributes common to td and th elements
      22. -
      23. 4.9.12 Processing model -
        1. 4.9.12.1 Forming a table
        2. -
        3. 4.9.12.2 Forming relationships between data cells and header cells
      24. -
      25. 4.9.13 Table sorting model
      26. -
      27. 4.9.14 Examples
    18. -
    19. 4.10 Forms -
      1. 4.10.1 Introduction -
        1. 4.10.1.1 Writing a form's user interface
        2. -
        3. 4.10.1.2 Implementing the server-side processing for a form
        4. -
        5. 4.10.1.3 Configuring a form to communicate with a server
        6. -
        7. 4.10.1.4 Client-side form validation
        8. -
        9. 4.10.1.5 Enabling client-side automatic filling of form controls
        10. -
        11. 4.10.1.6 Improving the user experience on mobile devices
        12. -
        13. 4.10.1.7 The difference between the field type, the autofill field name, and the input modality
        14. -
        15. 4.10.1.8 Date, time, and number formats
      2. -
      3. 4.10.2 Categories
      4. -
      5. 4.10.3 The form element
      6. -
      7. 4.10.4 The label element
      8. -
      9. 4.10.5 The input element -
        1. 4.10.5.1 States of the type attribute -
          1. 4.10.5.1.1 Hidden state (type=hidden)
          2. -
          3. 4.10.5.1.2 Text (type=text) state and Search state (type=search)
          4. -
          5. 4.10.5.1.3 Telephone state (type=tel)
          6. -
          7. 4.10.5.1.4 URL state (type=url)
          8. -
          9. 4.10.5.1.5 E-mail state (type=email)
          10. -
          11. 4.10.5.1.6 Password state (type=password)
          12. -
          13. 4.10.5.1.7 Date and Time state (type=datetime)
          14. -
          15. 4.10.5.1.8 Date state (type=date)
          16. -
          17. 4.10.5.1.9 Month state (type=month)
          18. -
          19. 4.10.5.1.10 Week state (type=week)
          20. -
          21. 4.10.5.1.11 Time state (type=time)
          22. -
          23. 4.10.5.1.12 Local Date and Time state (type=datetime-local)
          24. -
          25. 4.10.5.1.13 Number state (type=number)
          26. -
          27. 4.10.5.1.14 Range state (type=range)
          28. -
          29. 4.10.5.1.15 Color state (type=color)
          30. -
          31. 4.10.5.1.16 Checkbox state (type=checkbox)
          32. -
          33. 4.10.5.1.17 Radio Button state (type=radio)
          34. -
          35. 4.10.5.1.18 File Upload state (type=file)
          36. -
          37. 4.10.5.1.19 Submit Button state (type=submit)
          38. -
          39. 4.10.5.1.20 Image Button state (type=image)
          40. -
          41. 4.10.5.1.21 Reset Button state (type=reset)
          42. -
          43. 4.10.5.1.22 Button state (type=button)
        2. -
        3. 4.10.5.2 Implemention notes regarding localization of form controls
        4. -
        5. 4.10.5.3 Common input element attributes -
          1. 4.10.5.3.1 The maxlength and minlength attributes
          2. -
          3. 4.10.5.3.2 The size attribute
          4. -
          5. 4.10.5.3.3 The readonly attribute
          6. -
          7. 4.10.5.3.4 The required attribute
          8. -
          9. 4.10.5.3.5 The multiple attribute
          10. -
          11. 4.10.5.3.6 The pattern attribute
          12. -
          13. 4.10.5.3.7 The min and max attributes
          14. -
          15. 4.10.5.3.8 The step attribute
          16. -
          17. 4.10.5.3.9 The list attribute
          18. -
          19. 4.10.5.3.10 The placeholder attribute
        6. -
        7. 4.10.5.4 Common input element APIs
        8. -
        9. 4.10.5.5 Common event behaviors
      10. -
      11. 4.10.6 The button element
      12. -
      13. 4.10.7 The select element
      14. -
      15. 4.10.8 The datalist element
      16. -
      17. 4.10.9 The optgroup element
      18. -
      19. 4.10.10 The option element
      20. -
      21. 4.10.11 The textarea element
      22. -
      23. 4.10.12 The keygen element
      24. -
      25. 4.10.13 The output element
      26. -
      27. 4.10.14 The progress element
      28. -
      29. 4.10.15 The meter element
      30. -
      31. 4.10.16 The fieldset element
      32. -
      33. 4.10.17 The legend element
      34. -
      35. 4.10.18 Form control infrastructure -
        1. 4.10.18.1 A form control's value
        2. -
        3. 4.10.18.2 Mutability
        4. -
        5. 4.10.18.3 Association of controls and forms
      36. -
      37. 4.10.19 Attributes common to form controls -
        1. 4.10.19.1 Naming form controls: the name attribute
        2. -
        3. 4.10.19.2 Submitting element directionality: the dirname attribute
        4. -
        5. 4.10.19.3 Limiting user input length: the maxlength attribute
        6. -
        7. 4.10.19.4 Setting minimum input length requirements: the minlength attribute
        8. -
        9. 4.10.19.5 Enabling and disabling form controls: the disabled attribute
        10. -
        11. 4.10.19.6 Form submission
        12. -
        13. 4.10.19.7 Autofocusing a form control: the autofocus attribute
        14. -
        15. 4.10.19.8 Input modalities: the inputmode attribute
        16. -
        17. 4.10.19.9 Autofilling form controls: the autocomplete attribute
      38. -
      39. 4.10.20 APIs for the text field selections
      40. -
      41. 4.10.21 Constraints -
        1. 4.10.21.1 Definitions
        2. -
        3. 4.10.21.2 Constraint validation
        4. -
        5. 4.10.21.3 The constraint validation API
        6. -
        7. 4.10.21.4 Security
      42. -
      43. 4.10.22 Form submission -
        1. 4.10.22.1 Introduction
        2. -
        3. 4.10.22.2 Implicit submission
        4. -
        5. 4.10.22.3 Form submission algorithm
        6. -
        7. 4.10.22.4 Constructing the form data set
        8. -
        9. 4.10.22.5 Selecting a form submission encoding
        10. -
        11. 4.10.22.6 URL-encoded form data
        12. -
        13. 4.10.22.7 Multipart form data
        14. -
        15. 4.10.22.8 Plain text form data
      44. -
      45. 4.10.23 Resetting a form
    20. -
    21. 4.11 Interactive elements -
      1. 4.11.1 The details element
      2. -
      3. 4.11.2 The summary element
      4. -
      5. 4.11.3 The menu element
      6. -
      7. 4.11.4 The menuitem element
      8. -
      9. 4.11.5 Context menus -
        1. 4.11.5.1 Declaring a context menu
        2. -
        3. 4.11.5.2 Processing model
        4. -
        5. 4.11.5.3 The RelatedEvent interfaces
      10. -
      11. 4.11.6 Commands -
        1. 4.11.6.1 Facets
        2. -
        3. 4.11.6.2 Using the a element to define a command
        4. -
        5. 4.11.6.3 Using the button element to define a command
        6. -
        7. 4.11.6.4 Using the input element to define a command
        8. -
        9. 4.11.6.5 Using the option element to define a command
        10. -
        11. 4.11.6.6 Using the menuitem element to define a -command
        12. -
        13. 4.11.6.7 Using the command attribute on menuitem elements to define -a command indirectly
        14. -
        15. 4.11.6.8 Using the accesskey attribute -on a label element to define a command
        16. -
        17. 4.11.6.9 Using the accesskey attribute -on a legend element to define a command
        18. -
        19. 4.11.6.10 Using the accesskey -attribute to define a command on other elements
      12. -
      13. 4.11.7 The dialog element -
        1. 4.11.7.1 Anchor points
    22. -
    23. 4.12 Scripting -
      1. 4.12.1 The script element -
        1. 4.12.1.1 Scripting languages
        2. -
        3. 4.12.1.2 Restrictions for contents of script elements
        4. -
        5. 4.12.1.3 Inline documentation for external scripts
        6. -
        7. 4.12.1.4 Interaction of script elements and XSLT
      2. -
      3. 4.12.2 The noscript element
      4. -
      5. 4.12.3 The template element -
        1. 4.12.3.1 Interaction of template elements with XSLT and XPath
      6. -
      7. 4.12.4 The canvas element -
        1. 4.12.4.1 Proxying canvases to workers
        2. -
        3. 4.12.4.2 The 2D rendering context -
          1. 4.12.4.2.1 Implementation notes
          2. -
          3. 4.12.4.2.2 The canvas state
          4. -
          5. 4.12.4.2.3 DrawingStyle objects
          6. -
          7. 4.12.4.2.4 Line styles
          8. -
          9. 4.12.4.2.5 Text styles
          10. -
          11. 4.12.4.2.6 Building paths
          12. -
          13. 4.12.4.2.7 Path objects
          14. -
          15. 4.12.4.2.8 Transformations
          16. -
          17. 4.12.4.2.9 Image sources for 2D rendering contexts
          18. -
          19. 4.12.4.2.10 Fill and stroke styles
          20. -
          21. 4.12.4.2.11 Drawing rectangles to the bitmap
          22. -
          23. 4.12.4.2.12 Drawing text to the bitmap
          24. -
          25. 4.12.4.2.13 Drawing paths to the canvas
          26. -
          27. 4.12.4.2.14 Drawing images
          28. -
          29. 4.12.4.2.15 Hit regions
          30. -
          31. 4.12.4.2.16 Pixel manipulation
          32. -
          33. 4.12.4.2.17 Compositing
          34. -
          35. 4.12.4.2.18 Image smoothing
          36. -
          37. 4.12.4.2.19 Shadows
          38. -
          39. 4.12.4.2.20 Drawing model
          40. -
          41. 4.12.4.2.21 Best practices
          42. -
          43. 4.12.4.2.22 Examples
        4. -
        5. 4.12.4.3 Color spaces and color correction
        6. -
        7. 4.12.4.4 Serializing bitmaps to a file
        8. -
        9. 4.12.4.5 Security with canvas elements
    24. -
    25. 4.13 Common idioms without dedicated elements -
      1. 4.13.1 The main part of the content
      2. -
      3. 4.13.2 Bread crumb navigation
      4. -
      5. 4.13.3 Tag clouds
      6. -
      7. 4.13.4 Conversations
      8. -
      9. 4.13.5 Footnotes
    26. -
    27. 4.14 Disabled elements
    28. -
    29. 4.15 Matching HTML elements using selectors -
      1. 4.15.1 Case-sensitivity
      2. -
      3. 4.15.2 Pseudo-classes
  8. -
  9. 5 Microdata -
    1. 5.1 Introduction -
      1. 5.1.1 Overview
      2. -
      3. 5.1.2 The basic syntax
      4. -
      5. 5.1.3 Typed items
      6. -
      7. 5.1.4 Global identifiers for items
      8. -
      9. 5.1.5 Selecting names when defining vocabularies
      10. -
      11. 5.1.6 Using the microdata DOM API
    2. -
    3. 5.2 Encoding microdata -
      1. 5.2.1 The microdata model
      2. -
      3. 5.2.2 Items
      4. -
      5. 5.2.3 Names: the itemprop attribute
      6. -
      7. 5.2.4 Values
      8. -
      9. 5.2.5 Associating names with items
      10. -
      11. 5.2.6 Microdata and other namespaces
    4. -
    5. 5.3 Microdata DOM API
    6. -
    7. 5.4 Sample microdata vocabularies -
      1. 5.4.1 vCard -
        1. 5.4.1.1 Conversion to vCard
        2. -
        3. 5.4.1.2 Examples
      2. -
      3. 5.4.2 vEvent -
        1. 5.4.2.1 Conversion to iCalendar
        2. -
        3. 5.4.2.2 Examples
      4. -
      5. 5.4.3 Licensing works -
        1. 5.4.3.1 Examples
    8. -
    9. 5.5 Converting HTML to other formats -
      1. 5.5.1 JSON
  10. -
  11. 6 Loading Web pages -
    1. 6.1 Browsing contexts -
      1. 6.1.1 Nested browsing contexts -
        1. 6.1.1.1 Navigating nested browsing contexts in the DOM
      2. -
      3. 6.1.2 Auxiliary browsing contexts -
        1. 6.1.2.1 Navigating auxiliary browsing contexts in the DOM
      4. -
      5. 6.1.3 Secondary browsing contexts
      6. -
      7. 6.1.4 Security
      8. -
      9. 6.1.5 Groupings of browsing contexts
      10. -
      11. 6.1.6 Browsing context names
    2. -
    3. 6.2 The Window object -
      1. 6.2.1 Security
      2. -
      3. 6.2.2 APIs for creating and navigating browsing contexts by name
      4. -
      5. 6.2.3 Accessing other browsing contexts
      6. -
      7. 6.2.4 Named access on the Window object
      8. -
      9. 6.2.5 Garbage collection and browsing contexts
      10. -
      11. 6.2.6 Closing browsing contexts
      12. -
      13. 6.2.7 Browser interface elements
      14. -
      15. 6.2.8 The WindowProxy object
    4. -
    5. 6.3 Origin -
      1. 6.3.1 Relaxing the same-origin restriction
    6. -
    7. 6.4 Sandboxing
    8. -
    9. 6.5 Session history and navigation -
      1. 6.5.1 The session history of browsing contexts
      2. -
      3. 6.5.2 The History interface
      4. -
      5. 6.5.3 The Location interface -
        1. 6.5.3.1 Security
      6. -
      7. 6.5.4 Implementation notes for session history
    10. -
    11. 6.6 Browsing the Web -
      1. 6.6.1 Navigating across documents
      2. -
      3. 6.6.2 Page load processing model for HTML files
      4. -
      5. 6.6.3 Page load processing model for XML files
      6. -
      7. 6.6.4 Page load processing model for text files
      8. -
      9. 6.6.5 Page load processing model for multipart/x-mixed-replace resources
      10. -
      11. 6.6.6 Page load processing model for media
      12. -
      13. 6.6.7 Page load processing model for content that uses plugins
      14. -
      15. 6.6.8 Page load processing model for inline -content that doesn't have a DOM
      16. -
      17. 6.6.9 Navigating to a fragment identifier
      18. -
      19. 6.6.10 History traversal -
        1. 6.6.10.1 The PopStateEvent interface
        2. -
        3. 6.6.10.2 The HashChangeEvent interface
        4. -
        5. 6.6.10.3 The PageTransitionEvent interface
      20. -
      21. 6.6.11 Unloading documents -
        1. 6.6.11.1 The BeforeUnloadEvent interface
      22. -
      23. 6.6.12 Aborting a document load
    12. -
    13. 6.7 Offline Web applications -
      1. 6.7.1 Introduction -
        1. 6.7.1.1 Supporting offline caching for legacy applications
        2. -
        3. 6.7.1.2 Event summary
      2. -
      3. 6.7.2 Application caches
      4. -
      5. 6.7.3 The cache manifest syntax -
        1. 6.7.3.1 Some sample manifests
        2. -
        3. 6.7.3.2 Writing cache manifests
        4. -
        5. 6.7.3.3 Parsing cache manifests
      6. -
      7. 6.7.4 Downloading or updating an application cache
      8. -
      9. 6.7.5 The application cache selection algorithm
      10. -
      11. 6.7.6 Changes to the networking model
      12. -
      13. 6.7.7 Expiring application caches
      14. -
      15. 6.7.8 Disk space
      16. -
      17. 6.7.9 Application cache API
      18. -
      19. 6.7.10 Browser state
  12. -
  13. 7 Web application APIs -
    1. 7.1 Scripting -
      1. 7.1.1 Introduction
      2. -
      3. 7.1.2 Enabling and disabling scripting
      4. -
      5. 7.1.3 Processing model -
        1. 7.1.3.1 Definitions
        2. -
        3. 7.1.3.2 Script settings for browsing contexts
        4. -
        5. 7.1.3.3 Calling scripts
        6. -
        7. 7.1.3.4 Creating scripts
        8. -
        9. 7.1.3.5 Killing scripts
        10. -
        11. 7.1.3.6 Runtime script errors -
          1. 7.1.3.6.1 Runtime script errors in documents
          2. -
          3. 7.1.3.6.2 The ErrorEvent interface
      6. -
      7. 7.1.4 Event loops -
        1. 7.1.4.1 Definitions
        2. -
        3. 7.1.4.2 Processing model
        4. -
        5. 7.1.4.3 Generic task sources
      8. -
      9. 7.1.5 Events -
        1. 7.1.5.1 Event handlers
        2. -
        3. 7.1.5.2 Event handlers on elements, Document objects, and Window objects -
          1. 7.1.5.2.1 IDL definitions
        4. -
        5. 7.1.5.3 Event firing
        6. -
        7. 7.1.5.4 Events and the Window object
    2. -
    3. 7.2 Base64 utility methods
    4. -
    5. 7.3 Dynamic markup insertion -
      1. 7.3.1 Opening the input stream
      2. -
      3. 7.3.2 Closing the input stream
      4. -
      5. 7.3.3 document.write()
      6. -
      7. 7.3.4 document.writeln()
    6. -
    7. 7.4 Timers
    8. -
    9. 7.5 User prompts -
      1. 7.5.1 Simple dialogs
      2. -
      3. 7.5.2 Printing
      4. -
      5. 7.5.3 Dialogs implemented using separate documents
    10. -
    11. 7.6 System state and capabilities -
      1. 7.6.1 The Navigator object -
        1. 7.6.1.1 Client identification
        2. -
        3. 7.6.1.2 Language preferences
        4. -
        5. 7.6.1.3 Custom scheme and content handlers -
          1. 7.6.1.3.1 Security and privacy
          2. -
          3. 7.6.1.3.2 Sample user interface
        6. -
        7. 7.6.1.4 Manually releasing the storage mutex
        8. -
        9. 7.6.1.5 Plugins
      2. -
      3. 7.6.2 The External interface
    12. -
    13. 7.7 Images
  14. -
  15. 8 User interaction -
    1. 8.1 The hidden attribute
    2. -
    3. 8.2 Inert subtrees -
      1. 8.2.1 The inert attribute
    4. -
    5. 8.3 Activation
    6. -
    7. 8.4 Focus -
      1. 8.4.1 Sequential focus navigation and the tabindex attribute
      2. -
      3. 8.4.2 Focus management
      4. -
      5. 8.4.3 Document-level focus APIs
      6. -
      7. 8.4.4 Element-level focus APIs
    8. -
    9. 8.5 Assigning keyboard shortcuts -
      1. 8.5.1 Introduction
      2. -
      3. 8.5.2 The accesskey attribute
      4. -
      5. 8.5.3 Processing model
    10. -
    11. 8.6 Editing -
      1. 8.6.1 Making document regions editable: The contenteditable content attribute
      2. -
      3. 8.6.2 Making entire documents editable: The designMode IDL attribute
      4. -
      5. 8.6.3 Best practices for in-page editors
      6. -
      7. 8.6.4 Editing APIs
      8. -
      9. 8.6.5 Spelling and grammar checking
    12. -
    13. 8.7 Drag and drop -
      1. 8.7.1 Introduction
      2. -
      3. 8.7.2 The drag data store
      4. -
      5. 8.7.3 The DataTransfer interface -
        1. 8.7.3.1 The DataTransferItemList interface
        2. -
        3. 8.7.3.2 The DataTransferItem interface
      6. -
      7. 8.7.4 The DragEvent interface
      8. -
      9. 8.7.5 Drag-and-drop processing model
      10. -
      11. 8.7.6 Events summary
      12. -
      13. 8.7.7 The draggable attribute
      14. -
      15. 8.7.8 The dropzone attribute
      16. -
      17. 8.7.9 Security risks in the drag-and-drop model
  16. -
  17. 9 Communication -
    1. 9.1 The MessageEvent interfaces
    2. -
    3. 9.2 Server-sent events -
      1. 9.2.1 Introduction
      2. -
      3. 9.2.2 The EventSource interface
      4. -
      5. 9.2.3 Processing model
      6. -
      7. 9.2.4 Parsing an event stream
      8. -
      9. 9.2.5 Interpreting an event stream
      10. -
      11. 9.2.6 Authoring notes
      12. -
      13. 9.2.7 Connectionless push and other features
      14. -
      15. 9.2.8 Garbage collection
      16. -
      17. 9.2.9 Implementation advice
      18. -
      19. 9.2.10 IANA considerations -
        1. 9.2.10.1 text/event-stream
        2. -
        3. 9.2.10.2 Last-Event-ID
    4. -
    5. 9.3 Web sockets -
      1. 9.3.1 Introduction
      2. -
      3. 9.3.2 The WebSocket interface
      4. -
      5. 9.3.3 Feedback from the protocol
      6. -
      7. 9.3.4 Ping and Pong frames
      8. -
      9. 9.3.5 Parsing WebSocket URLs
      10. -
      11. 9.3.6 The CloseEvent interfaces
      12. -
      13. 9.3.7 Garbage collection
    6. -
    7. 9.4 Cross-document messaging -
      1. 9.4.1 Introduction
      2. -
      3. 9.4.2 Security -
        1. 9.4.2.1 Authors
        2. -
        3. 9.4.2.2 User agents
      4. -
      5. 9.4.3 Posting messages
    8. -
    9. 9.5 Channel messaging -
      1. 9.5.1 Introduction -
        1. 9.5.1.1 Examples
        2. -
        3. 9.5.1.2 Ports as the basis of an object-capability model on the Web
        4. -
        5. 9.5.1.3 Ports as the basis of abstracting out service implementations
      2. -
      3. 9.5.2 Message channels
      4. -
      5. 9.5.3 Message ports
      6. -
      7. 9.5.4 Broadcasting to many ports
      8. -
      9. 9.5.5 Ports and garbage collection
    10. -
    11. 9.6 Broadcasting to other browsing contexts
  18. -
  19. 10 Web workers -
    1. 10.1 Introduction -
      1. 10.1.1 Scope
      2. -
      3. 10.1.2 Examples -
        1. 10.1.2.1 A background number-crunching worker
        2. -
        3. 10.1.2.2 Worker used for background I/O
        4. -
        5. 10.1.2.3 Shared workers introduction
        6. -
        7. 10.1.2.4 Shared state using a shared worker
        8. -
        9. 10.1.2.5 Delegation
      4. -
      5. 10.1.3 Tutorials -
        1. 10.1.3.1 Creating a dedicated worker
        2. -
        3. 10.1.3.2 Communicating with a dedicated worker
        4. -
        5. 10.1.3.3 Shared workers
    2. -
    3. 10.2 Infrastructure -
      1. 10.2.1 The global scope -
        1. 10.2.1.1 The WorkerGlobalScope common interface
        2. -
        3. 10.2.1.2 Dedicated workers and the DedicatedWorkerGlobalScope interface
        4. -
        5. 10.2.1.3 Shared workers and the SharedWorkerGlobalScope interface
      2. -
      3. 10.2.2 The event loop
      4. -
      5. 10.2.3 The worker's lifetime
      6. -
      7. 10.2.4 Processing model
      8. -
      9. 10.2.5 Runtime script errors
      10. -
      11. 10.2.6 Creating workers -
        1. 10.2.6.1 The AbstractWorker abstract interface
        2. -
        3. 10.2.6.2 Script settings for workers
        4. -
        5. 10.2.6.3 Dedicated workers and the Worker interface
        6. -
        7. 10.2.6.4 Shared workers and the SharedWorker interface
    4. -
    5. 10.3 APIs available to workers -
      1. 10.3.1 Importing scripts and libraries
      2. -
      3. 10.3.2 The WorkerNavigator object
      4. -
      5. 10.3.3 Interface objects and constructors
      6. -
      7. 10.3.4 Worker locations
  20. -
  21. 11 Web storage -
    1. 11.1 Introduction
    2. -
    3. 11.2 The API -
      1. 11.2.1 The Storage interface
      2. -
      3. 11.2.2 The sessionStorage attribute
      4. -
      5. 11.2.3 The localStorage attribute
      6. -
      7. 11.2.4 The storage event -
        1. 11.2.4.1 The StorageEvent interface
      8. -
      9. 11.2.5 Threads
    4. -
    5. 11.3 Disk space
    6. -
    7. 11.4 Privacy -
      1. 11.4.1 User tracking
      2. -
      3. 11.4.2 Sensitivity of data
    8. -
    9. 11.5 Security -
      1. 11.5.1 DNS spoofing attacks
      2. -
      3. 11.5.2 Cross-directory attacks
      4. -
      5. 11.5.3 Implementation risks
  22. -
  23. 12 The HTML syntax -
    1. 12.1 Writing HTML documents -
      1. 12.1.1 The DOCTYPE
      2. -
      3. 12.1.2 Elements -
        1. 12.1.2.1 Start tags
        2. -
        3. 12.1.2.2 End tags
        4. -
        5. 12.1.2.3 Attributes
        6. -
        7. 12.1.2.4 Optional tags
        8. -
        9. 12.1.2.5 Restrictions on content models
        10. -
        11. 12.1.2.6 Restrictions on the contents of raw text and escapable raw text elements
      4. -
      5. 12.1.3 Text -
        1. 12.1.3.1 Newlines
      6. -
      7. 12.1.4 Character references
      8. -
      9. 12.1.5 CDATA sections
      10. -
      11. 12.1.6 Comments
    2. -
    3. 12.2 Parsing HTML documents -
      1. 12.2.1 Overview of the parsing model
      2. -
      3. 12.2.2 The input byte stream -
        1. 12.2.2.1 Parsing with a known character encoding
        2. -
        3. 12.2.2.2 Determining the character encoding
        4. -
        5. 12.2.2.3 Character encodings
        6. -
        7. 12.2.2.4 Changing the encoding while parsing
        8. -
        9. 12.2.2.5 Preprocessing the input stream
      4. -
      5. 12.2.3 Parse state -
        1. 12.2.3.1 The insertion mode
        2. -
        3. 12.2.3.2 The stack of open elements
        4. -
        5. 12.2.3.3 The list of active formatting elements
        6. -
        7. 12.2.3.4 The element pointers
        8. -
        9. 12.2.3.5 Other parsing state flags
      6. -
      7. 12.2.4 Tokenization -
        1. 12.2.4.1 Data state
        2. -
        3. 12.2.4.2 Character reference in data state
        4. -
        5. 12.2.4.3 RCDATA state
        6. -
        7. 12.2.4.4 Character reference in RCDATA state
        8. -
        9. 12.2.4.5 RAWTEXT state
        10. -
        11. 12.2.4.6 Script data state
        12. -
        13. 12.2.4.7 PLAINTEXT state
        14. -
        15. 12.2.4.8 Tag open state
        16. -
        17. 12.2.4.9 End tag open state
        18. -
        19. 12.2.4.10 Tag name state
        20. -
        21. 12.2.4.11 RCDATA less-than sign state
        22. -
        23. 12.2.4.12 RCDATA end tag open state
        24. -
        25. 12.2.4.13 RCDATA end tag name state
        26. -
        27. 12.2.4.14 RAWTEXT less-than sign state
        28. -
        29. 12.2.4.15 RAWTEXT end tag open state
        30. -
        31. 12.2.4.16 RAWTEXT end tag name state
        32. -
        33. 12.2.4.17 Script data less-than sign state
        34. -
        35. 12.2.4.18 Script data end tag open state
        36. -
        37. 12.2.4.19 Script data end tag name state
        38. -
        39. 12.2.4.20 Script data escape start state
        40. -
        41. 12.2.4.21 Script data escape start dash state
        42. -
        43. 12.2.4.22 Script data escaped state
        44. -
        45. 12.2.4.23 Script data escaped dash state
        46. -
        47. 12.2.4.24 Script data escaped dash dash state
        48. -
        49. 12.2.4.25 Script data escaped less-than sign state
        50. -
        51. 12.2.4.26 Script data escaped end tag open state
        52. -
        53. 12.2.4.27 Script data escaped end tag name state
        54. -
        55. 12.2.4.28 Script data double escape start state
        56. -
        57. 12.2.4.29 Script data double escaped state
        58. -
        59. 12.2.4.30 Script data double escaped dash state
        60. -
        61. 12.2.4.31 Script data double escaped dash dash state
        62. -
        63. 12.2.4.32 Script data double escaped less-than sign state
        64. -
        65. 12.2.4.33 Script data double escape end state
        66. -
        67. 12.2.4.34 Before attribute name state
        68. -
        69. 12.2.4.35 Attribute name state
        70. -
        71. 12.2.4.36 After attribute name state
        72. -
        73. 12.2.4.37 Before attribute value state
        74. -
        75. 12.2.4.38 Attribute value (double-quoted) state
        76. -
        77. 12.2.4.39 Attribute value (single-quoted) state
        78. -
        79. 12.2.4.40 Attribute value (unquoted) state
        80. -
        81. 12.2.4.41 Character reference in attribute value state
        82. -
        83. 12.2.4.42 After attribute value (quoted) state
        84. -
        85. 12.2.4.43 Self-closing start tag state
        86. -
        87. 12.2.4.44 Bogus comment state
        88. -
        89. 12.2.4.45 Markup declaration open state
        90. -
        91. 12.2.4.46 Comment start state
        92. -
        93. 12.2.4.47 Comment start dash state
        94. -
        95. 12.2.4.48 Comment state
        96. -
        97. 12.2.4.49 Comment end dash state
        98. -
        99. 12.2.4.50 Comment end state
        100. -
        101. 12.2.4.51 Comment end bang state
        102. -
        103. 12.2.4.52 DOCTYPE state
        104. -
        105. 12.2.4.53 Before DOCTYPE name state
        106. -
        107. 12.2.4.54 DOCTYPE name state
        108. -
        109. 12.2.4.55 After DOCTYPE name state
        110. -
        111. 12.2.4.56 After DOCTYPE public keyword state
        112. -
        113. 12.2.4.57 Before DOCTYPE public identifier state
        114. -
        115. 12.2.4.58 DOCTYPE public identifier (double-quoted) state
        116. -
        117. 12.2.4.59 DOCTYPE public identifier (single-quoted) state
        118. -
        119. 12.2.4.60 After DOCTYPE public identifier state
        120. -
        121. 12.2.4.61 Between DOCTYPE public and system identifiers state
        122. -
        123. 12.2.4.62 After DOCTYPE system keyword state
        124. -
        125. 12.2.4.63 Before DOCTYPE system identifier state
        126. -
        127. 12.2.4.64 DOCTYPE system identifier (double-quoted) state
        128. -
        129. 12.2.4.65 DOCTYPE system identifier (single-quoted) state
        130. -
        131. 12.2.4.66 After DOCTYPE system identifier state
        132. -
        133. 12.2.4.67 Bogus DOCTYPE state
        134. -
        135. 12.2.4.68 CDATA section state
        136. -
        137. 12.2.4.69 Tokenizing character references
      8. -
      9. 12.2.5 Tree construction -
        1. 12.2.5.1 Creating and inserting nodes
        2. -
        3. 12.2.5.2 Parsing elements that contain only text
        4. -
        5. 12.2.5.3 Closing elements that have implied end tags
        6. -
        7. 12.2.5.4 The rules for parsing tokens in HTML content -
          1. 12.2.5.4.1 The "initial" insertion mode
          2. -
          3. 12.2.5.4.2 The "before html" insertion mode
          4. -
          5. 12.2.5.4.3 The "before head" insertion mode
          6. -
          7. 12.2.5.4.4 The "in head" insertion mode
          8. -
          9. 12.2.5.4.5 The "in head noscript" insertion mode
          10. -
          11. 12.2.5.4.6 The "after head" insertion mode
          12. -
          13. 12.2.5.4.7 The "in body" insertion mode
          14. -
          15. 12.2.5.4.8 The "text" insertion mode
          16. -
          17. 12.2.5.4.9 The "in table" insertion mode
          18. -
          19. 12.2.5.4.10 The "in table text" insertion mode
          20. -
          21. 12.2.5.4.11 The "in caption" insertion mode
          22. -
          23. 12.2.5.4.12 The "in column group" insertion mode
          24. -
          25. 12.2.5.4.13 The "in table body" insertion mode
          26. -
          27. 12.2.5.4.14 The "in row" insertion mode
          28. -
          29. 12.2.5.4.15 The "in cell" insertion mode
          30. -
          31. 12.2.5.4.16 The "in select" insertion mode
          32. -
          33. 12.2.5.4.17 The "in select in table" insertion mode
          34. -
          35. 12.2.5.4.18 The "in template" insertion mode
          36. -
          37. 12.2.5.4.19 The "after body" insertion mode
          38. -
          39. 12.2.5.4.20 The "in frameset" insertion mode
          40. -
          41. 12.2.5.4.21 The "after frameset" insertion mode
          42. -
          43. 12.2.5.4.22 The "after after body" insertion mode
          44. -
          45. 12.2.5.4.23 The "after after frameset" insertion mode
        8. -
        9. 12.2.5.5 The rules for parsing tokens in foreign content
      10. -
      11. 12.2.6 The end
      12. -
      13. 12.2.7 Coercing an HTML DOM into an infoset
      14. -
      15. 12.2.8 An introduction to error handling and strange cases in the parser -
        1. 12.2.8.1 Misnested tags: <b><i></b></i>
        2. -
        3. 12.2.8.2 Misnested tags: <b><p></b></p>
        4. -
        5. 12.2.8.3 Unexpected markup in tables
        6. -
        7. 12.2.8.4 Scripts that modify the page as it is being parsed
        8. -
        9. 12.2.8.5 The execution of scripts that are moving across multiple documents
        10. -
        11. 12.2.8.6 Unclosed formatting elements
    4. -
    5. 12.3 Serializing HTML fragments
    6. -
    7. 12.4 Parsing HTML fragments
    8. -
    9. 12.5 Named character references
  24. -
  25. 13 The XHTML syntax -
    1. 13.1 Writing XHTML documents
    2. -
    3. 13.2 Parsing XHTML documents
    4. -
    5. 13.3 Serializing XHTML fragments
    6. -
    7. 13.4 Parsing XHTML fragments
  26. -
  27. 14 Rendering -
    1. 14.1 Introduction
    2. -
    3. 14.2 The CSS user agent style sheet and presentational hints
    4. -
    5. 14.3 Non-replaced elements -
      1. 14.3.1 Hidden elements
      2. -
      3. 14.3.2 The page
      4. -
      5. 14.3.3 Flow content
      6. -
      7. 14.3.4 Phrasing content
      8. -
      9. 14.3.5 Bidirectional text
      10. -
      11. 14.3.6 Quotes
      12. -
      13. 14.3.7 Sections and headings
      14. -
      15. 14.3.8 Lists
      16. -
      17. 14.3.9 Tables
      18. -
      19. 14.3.10 Margin collapsing quirks
      20. -
      21. 14.3.11 Form controls
      22. -
      23. 14.3.12 The hr element
      24. -
      25. 14.3.13 The fieldset and legend elements
    6. -
    7. 14.4 Replaced elements -
      1. 14.4.1 Embedded content
      2. -
      3. 14.4.2 Images
      4. -
      5. 14.4.3 Attributes for embedded content and images
      6. -
      7. 14.4.4 Image maps
    8. -
    9. 14.5 Bindings -
      1. 14.5.1 Introduction
      2. -
      3. 14.5.2 The button element
      4. -
      5. 14.5.3 The details element
      6. -
      7. 14.5.4 The input element as a text entry widget
      8. -
      9. 14.5.5 The input element as domain-specific widgets
      10. -
      11. 14.5.6 The input element as a range control
      12. -
      13. 14.5.7 The input element as a color well
      14. -
      15. 14.5.8 The input element as a checkbox and radio button widgets
      16. -
      17. 14.5.9 The input element as a file upload control
      18. -
      19. 14.5.10 The input element as a button
      20. -
      21. 14.5.11 The marquee element
      22. -
      23. 14.5.12 The meter element
      24. -
      25. 14.5.13 The progress element
      26. -
      27. 14.5.14 The select element
      28. -
      29. 14.5.15 The textarea element
      30. -
      31. 14.5.16 The keygen element
    10. -
    11. 14.6 Frames and framesets
    12. -
    13. 14.7 Interactive media -
      1. 14.7.1 Links, forms, and navigation
      2. -
      3. 14.7.2 The title attribute
      4. -
      5. 14.7.3 Editing hosts
      6. -
      7. 14.7.4 Text rendered in native user interfaces
    14. -
    15. 14.8 Print media
    16. -
    17. 14.9 Unstyled XML documents
  28. -
  29. 15 Obsolete features -
    1. 15.1 Obsolete but conforming features -
      1. 15.1.1 Warnings for obsolete but conforming features
    2. -
    3. 15.2 Non-conforming features
    4. -
    5. 15.3 Requirements for implementations -
      1. 15.3.1 The applet element
      2. -
      3. 15.3.2 The marquee element
      4. -
      5. 15.3.3 Frames
      6. -
      7. 15.3.4 Other elements, attributes and APIs
  30. -
  31. 16 IANA considerations -
    1. 16.1 text/html
    2. -
    3. 16.2 multipart/x-mixed-replace
    4. -
    5. 16.3 application/xhtml+xml
    6. -
    7. 16.4 application/x-www-form-urlencoded
    8. -
    9. 16.5 text/cache-manifest
    10. -
    11. 16.6 text/ping
    12. -
    13. 16.7 application/microdata+json
    14. -
    15. 16.8 Ping-From
    16. -
    17. 16.9 Ping-To
    18. -
    19. 16.10 web+ scheme prefix
  32. -
  33. Index -
    1. Elements
    2. -
    3. Element content categories
    4. -
    5. Attributes
    6. -
    7. Element Interfaces
    8. -
    9. All Interfaces
    10. -
    11. Events
  34. -
  35. References
  36. + +HTML Standard + +

    Table of contents

    + + +
    1. 1 Introduction +
      1. 1.1 Where does this specification fit?
      2. +
      3. 1.2 Is this HTML5?
      4. +
      5. 1.3 Background
      6. +
      7. 1.4 Audience
      8. +
      9. 1.5 Scope
      10. +
      11. 1.6 History
      12. +
      13. 1.7 Design notes +
        1. 1.7.1 Serializability of script execution
        2. +
        3. 1.7.2 Compliance with other specifications
        4. +
        5. 1.7.3 Extensibility
      14. +
      15. 1.8 HTML vs XHTML
      16. +
      17. 1.9 Structure of this specification +
        1. 1.9.1 How to read this specification
        2. +
        3. 1.9.2 Typographic conventions
      18. +
      19. 1.10 Privacy concerns
      20. +
      21. 1.11 A quick introduction to HTML +
        1. 1.11.1 Writing secure applications with HTML
        2. +
        3. 1.11.2 Common pitfalls to avoid when using the scripting APIs
        4. +
        5. 1.11.3 How to catch mistakes when writing HTML: validators and conformance checkers
      22. +
      23. 1.12 Conformance requirements for authors +
        1. 1.12.1 Presentational markup
        2. +
        3. 1.12.2 Syntax errors
        4. +
        5. 1.12.3 Restrictions on content models and on attribute values
      24. +
      25. 1.13 Suggested reading
    2. +
    3. 2 Common infrastructure +
      1. 2.1 Terminology +
        1. 2.1.1 Resources
        2. +
        3. 2.1.2 XML
        4. +
        5. 2.1.3 DOM trees
        6. +
        7. 2.1.4 Scripting
        8. +
        9. 2.1.5 Plugins
        10. +
        11. 2.1.6 Character encodings
      2. +
      3. 2.2 Conformance requirements +
        1. 2.2.1 Conformance classes
        2. +
        3. 2.2.2 Dependencies
        4. +
        5. 2.2.3 Extensibility
        6. +
        7. 2.2.4 Interactions with XPath and XSLT
      4. +
      5. 2.3 Case-sensitivity and string comparison
      6. +
      7. 2.4 Common microsyntaxes +
        1. 2.4.1 Common parser idioms
        2. +
        3. 2.4.2 Boolean attributes
        4. +
        5. 2.4.3 Keywords and enumerated attributes
        6. +
        7. 2.4.4 Numbers +
          1. 2.4.4.1 Signed integers
          2. +
          3. 2.4.4.2 Non-negative integers
          4. +
          5. 2.4.4.3 Floating-point numbers
          6. +
          7. 2.4.4.4 Percentages and lengths
          8. +
          9. 2.4.4.5 Lists of integers
          10. +
          11. 2.4.4.6 Lists of dimensions
        8. +
        9. 2.4.5 Dates and times +
          1. 2.4.5.1 Months
          2. +
          3. 2.4.5.2 Dates
          4. +
          5. 2.4.5.3 Yearless dates
          6. +
          7. 2.4.5.4 Times
          8. +
          9. 2.4.5.5 Local dates and times
          10. +
          11. 2.4.5.6 Time zones
          12. +
          13. 2.4.5.7 Global dates and times
          14. +
          15. 2.4.5.8 Weeks
          16. +
          17. 2.4.5.9 Durations
          18. +
          19. 2.4.5.10 Vaguer moments in time
        10. +
        11. 2.4.6 Colors
        12. +
        13. 2.4.7 Space-separated tokens
        14. +
        15. 2.4.8 Comma-separated tokens
        16. +
        17. 2.4.9 References
        18. +
        19. 2.4.10 Media queries
      8. +
      9. 2.5 URLs +
        1. 2.5.1 Terminology
        2. +
        3. 2.5.2 Resolving URLs
        4. +
        5. 2.5.3 Dynamic changes to base URLs
      10. +
      11. 2.6 Fetching resources +
        1. 2.6.1 Terminology
        2. +
        3. 2.6.2 Processing model
        4. +
        5. 2.6.3 Encrypted HTTP and related security concerns
        6. +
        7. 2.6.4 Determining the type of a resource
        8. +
        9. 2.6.5 Extracting character encodings from meta elements
        10. +
        11. 2.6.6 CORS settings attributes
        12. +
        13. 2.6.7 CORS-enabled fetch
      12. +
      13. 2.7 Common DOM interfaces +
        1. 2.7.1 Reflecting content attributes in IDL attributes
        2. +
        3. 2.7.2 Collections +
          1. 2.7.2.1 HTMLAllCollection
          2. +
          3. 2.7.2.2 HTMLFormControlsCollection
          4. +
          5. 2.7.2.3 HTMLOptionsCollection
          6. +
          7. 2.7.2.4 HTMLPropertiesCollection
        4. +
        5. 2.7.3 DOMStringMap
        6. +
        7. 2.7.4 DOMElementMap
        8. +
        9. 2.7.5 Transferable objects
        10. +
        11. 2.7.6 Safe passing of structured data
        12. +
        13. 2.7.7 Callbacks
        14. +
        15. 2.7.8 Garbage collection
      14. +
      15. 2.8 Namespaces
    4. +
    5. 3 Semantics, structure, and APIs of HTML documents +
      1. 3.1 Documents +
        1. 3.1.1 The Document object
        2. +
        3. 3.1.2 Resource metadata management
        4. +
        5. 3.1.3 DOM tree accessors
        6. +
        7. 3.1.4 Loading XML documents
      2. +
      3. 3.2 Elements +
        1. 3.2.1 Semantics
        2. +
        3. 3.2.2 Elements in the DOM
        4. +
        5. 3.2.3 Element definitions +
          1. 3.2.3.1 Attributes
        6. +
        7. 3.2.4 Content models +
          1. 3.2.4.1 Kinds of content +
            1. 3.2.4.1.1 Metadata content
            2. +
            3. 3.2.4.1.2 Flow content
            4. +
            5. 3.2.4.1.3 Sectioning content
            6. +
            7. 3.2.4.1.4 Heading content
            8. +
            9. 3.2.4.1.5 Phrasing content
            10. +
            11. 3.2.4.1.6 Embedded content
            12. +
            13. 3.2.4.1.7 Interactive content
            14. +
            15. 3.2.4.1.8 Palpable content
            16. +
            17. 3.2.4.1.9 Script-supporting elements
          2. +
          3. 3.2.4.2 Transparent content models
          4. +
          5. 3.2.4.3 Paragraphs
        8. +
        9. 3.2.5 Global attributes +
          1. 3.2.5.1 The id attribute
          2. +
          3. 3.2.5.2 The title attribute
          4. +
          5. 3.2.5.3 The lang and xml:lang attributes
          6. +
          7. 3.2.5.4 The translate attribute
          8. +
          9. 3.2.5.5 The xml:base attribute (XML only)
          10. +
          11. 3.2.5.6 The dir attribute
          12. +
          13. 3.2.5.7 The class attribute
          14. +
          15. 3.2.5.8 The style attribute
          16. +
          17. 3.2.5.9 Embedding custom non-visible data with the data-* attributes
        10. +
        11. 3.2.6 Requirements relating to the bidirectional algorithm +
          1. 3.2.6.1 Authoring conformance criteria for bidirectional-algorithm formatting characters
          2. +
          3. 3.2.6.2 User agent conformance criteria
        12. +
        13. 3.2.7 WAI-ARIA
    6. +
    7. 4 The elements of HTML +
      1. 4.1 The root element +
        1. 4.1.1 The html element
      2. +
      3. 4.2 Document metadata +
        1. 4.2.1 The head element
        2. +
        3. 4.2.2 The title element
        4. +
        5. 4.2.3 The base element
        6. +
        7. 4.2.4 The link element
        8. +
        9. 4.2.5 The meta element +
          1. 4.2.5.1 Standard metadata names
          2. +
          3. 4.2.5.2 Other metadata names
          4. +
          5. 4.2.5.3 Pragma directives
          6. +
          7. 4.2.5.4 Other pragma directives
          8. +
          9. 4.2.5.5 Specifying the document's character encoding
        10. +
        11. 4.2.6 The style element +
          1. 4.2.6.1 The @global rule
        12. +
        13. 4.2.7 Interactions of styling and scripting
      4. +
      5. 4.3 Sections +
        1. 4.3.1 The body element
        2. +
        3. 4.3.2 The article element
        4. +
        5. 4.3.3 The section element
        6. +
        7. 4.3.4 The nav element
        8. +
        9. 4.3.5 The aside element
        10. +
        11. 4.3.6 The h1, h2, h3, h4, h5, and +h6 elements
        12. +
        13. 4.3.7 The hgroup element
        14. +
        15. 4.3.8 The header element
        16. +
        17. 4.3.9 The footer element
        18. +
        19. 4.3.10 The address element
        20. +
        21. 4.3.11 Headings and sections +
          1. 4.3.11.1 Creating an outline
          2. +
          3. 4.3.11.2 Sample outlines
        22. +
        23. 4.3.12 Usage summary +
          1. 4.3.12.1 Article or section?
      6. +
      7. 4.4 Grouping content +
        1. 4.4.1 The p element
        2. +
        3. 4.4.2 The hr element
        4. +
        5. 4.4.3 The pre element
        6. +
        7. 4.4.4 The blockquote element
        8. +
        9. 4.4.5 The ol element
        10. +
        11. 4.4.6 The ul element
        12. +
        13. 4.4.7 The li element
        14. +
        15. 4.4.8 The dl element
        16. +
        17. 4.4.9 The dt element
        18. +
        19. 4.4.10 The dd element
        20. +
        21. 4.4.11 The figure element
        22. +
        23. 4.4.12 The figcaption element
        24. +
        25. 4.4.13 The main element
        26. +
        27. 4.4.14 The div element
      8. +
      9. 4.5 Text-level semantics +
        1. 4.5.1 The a element
        2. +
        3. 4.5.2 The em element
        4. +
        5. 4.5.3 The strong element
        6. +
        7. 4.5.4 The small element
        8. +
        9. 4.5.5 The s element
        10. +
        11. 4.5.6 The cite element
        12. +
        13. 4.5.7 The q element
        14. +
        15. 4.5.8 The dfn element
        16. +
        17. 4.5.9 The abbr element
        18. +
        19. 4.5.10 The data element
        20. +
        21. 4.5.11 The time element
        22. +
        23. 4.5.12 The code element
        24. +
        25. 4.5.13 The var element
        26. +
        27. 4.5.14 The samp element
        28. +
        29. 4.5.15 The kbd element
        30. +
        31. 4.5.16 The sub and sup elements
        32. +
        33. 4.5.17 The i element
        34. +
        35. 4.5.18 The b element
        36. +
        37. 4.5.19 The u element
        38. +
        39. 4.5.20 The mark element
        40. +
        41. 4.5.21 The ruby element
        42. +
        43. 4.5.22 The rt element
        44. +
        45. 4.5.23 The rp element
        46. +
        47. 4.5.24 The bdi element
        48. +
        49. 4.5.25 The bdo element
        50. +
        51. 4.5.26 The span element
        52. +
        53. 4.5.27 The br element
        54. +
        55. 4.5.28 The wbr element
        56. +
        57. 4.5.29 Usage summary
      10. +
      11. 4.6 Edits +
        1. 4.6.1 The ins element
        2. +
        3. 4.6.2 The del element
        4. +
        5. 4.6.3 Attributes common to ins and del elements
        6. +
        7. 4.6.4 Edits and paragraphs
        8. +
        9. 4.6.5 Edits and lists
        10. +
        11. 4.6.6 Edits and tables
      12. +
      13. 4.7 Embedded content +
        1. 4.7.1 The img element +
          1. 4.7.1.1 Requirements for providing text to act as an alternative for images +
            1. 4.7.1.1.1 General guidelines
            2. +
            3. 4.7.1.1.2 A link or button containing nothing but the image
            4. +
            5. 4.7.1.1.3 A phrase or paragraph with an alternative graphical representation: charts, diagrams, graphs, maps, illustrations
            6. +
            7. 4.7.1.1.4 A short phrase or label with an alternative graphical representation: icons, logos
            8. +
            9. 4.7.1.1.5 Text that has been rendered to a graphic for typographical effect
            10. +
            11. 4.7.1.1.6 A graphical representation of some of the surrounding text
            12. +
            13. 4.7.1.1.7 A purely decorative image that doesn't add any information
            14. +
            15. 4.7.1.1.8 A group of images that form a single larger picture with no links
            16. +
            17. 4.7.1.1.9 A group of images that form a single larger picture with links
            18. +
            19. 4.7.1.1.10 A key part of the content
            20. +
            21. 4.7.1.1.11 An image not intended for the user
            22. +
            23. 4.7.1.1.12 An image in an e-mail or private document intended for a specific person who is known to be able to view images
            24. +
            25. 4.7.1.1.13 Guidance for markup generators
            26. +
            27. 4.7.1.1.14 Guidance for conformance checkers
          2. +
          3. 4.7.1.2 Adaptive images
        2. +
        3. 4.7.2 The iframe element
        4. +
        5. 4.7.3 The embed element
        6. +
        7. 4.7.4 The object element
        8. +
        9. 4.7.5 The param element
        10. +
        11. 4.7.6 The video element
        12. +
        13. 4.7.7 The audio element
        14. +
        15. 4.7.8 The source element
        16. +
        17. 4.7.9 The track element
        18. +
        19. 4.7.10 Media elements +
          1. 4.7.10.1 Error codes
          2. +
          3. 4.7.10.2 Location of the media resource
          4. +
          5. 4.7.10.3 MIME types
          6. +
          7. 4.7.10.4 Network states
          8. +
          9. 4.7.10.5 Loading the media resource
          10. +
          11. 4.7.10.6 Offsets into the media resource
          12. +
          13. 4.7.10.7 Ready states
          14. +
          15. 4.7.10.8 Playing the media resource
          16. +
          17. 4.7.10.9 Seeking
          18. +
          19. 4.7.10.10 Media resources with multiple media tracks +
            1. 4.7.10.10.1 AudioTrackList and VideoTrackList objects
            2. +
            3. 4.7.10.10.2 Selecting specific audio and video tracks declaratively
          20. +
          21. 4.7.10.11 Synchronising multiple media elements +
            1. 4.7.10.11.1 Introduction
            2. +
            3. 4.7.10.11.2 Media controllers
            4. +
            5. 4.7.10.11.3 Assigning a media controller declaratively
          22. +
          23. 4.7.10.12 Timed text tracks +
            1. 4.7.10.12.1 Text track model
            2. +
            3. 4.7.10.12.2 Sourcing in-band text tracks
            4. +
            5. 4.7.10.12.3 Sourcing out-of-band text tracks
            6. +
            7. 4.7.10.12.4 Guidelines for exposing cues in various formats as text track cues
            8. +
            9. 4.7.10.12.5 Text track API
            10. +
            11. 4.7.10.12.6 Text tracks describing chapters
            12. +
            13. 4.7.10.12.7 Event handlers for objects of the text track APIs
            14. +
            15. 4.7.10.12.8 Best practices for metadata text tracks
          24. +
          25. 4.7.10.13 User interface
          26. +
          27. 4.7.10.14 Time ranges
          28. +
          29. 4.7.10.15 The TrackEvent interface
          30. +
          31. 4.7.10.16 Event summary
          32. +
          33. 4.7.10.17 Security and privacy considerations
          34. +
          35. 4.7.10.18 Best practices for authors using media elements
          36. +
          37. 4.7.10.19 Best practices for implementors of media elements
        20. +
        21. 4.7.11 The map element
        22. +
        23. 4.7.12 The area element
        24. +
        25. 4.7.13 Image maps +
          1. 4.7.13.1 Authoring
          2. +
          3. 4.7.13.2 Processing model
        26. +
        27. 4.7.14 MathML
        28. +
        29. 4.7.15 SVG
        30. +
        31. 4.7.16 Dimension attributes
      14. +
      15. 4.8 Links +
        1. 4.8.1 Introduction
        2. +
        3. 4.8.2 Links created by a and area elements
        4. +
        5. 4.8.3 Following hyperlinks
        6. +
        7. 4.8.4 Downloading resources +
          1. 4.8.4.1 Hyperlink auditing
        8. +
        9. 4.8.5 Link types +
          1. 4.8.5.1 Link type "alternate"
          2. +
          3. 4.8.5.2 Link type "author"
          4. +
          5. 4.8.5.3 Link type "bookmark"
          6. +
          7. 4.8.5.4 Link type "external"
          8. +
          9. 4.8.5.5 Link type "help"
          10. +
          11. 4.8.5.6 Link type "icon"
          12. +
          13. 4.8.5.7 Link type "license"
          14. +
          15. 4.8.5.8 Link type "nofollow"
          16. +
          17. 4.8.5.9 Link type "noreferrer"
          18. +
          19. 4.8.5.10 Link type "pingback"
          20. +
          21. 4.8.5.11 Link type "prefetch"
          22. +
          23. 4.8.5.12 Link type "search"
          24. +
          25. 4.8.5.13 Link type "sidebar"
          26. +
          27. 4.8.5.14 Link type "stylesheet"
          28. +
          29. 4.8.5.15 Link type "tag"
          30. +
          31. 4.8.5.16 Sequential link types +
            1. 4.8.5.16.1 Link type "next"
            2. +
            3. 4.8.5.16.2 Link type "prev"
          32. +
          33. 4.8.5.17 Other link types
      16. +
      17. 4.9 Tabular data +
        1. 4.9.1 The table element +
          1. 4.9.1.1 Techniques for describing tables
          2. +
          3. 4.9.1.2 Techniques for table design
        2. +
        3. 4.9.2 The caption element
        4. +
        5. 4.9.3 The colgroup element
        6. +
        7. 4.9.4 The col element
        8. +
        9. 4.9.5 The tbody element
        10. +
        11. 4.9.6 The thead element
        12. +
        13. 4.9.7 The tfoot element
        14. +
        15. 4.9.8 The tr element
        16. +
        17. 4.9.9 The td element
        18. +
        19. 4.9.10 The th element
        20. +
        21. 4.9.11 Attributes common to td and th elements
        22. +
        23. 4.9.12 Processing model +
          1. 4.9.12.1 Forming a table
          2. +
          3. 4.9.12.2 Forming relationships between data cells and header cells
        24. +
        25. 4.9.13 Table sorting model
        26. +
        27. 4.9.14 Examples
      18. +
      19. 4.10 Forms +
        1. 4.10.1 Introduction +
          1. 4.10.1.1 Writing a form's user interface
          2. +
          3. 4.10.1.2 Implementing the server-side processing for a form
          4. +
          5. 4.10.1.3 Configuring a form to communicate with a server
          6. +
          7. 4.10.1.4 Client-side form validation
          8. +
          9. 4.10.1.5 Enabling client-side automatic filling of form controls
          10. +
          11. 4.10.1.6 Improving the user experience on mobile devices
          12. +
          13. 4.10.1.7 The difference between the field type, the autofill field name, and the input modality
          14. +
          15. 4.10.1.8 Date, time, and number formats
        2. +
        3. 4.10.2 Categories
        4. +
        5. 4.10.3 The form element
        6. +
        7. 4.10.4 The label element
        8. +
        9. 4.10.5 The input element +
          1. 4.10.5.1 States of the type attribute +
            1. 4.10.5.1.1 Hidden state (type=hidden)
            2. +
            3. 4.10.5.1.2 Text (type=text) state and Search state (type=search)
            4. +
            5. 4.10.5.1.3 Telephone state (type=tel)
            6. +
            7. 4.10.5.1.4 URL state (type=url)
            8. +
            9. 4.10.5.1.5 E-mail state (type=email)
            10. +
            11. 4.10.5.1.6 Password state (type=password)
            12. +
            13. 4.10.5.1.7 Date and Time state (type=datetime)
            14. +
            15. 4.10.5.1.8 Date state (type=date)
            16. +
            17. 4.10.5.1.9 Month state (type=month)
            18. +
            19. 4.10.5.1.10 Week state (type=week)
            20. +
            21. 4.10.5.1.11 Time state (type=time)
            22. +
            23. 4.10.5.1.12 Local Date and Time state (type=datetime-local)
            24. +
            25. 4.10.5.1.13 Number state (type=number)
            26. +
            27. 4.10.5.1.14 Range state (type=range)
            28. +
            29. 4.10.5.1.15 Color state (type=color)
            30. +
            31. 4.10.5.1.16 Checkbox state (type=checkbox)
            32. +
            33. 4.10.5.1.17 Radio Button state (type=radio)
            34. +
            35. 4.10.5.1.18 File Upload state (type=file)
            36. +
            37. 4.10.5.1.19 Submit Button state (type=submit)
            38. +
            39. 4.10.5.1.20 Image Button state (type=image)
            40. +
            41. 4.10.5.1.21 Reset Button state (type=reset)
            42. +
            43. 4.10.5.1.22 Button state (type=button)
          2. +
          3. 4.10.5.2 Implemention notes regarding localization of form controls
          4. +
          5. 4.10.5.3 Common input element attributes +
            1. 4.10.5.3.1 The maxlength and minlength attributes
            2. +
            3. 4.10.5.3.2 The size attribute
            4. +
            5. 4.10.5.3.3 The readonly attribute
            6. +
            7. 4.10.5.3.4 The required attribute
            8. +
            9. 4.10.5.3.5 The multiple attribute
            10. +
            11. 4.10.5.3.6 The pattern attribute
            12. +
            13. 4.10.5.3.7 The min and max attributes
            14. +
            15. 4.10.5.3.8 The step attribute
            16. +
            17. 4.10.5.3.9 The list attribute
            18. +
            19. 4.10.5.3.10 The placeholder attribute
          6. +
          7. 4.10.5.4 Common input element APIs
          8. +
          9. 4.10.5.5 Common event behaviors
        10. +
        11. 4.10.6 The button element
        12. +
        13. 4.10.7 The select element
        14. +
        15. 4.10.8 The datalist element
        16. +
        17. 4.10.9 The optgroup element
        18. +
        19. 4.10.10 The option element
        20. +
        21. 4.10.11 The textarea element
        22. +
        23. 4.10.12 The keygen element
        24. +
        25. 4.10.13 The output element
        26. +
        27. 4.10.14 The progress element
        28. +
        29. 4.10.15 The meter element
        30. +
        31. 4.10.16 The fieldset element
        32. +
        33. 4.10.17 The legend element
        34. +
        35. 4.10.18 Form control infrastructure +
          1. 4.10.18.1 A form control's value
          2. +
          3. 4.10.18.2 Mutability
          4. +
          5. 4.10.18.3 Association of controls and forms
        36. +
        37. 4.10.19 Attributes common to form controls +
          1. 4.10.19.1 Naming form controls: the name attribute
          2. +
          3. 4.10.19.2 Submitting element directionality: the dirname attribute
          4. +
          5. 4.10.19.3 Limiting user input length: the maxlength attribute
          6. +
          7. 4.10.19.4 Setting minimum input length requirements: the minlength attribute
          8. +
          9. 4.10.19.5 Enabling and disabling form controls: the disabled attribute
          10. +
          11. 4.10.19.6 Form submission
          12. +
          13. 4.10.19.7 Autofocusing a form control: the autofocus attribute
          14. +
          15. 4.10.19.8 Input modalities: the inputmode attribute
          16. +
          17. 4.10.19.9 Autofilling form controls: the autocomplete attribute
        38. +
        39. 4.10.20 APIs for the text field selections
        40. +
        41. 4.10.21 Constraints +
          1. 4.10.21.1 Definitions
          2. +
          3. 4.10.21.2 Constraint validation
          4. +
          5. 4.10.21.3 The constraint validation API
          6. +
          7. 4.10.21.4 Security
        42. +
        43. 4.10.22 Form submission +
          1. 4.10.22.1 Introduction
          2. +
          3. 4.10.22.2 Implicit submission
          4. +
          5. 4.10.22.3 Form submission algorithm
          6. +
          7. 4.10.22.4 Constructing the form data set
          8. +
          9. 4.10.22.5 Selecting a form submission encoding
          10. +
          11. 4.10.22.6 URL-encoded form data
          12. +
          13. 4.10.22.7 Multipart form data
          14. +
          15. 4.10.22.8 Plain text form data
        44. +
        45. 4.10.23 Resetting a form
      20. +
      21. 4.11 Interactive elements +
        1. 4.11.1 The details element
        2. +
        3. 4.11.2 The summary element
        4. +
        5. 4.11.3 The menu element
        6. +
        7. 4.11.4 The menuitem element
        8. +
        9. 4.11.5 Context menus +
          1. 4.11.5.1 Declaring a context menu
          2. +
          3. 4.11.5.2 Processing model
          4. +
          5. 4.11.5.3 The RelatedEvent interfaces
        10. +
        11. 4.11.6 Commands +
          1. 4.11.6.1 Facets
          2. +
          3. 4.11.6.2 Using the a element to define a command
          4. +
          5. 4.11.6.3 Using the button element to define a command
          6. +
          7. 4.11.6.4 Using the input element to define a command
          8. +
          9. 4.11.6.5 Using the option element to define a command
          10. +
          11. 4.11.6.6 Using the menuitem element to define a +command
          12. +
          13. 4.11.6.7 Using the command attribute on menuitem elements to define +a command indirectly
          14. +
          15. 4.11.6.8 Using the accesskey attribute +on a label element to define a command
          16. +
          17. 4.11.6.9 Using the accesskey attribute +on a legend element to define a command
          18. +
          19. 4.11.6.10 Using the accesskey +attribute to define a command on other elements
        12. +
        13. 4.11.7 The dialog element +
          1. 4.11.7.1 Anchor points
      22. +
      23. 4.12 Scripting +
        1. 4.12.1 The script element +
          1. 4.12.1.1 Scripting languages
          2. +
          3. 4.12.1.2 Restrictions for contents of script elements
          4. +
          5. 4.12.1.3 Inline documentation for external scripts
          6. +
          7. 4.12.1.4 Interaction of script elements and XSLT
        2. +
        3. 4.12.2 The noscript element
        4. +
        5. 4.12.3 The template element +
          1. 4.12.3.1 Interaction of template elements with XSLT and XPath
        6. +
        7. 4.12.4 The canvas element +
          1. 4.12.4.1 Proxying canvases to workers
          2. +
          3. 4.12.4.2 The 2D rendering context +
            1. 4.12.4.2.1 Implementation notes
            2. +
            3. 4.12.4.2.2 The canvas state
            4. +
            5. 4.12.4.2.3 DrawingStyle objects
            6. +
            7. 4.12.4.2.4 Line styles
            8. +
            9. 4.12.4.2.5 Text styles
            10. +
            11. 4.12.4.2.6 Building paths
            12. +
            13. 4.12.4.2.7 Path objects
            14. +
            15. 4.12.4.2.8 Transformations
            16. +
            17. 4.12.4.2.9 Image sources for 2D rendering contexts
            18. +
            19. 4.12.4.2.10 Fill and stroke styles
            20. +
            21. 4.12.4.2.11 Drawing rectangles to the bitmap
            22. +
            23. 4.12.4.2.12 Drawing text to the bitmap
            24. +
            25. 4.12.4.2.13 Drawing paths to the canvas
            26. +
            27. 4.12.4.2.14 Drawing images
            28. +
            29. 4.12.4.2.15 Hit regions
            30. +
            31. 4.12.4.2.16 Pixel manipulation
            32. +
            33. 4.12.4.2.17 Compositing
            34. +
            35. 4.12.4.2.18 Image smoothing
            36. +
            37. 4.12.4.2.19 Shadows
            38. +
            39. 4.12.4.2.20 Drawing model
            40. +
            41. 4.12.4.2.21 Best practices
            42. +
            43. 4.12.4.2.22 Examples
          4. +
          5. 4.12.4.3 Color spaces and color correction
          6. +
          7. 4.12.4.4 Serializing bitmaps to a file
          8. +
          9. 4.12.4.5 Security with canvas elements
      24. +
      25. 4.13 Common idioms without dedicated elements +
        1. 4.13.1 The main part of the content
        2. +
        3. 4.13.2 Bread crumb navigation
        4. +
        5. 4.13.3 Tag clouds
        6. +
        7. 4.13.4 Conversations
        8. +
        9. 4.13.5 Footnotes
      26. +
      27. 4.14 Disabled elements
      28. +
      29. 4.15 Matching HTML elements using selectors +
        1. 4.15.1 Case-sensitivity
        2. +
        3. 4.15.2 Pseudo-classes
    8. +
    9. 5 Microdata +
      1. 5.1 Introduction +
        1. 5.1.1 Overview
        2. +
        3. 5.1.2 The basic syntax
        4. +
        5. 5.1.3 Typed items
        6. +
        7. 5.1.4 Global identifiers for items
        8. +
        9. 5.1.5 Selecting names when defining vocabularies
        10. +
        11. 5.1.6 Using the microdata DOM API
      2. +
      3. 5.2 Encoding microdata +
        1. 5.2.1 The microdata model
        2. +
        3. 5.2.2 Items
        4. +
        5. 5.2.3 Names: the itemprop attribute
        6. +
        7. 5.2.4 Values
        8. +
        9. 5.2.5 Associating names with items
        10. +
        11. 5.2.6 Microdata and other namespaces
      4. +
      5. 5.3 Microdata DOM API
      6. +
      7. 5.4 Sample microdata vocabularies +
        1. 5.4.1 vCard +
          1. 5.4.1.1 Conversion to vCard
          2. +
          3. 5.4.1.2 Examples
        2. +
        3. 5.4.2 vEvent +
          1. 5.4.2.1 Conversion to iCalendar
          2. +
          3. 5.4.2.2 Examples
        4. +
        5. 5.4.3 Licensing works +
          1. 5.4.3.1 Examples
      8. +
      9. 5.5 Converting HTML to other formats +
        1. 5.5.1 JSON
    10. +
    11. 6 Loading Web pages +
      1. 6.1 Browsing contexts +
        1. 6.1.1 Nested browsing contexts +
          1. 6.1.1.1 Navigating nested browsing contexts in the DOM
        2. +
        3. 6.1.2 Auxiliary browsing contexts +
          1. 6.1.2.1 Navigating auxiliary browsing contexts in the DOM
        4. +
        5. 6.1.3 Secondary browsing contexts
        6. +
        7. 6.1.4 Security
        8. +
        9. 6.1.5 Groupings of browsing contexts
        10. +
        11. 6.1.6 Browsing context names
      2. +
      3. 6.2 The Window object +
        1. 6.2.1 Security
        2. +
        3. 6.2.2 APIs for creating and navigating browsing contexts by name
        4. +
        5. 6.2.3 Accessing other browsing contexts
        6. +
        7. 6.2.4 Named access on the Window object
        8. +
        9. 6.2.5 Garbage collection and browsing contexts
        10. +
        11. 6.2.6 Closing browsing contexts
        12. +
        13. 6.2.7 Browser interface elements
        14. +
        15. 6.2.8 The WindowProxy object
      4. +
      5. 6.3 Origin +
        1. 6.3.1 Relaxing the same-origin restriction
      6. +
      7. 6.4 Sandboxing
      8. +
      9. 6.5 Session history and navigation +
        1. 6.5.1 The session history of browsing contexts
        2. +
        3. 6.5.2 The History interface
        4. +
        5. 6.5.3 The Location interface +
          1. 6.5.3.1 Security
        6. +
        7. 6.5.4 Implementation notes for session history
      10. +
      11. 6.6 Browsing the Web +
        1. 6.6.1 Navigating across documents
        2. +
        3. 6.6.2 Page load processing model for HTML files
        4. +
        5. 6.6.3 Page load processing model for XML files
        6. +
        7. 6.6.4 Page load processing model for text files
        8. +
        9. 6.6.5 Page load processing model for multipart/x-mixed-replace resources
        10. +
        11. 6.6.6 Page load processing model for media
        12. +
        13. 6.6.7 Page load processing model for content that uses plugins
        14. +
        15. 6.6.8 Page load processing model for inline +content that doesn't have a DOM
        16. +
        17. 6.6.9 Navigating to a fragment identifier
        18. +
        19. 6.6.10 History traversal +
          1. 6.6.10.1 The PopStateEvent interface
          2. +
          3. 6.6.10.2 The HashChangeEvent interface
          4. +
          5. 6.6.10.3 The PageTransitionEvent interface
        20. +
        21. 6.6.11 Unloading documents +
          1. 6.6.11.1 The BeforeUnloadEvent interface
        22. +
        23. 6.6.12 Aborting a document load
      12. +
      13. 6.7 Offline Web applications +
        1. 6.7.1 Introduction +
          1. 6.7.1.1 Supporting offline caching for legacy applications
          2. +
          3. 6.7.1.2 Event summary
        2. +
        3. 6.7.2 Application caches
        4. +
        5. 6.7.3 The cache manifest syntax +
          1. 6.7.3.1 Some sample manifests
          2. +
          3. 6.7.3.2 Writing cache manifests
          4. +
          5. 6.7.3.3 Parsing cache manifests
        6. +
        7. 6.7.4 Downloading or updating an application cache
        8. +
        9. 6.7.5 The application cache selection algorithm
        10. +
        11. 6.7.6 Changes to the networking model
        12. +
        13. 6.7.7 Expiring application caches
        14. +
        15. 6.7.8 Disk space
        16. +
        17. 6.7.9 Application cache API
        18. +
        19. 6.7.10 Browser state
    12. +
    13. 7 Web application APIs +
      1. 7.1 Scripting +
        1. 7.1.1 Introduction
        2. +
        3. 7.1.2 Enabling and disabling scripting
        4. +
        5. 7.1.3 Processing model +
          1. 7.1.3.1 Definitions
          2. +
          3. 7.1.3.2 Script settings for browsing contexts
          4. +
          5. 7.1.3.3 Calling scripts
          6. +
          7. 7.1.3.4 Creating scripts
          8. +
          9. 7.1.3.5 Killing scripts
          10. +
          11. 7.1.3.6 Runtime script errors +
            1. 7.1.3.6.1 Runtime script errors in documents
            2. +
            3. 7.1.3.6.2 The ErrorEvent interface
        6. +
        7. 7.1.4 Event loops +
          1. 7.1.4.1 Definitions
          2. +
          3. 7.1.4.2 Processing model
          4. +
          5. 7.1.4.3 Generic task sources
        8. +
        9. 7.1.5 Events +
          1. 7.1.5.1 Event handlers
          2. +
          3. 7.1.5.2 Event handlers on elements, Document objects, and Window objects +
            1. 7.1.5.2.1 IDL definitions
          4. +
          5. 7.1.5.3 Event firing
          6. +
          7. 7.1.5.4 Events and the Window object
      2. +
      3. 7.2 Base64 utility methods
      4. +
      5. 7.3 Dynamic markup insertion +
        1. 7.3.1 Opening the input stream
        2. +
        3. 7.3.2 Closing the input stream
        4. +
        5. 7.3.3 document.write()
        6. +
        7. 7.3.4 document.writeln()
      6. +
      7. 7.4 Timers
      8. +
      9. 7.5 User prompts +
        1. 7.5.1 Simple dialogs
        2. +
        3. 7.5.2 Printing
        4. +
        5. 7.5.3 Dialogs implemented using separate documents
      10. +
      11. 7.6 System state and capabilities +
        1. 7.6.1 The Navigator object +
          1. 7.6.1.1 Client identification
          2. +
          3. 7.6.1.2 Language preferences
          4. +
          5. 7.6.1.3 Custom scheme and content handlers +
            1. 7.6.1.3.1 Security and privacy
            2. +
            3. 7.6.1.3.2 Sample user interface
          6. +
          7. 7.6.1.4 Manually releasing the storage mutex
          8. +
          9. 7.6.1.5 Plugins
        2. +
        3. 7.6.2 The External interface
      12. +
      13. 7.7 Images
    14. +
    15. 8 User interaction +
      1. 8.1 The hidden attribute
      2. +
      3. 8.2 Inert subtrees +
        1. 8.2.1 The inert attribute
      4. +
      5. 8.3 Activation
      6. +
      7. 8.4 Focus +
        1. 8.4.1 Sequential focus navigation and the tabindex attribute
        2. +
        3. 8.4.2 Focus management
        4. +
        5. 8.4.3 Document-level focus APIs
        6. +
        7. 8.4.4 Element-level focus APIs
      8. +
      9. 8.5 Assigning keyboard shortcuts +
        1. 8.5.1 Introduction
        2. +
        3. 8.5.2 The accesskey attribute
        4. +
        5. 8.5.3 Processing model
      10. +
      11. 8.6 Editing +
        1. 8.6.1 Making document regions editable: The contenteditable content attribute
        2. +
        3. 8.6.2 Making entire documents editable: The designMode IDL attribute
        4. +
        5. 8.6.3 Best practices for in-page editors
        6. +
        7. 8.6.4 Editing APIs
        8. +
        9. 8.6.5 Spelling and grammar checking
      12. +
      13. 8.7 Drag and drop +
        1. 8.7.1 Introduction
        2. +
        3. 8.7.2 The drag data store
        4. +
        5. 8.7.3 The DataTransfer interface +
          1. 8.7.3.1 The DataTransferItemList interface
          2. +
          3. 8.7.3.2 The DataTransferItem interface
        6. +
        7. 8.7.4 The DragEvent interface
        8. +
        9. 8.7.5 Drag-and-drop processing model
        10. +
        11. 8.7.6 Events summary
        12. +
        13. 8.7.7 The draggable attribute
        14. +
        15. 8.7.8 The dropzone attribute
        16. +
        17. 8.7.9 Security risks in the drag-and-drop model
    16. +
    17. 9 Communication +
      1. 9.1 The MessageEvent interfaces
      2. +
      3. 9.2 Server-sent events +
        1. 9.2.1 Introduction
        2. +
        3. 9.2.2 The EventSource interface
        4. +
        5. 9.2.3 Processing model
        6. +
        7. 9.2.4 Parsing an event stream
        8. +
        9. 9.2.5 Interpreting an event stream
        10. +
        11. 9.2.6 Authoring notes
        12. +
        13. 9.2.7 Connectionless push and other features
        14. +
        15. 9.2.8 Garbage collection
        16. +
        17. 9.2.9 Implementation advice
        18. +
        19. 9.2.10 IANA considerations +
          1. 9.2.10.1 text/event-stream
          2. +
          3. 9.2.10.2 Last-Event-ID
      4. +
      5. 9.3 Web sockets +
        1. 9.3.1 Introduction
        2. +
        3. 9.3.2 The WebSocket interface
        4. +
        5. 9.3.3 Feedback from the protocol
        6. +
        7. 9.3.4 Ping and Pong frames
        8. +
        9. 9.3.5 Parsing WebSocket URLs
        10. +
        11. 9.3.6 The CloseEvent interfaces
        12. +
        13. 9.3.7 Garbage collection
      6. +
      7. 9.4 Cross-document messaging +
        1. 9.4.1 Introduction
        2. +
        3. 9.4.2 Security +
          1. 9.4.2.1 Authors
          2. +
          3. 9.4.2.2 User agents
        4. +
        5. 9.4.3 Posting messages
      8. +
      9. 9.5 Channel messaging +
        1. 9.5.1 Introduction +
          1. 9.5.1.1 Examples
          2. +
          3. 9.5.1.2 Ports as the basis of an object-capability model on the Web
          4. +
          5. 9.5.1.3 Ports as the basis of abstracting out service implementations
        2. +
        3. 9.5.2 Message channels
        4. +
        5. 9.5.3 Message ports
        6. +
        7. 9.5.4 Broadcasting to many ports
        8. +
        9. 9.5.5 Ports and garbage collection
      10. +
      11. 9.6 Broadcasting to other browsing contexts
    18. +
    19. 10 Web workers +
      1. 10.1 Introduction +
        1. 10.1.1 Scope
        2. +
        3. 10.1.2 Examples +
          1. 10.1.2.1 A background number-crunching worker
          2. +
          3. 10.1.2.2 Worker used for background I/O
          4. +
          5. 10.1.2.3 Shared workers introduction
          6. +
          7. 10.1.2.4 Shared state using a shared worker
          8. +
          9. 10.1.2.5 Delegation
        4. +
        5. 10.1.3 Tutorials +
          1. 10.1.3.1 Creating a dedicated worker
          2. +
          3. 10.1.3.2 Communicating with a dedicated worker
          4. +
          5. 10.1.3.3 Shared workers
      2. +
      3. 10.2 Infrastructure +
        1. 10.2.1 The global scope +
          1. 10.2.1.1 The WorkerGlobalScope common interface
          2. +
          3. 10.2.1.2 Dedicated workers and the DedicatedWorkerGlobalScope interface
          4. +
          5. 10.2.1.3 Shared workers and the SharedWorkerGlobalScope interface
        2. +
        3. 10.2.2 The event loop
        4. +
        5. 10.2.3 The worker's lifetime
        6. +
        7. 10.2.4 Processing model
        8. +
        9. 10.2.5 Runtime script errors
        10. +
        11. 10.2.6 Creating workers +
          1. 10.2.6.1 The AbstractWorker abstract interface
          2. +
          3. 10.2.6.2 Script settings for workers
          4. +
          5. 10.2.6.3 Dedicated workers and the Worker interface
          6. +
          7. 10.2.6.4 Shared workers and the SharedWorker interface
      4. +
      5. 10.3 APIs available to workers +
        1. 10.3.1 Importing scripts and libraries
        2. +
        3. 10.3.2 The WorkerNavigator object
        4. +
        5. 10.3.3 Interface objects and constructors
        6. +
        7. 10.3.4 Worker locations
    20. +
    21. 11 Web storage +
      1. 11.1 Introduction
      2. +
      3. 11.2 The API +
        1. 11.2.1 The Storage interface
        2. +
        3. 11.2.2 The sessionStorage attribute
        4. +
        5. 11.2.3 The localStorage attribute
        6. +
        7. 11.2.4 The storage event +
          1. 11.2.4.1 The StorageEvent interface
        8. +
        9. 11.2.5 Threads
      4. +
      5. 11.3 Disk space
      6. +
      7. 11.4 Privacy +
        1. 11.4.1 User tracking
        2. +
        3. 11.4.2 Sensitivity of data
      8. +
      9. 11.5 Security +
        1. 11.5.1 DNS spoofing attacks
        2. +
        3. 11.5.2 Cross-directory attacks
        4. +
        5. 11.5.3 Implementation risks
    22. +
    23. 12 The HTML syntax +
      1. 12.1 Writing HTML documents +
        1. 12.1.1 The DOCTYPE
        2. +
        3. 12.1.2 Elements +
          1. 12.1.2.1 Start tags
          2. +
          3. 12.1.2.2 End tags
          4. +
          5. 12.1.2.3 Attributes
          6. +
          7. 12.1.2.4 Optional tags
          8. +
          9. 12.1.2.5 Restrictions on content models
          10. +
          11. 12.1.2.6 Restrictions on the contents of raw text and escapable raw text elements
        4. +
        5. 12.1.3 Text +
          1. 12.1.3.1 Newlines
        6. +
        7. 12.1.4 Character references
        8. +
        9. 12.1.5 CDATA sections
        10. +
        11. 12.1.6 Comments
      2. +
      3. 12.2 Parsing HTML documents +
        1. 12.2.1 Overview of the parsing model
        2. +
        3. 12.2.2 The input byte stream +
          1. 12.2.2.1 Parsing with a known character encoding
          2. +
          3. 12.2.2.2 Determining the character encoding
          4. +
          5. 12.2.2.3 Character encodings
          6. +
          7. 12.2.2.4 Changing the encoding while parsing
          8. +
          9. 12.2.2.5 Preprocessing the input stream
        4. +
        5. 12.2.3 Parse state +
          1. 12.2.3.1 The insertion mode
          2. +
          3. 12.2.3.2 The stack of open elements
          4. +
          5. 12.2.3.3 The list of active formatting elements
          6. +
          7. 12.2.3.4 The element pointers
          8. +
          9. 12.2.3.5 Other parsing state flags
        6. +
        7. 12.2.4 Tokenization +
          1. 12.2.4.1 Data state
          2. +
          3. 12.2.4.2 Character reference in data state
          4. +
          5. 12.2.4.3 RCDATA state
          6. +
          7. 12.2.4.4 Character reference in RCDATA state
          8. +
          9. 12.2.4.5 RAWTEXT state
          10. +
          11. 12.2.4.6 Script data state
          12. +
          13. 12.2.4.7 PLAINTEXT state
          14. +
          15. 12.2.4.8 Tag open state
          16. +
          17. 12.2.4.9 End tag open state
          18. +
          19. 12.2.4.10 Tag name state
          20. +
          21. 12.2.4.11 RCDATA less-than sign state
          22. +
          23. 12.2.4.12 RCDATA end tag open state
          24. +
          25. 12.2.4.13 RCDATA end tag name state
          26. +
          27. 12.2.4.14 RAWTEXT less-than sign state
          28. +
          29. 12.2.4.15 RAWTEXT end tag open state
          30. +
          31. 12.2.4.16 RAWTEXT end tag name state
          32. +
          33. 12.2.4.17 Script data less-than sign state
          34. +
          35. 12.2.4.18 Script data end tag open state
          36. +
          37. 12.2.4.19 Script data end tag name state
          38. +
          39. 12.2.4.20 Script data escape start state
          40. +
          41. 12.2.4.21 Script data escape start dash state
          42. +
          43. 12.2.4.22 Script data escaped state
          44. +
          45. 12.2.4.23 Script data escaped dash state
          46. +
          47. 12.2.4.24 Script data escaped dash dash state
          48. +
          49. 12.2.4.25 Script data escaped less-than sign state
          50. +
          51. 12.2.4.26 Script data escaped end tag open state
          52. +
          53. 12.2.4.27 Script data escaped end tag name state
          54. +
          55. 12.2.4.28 Script data double escape start state
          56. +
          57. 12.2.4.29 Script data double escaped state
          58. +
          59. 12.2.4.30 Script data double escaped dash state
          60. +
          61. 12.2.4.31 Script data double escaped dash dash state
          62. +
          63. 12.2.4.32 Script data double escaped less-than sign state
          64. +
          65. 12.2.4.33 Script data double escape end state
          66. +
          67. 12.2.4.34 Before attribute name state
          68. +
          69. 12.2.4.35 Attribute name state
          70. +
          71. 12.2.4.36 After attribute name state
          72. +
          73. 12.2.4.37 Before attribute value state
          74. +
          75. 12.2.4.38 Attribute value (double-quoted) state
          76. +
          77. 12.2.4.39 Attribute value (single-quoted) state
          78. +
          79. 12.2.4.40 Attribute value (unquoted) state
          80. +
          81. 12.2.4.41 Character reference in attribute value state
          82. +
          83. 12.2.4.42 After attribute value (quoted) state
          84. +
          85. 12.2.4.43 Self-closing start tag state
          86. +
          87. 12.2.4.44 Bogus comment state
          88. +
          89. 12.2.4.45 Markup declaration open state
          90. +
          91. 12.2.4.46 Comment start state
          92. +
          93. 12.2.4.47 Comment start dash state
          94. +
          95. 12.2.4.48 Comment state
          96. +
          97. 12.2.4.49 Comment end dash state
          98. +
          99. 12.2.4.50 Comment end state
          100. +
          101. 12.2.4.51 Comment end bang state
          102. +
          103. 12.2.4.52 DOCTYPE state
          104. +
          105. 12.2.4.53 Before DOCTYPE name state
          106. +
          107. 12.2.4.54 DOCTYPE name state
          108. +
          109. 12.2.4.55 After DOCTYPE name state
          110. +
          111. 12.2.4.56 After DOCTYPE public keyword state
          112. +
          113. 12.2.4.57 Before DOCTYPE public identifier state
          114. +
          115. 12.2.4.58 DOCTYPE public identifier (double-quoted) state
          116. +
          117. 12.2.4.59 DOCTYPE public identifier (single-quoted) state
          118. +
          119. 12.2.4.60 After DOCTYPE public identifier state
          120. +
          121. 12.2.4.61 Between DOCTYPE public and system identifiers state
          122. +
          123. 12.2.4.62 After DOCTYPE system keyword state
          124. +
          125. 12.2.4.63 Before DOCTYPE system identifier state
          126. +
          127. 12.2.4.64 DOCTYPE system identifier (double-quoted) state
          128. +
          129. 12.2.4.65 DOCTYPE system identifier (single-quoted) state
          130. +
          131. 12.2.4.66 After DOCTYPE system identifier state
          132. +
          133. 12.2.4.67 Bogus DOCTYPE state
          134. +
          135. 12.2.4.68 CDATA section state
          136. +
          137. 12.2.4.69 Tokenizing character references
        8. +
        9. 12.2.5 Tree construction +
          1. 12.2.5.1 Creating and inserting nodes
          2. +
          3. 12.2.5.2 Parsing elements that contain only text
          4. +
          5. 12.2.5.3 Closing elements that have implied end tags
          6. +
          7. 12.2.5.4 The rules for parsing tokens in HTML content +
            1. 12.2.5.4.1 The "initial" insertion mode
            2. +
            3. 12.2.5.4.2 The "before html" insertion mode
            4. +
            5. 12.2.5.4.3 The "before head" insertion mode
            6. +
            7. 12.2.5.4.4 The "in head" insertion mode
            8. +
            9. 12.2.5.4.5 The "in head noscript" insertion mode
            10. +
            11. 12.2.5.4.6 The "after head" insertion mode
            12. +
            13. 12.2.5.4.7 The "in body" insertion mode
            14. +
            15. 12.2.5.4.8 The "text" insertion mode
            16. +
            17. 12.2.5.4.9 The "in table" insertion mode
            18. +
            19. 12.2.5.4.10 The "in table text" insertion mode
            20. +
            21. 12.2.5.4.11 The "in caption" insertion mode
            22. +
            23. 12.2.5.4.12 The "in column group" insertion mode
            24. +
            25. 12.2.5.4.13 The "in table body" insertion mode
            26. +
            27. 12.2.5.4.14 The "in row" insertion mode
            28. +
            29. 12.2.5.4.15 The "in cell" insertion mode
            30. +
            31. 12.2.5.4.16 The "in select" insertion mode
            32. +
            33. 12.2.5.4.17 The "in select in table" insertion mode
            34. +
            35. 12.2.5.4.18 The "in template" insertion mode
            36. +
            37. 12.2.5.4.19 The "after body" insertion mode
            38. +
            39. 12.2.5.4.20 The "in frameset" insertion mode
            40. +
            41. 12.2.5.4.21 The "after frameset" insertion mode
            42. +
            43. 12.2.5.4.22 The "after after body" insertion mode
            44. +
            45. 12.2.5.4.23 The "after after frameset" insertion mode
          8. +
          9. 12.2.5.5 The rules for parsing tokens in foreign content
        10. +
        11. 12.2.6 The end
        12. +
        13. 12.2.7 Coercing an HTML DOM into an infoset
        14. +
        15. 12.2.8 An introduction to error handling and strange cases in the parser +
          1. 12.2.8.1 Misnested tags: <b><i></b></i>
          2. +
          3. 12.2.8.2 Misnested tags: <b><p></b></p>
          4. +
          5. 12.2.8.3 Unexpected markup in tables
          6. +
          7. 12.2.8.4 Scripts that modify the page as it is being parsed
          8. +
          9. 12.2.8.5 The execution of scripts that are moving across multiple documents
          10. +
          11. 12.2.8.6 Unclosed formatting elements
      4. +
      5. 12.3 Serializing HTML fragments
      6. +
      7. 12.4 Parsing HTML fragments
      8. +
      9. 12.5 Named character references
    24. +
    25. 13 The XHTML syntax +
      1. 13.1 Writing XHTML documents
      2. +
      3. 13.2 Parsing XHTML documents
      4. +
      5. 13.3 Serializing XHTML fragments
      6. +
      7. 13.4 Parsing XHTML fragments
    26. +
    27. 14 Rendering +
      1. 14.1 Introduction
      2. +
      3. 14.2 The CSS user agent style sheet and presentational hints
      4. +
      5. 14.3 Non-replaced elements +
        1. 14.3.1 Hidden elements
        2. +
        3. 14.3.2 The page
        4. +
        5. 14.3.3 Flow content
        6. +
        7. 14.3.4 Phrasing content
        8. +
        9. 14.3.5 Bidirectional text
        10. +
        11. 14.3.6 Quotes
        12. +
        13. 14.3.7 Sections and headings
        14. +
        15. 14.3.8 Lists
        16. +
        17. 14.3.9 Tables
        18. +
        19. 14.3.10 Margin collapsing quirks
        20. +
        21. 14.3.11 Form controls
        22. +
        23. 14.3.12 The hr element
        24. +
        25. 14.3.13 The fieldset and legend elements
      6. +
      7. 14.4 Replaced elements +
        1. 14.4.1 Embedded content
        2. +
        3. 14.4.2 Images
        4. +
        5. 14.4.3 Attributes for embedded content and images
        6. +
        7. 14.4.4 Image maps
      8. +
      9. 14.5 Bindings +
        1. 14.5.1 Introduction
        2. +
        3. 14.5.2 The button element
        4. +
        5. 14.5.3 The details element
        6. +
        7. 14.5.4 The input element as a text entry widget
        8. +
        9. 14.5.5 The input element as domain-specific widgets
        10. +
        11. 14.5.6 The input element as a range control
        12. +
        13. 14.5.7 The input element as a color well
        14. +
        15. 14.5.8 The input element as a checkbox and radio button widgets
        16. +
        17. 14.5.9 The input element as a file upload control
        18. +
        19. 14.5.10 The input element as a button
        20. +
        21. 14.5.11 The marquee element
        22. +
        23. 14.5.12 The meter element
        24. +
        25. 14.5.13 The progress element
        26. +
        27. 14.5.14 The select element
        28. +
        29. 14.5.15 The textarea element
        30. +
        31. 14.5.16 The keygen element
      10. +
      11. 14.6 Frames and framesets
      12. +
      13. 14.7 Interactive media +
        1. 14.7.1 Links, forms, and navigation
        2. +
        3. 14.7.2 The title attribute
        4. +
        5. 14.7.3 Editing hosts
        6. +
        7. 14.7.4 Text rendered in native user interfaces
      14. +
      15. 14.8 Print media
      16. +
      17. 14.9 Unstyled XML documents
    28. +
    29. 15 Obsolete features +
      1. 15.1 Obsolete but conforming features +
        1. 15.1.1 Warnings for obsolete but conforming features
      2. +
      3. 15.2 Non-conforming features
      4. +
      5. 15.3 Requirements for implementations +
        1. 15.3.1 The applet element
        2. +
        3. 15.3.2 The marquee element
        4. +
        5. 15.3.3 Frames
        6. +
        7. 15.3.4 Other elements, attributes and APIs
    30. +
    31. 16 IANA considerations +
      1. 16.1 text/html
      2. +
      3. 16.2 multipart/x-mixed-replace
      4. +
      5. 16.3 application/xhtml+xml
      6. +
      7. 16.4 application/x-www-form-urlencoded
      8. +
      9. 16.5 text/cache-manifest
      10. +
      11. 16.6 text/ping
      12. +
      13. 16.7 application/microdata+json
      14. +
      15. 16.8 Ping-From
      16. +
      17. 16.9 Ping-To
      18. +
      19. 16.10 web+ scheme prefix
    32. +
    33. Index +
      1. Elements
      2. +
      3. Element content categories
      4. +
      5. Attributes
      6. +
      7. Element Interfaces
      8. +
      9. All Interfaces
      10. +
      11. Events
    34. +
    35. References
    36. Acknowledgments
    \ No newline at end of file diff --git a/test/data/location-info/wiki-42/data.html b/test/data/location-info/wiki-42/data.html index 86bf8eb..d26b0df 100644 --- a/test/data/location-info/wiki-42/data.html +++ b/test/data/location-info/wiki-42/data.html @@ -1,3141 +1,3141 @@ - - -42 (number) - Wikipedia, the free encyclopedia - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - - -
    -

    42 (number)

    -
    -
    From Wikipedia, the free encyclopedia
    -
    -
    -
    -Jump to: navigation, search -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    414243
    -
    - - - -
    Cardinalforty-two
    Ordinal42nd
    -(forty-second)
    Factorization2 · 3 · 7
    Divisors1, 2, 3, 6, 7, 14, 21, 42
    Roman numeralXLII
    Unicode symbol(s)
    Greek prefixμβ
    Binary1010102
    Ternary11203
    Quaternary2224
    Quinary1325
    Senary1106
    Octal528
    Duodecimal3612
    Hexadecimal2A16
    Vigesimal2220
    Base 361636
    -

    42 (forty-two) is the natural number immediately following 41 and directly preceding 43. The number has received considerable attention in popular culture as a result of its central appearance in The Hitchhiker's Guide to the Galaxy as the "Answer to The Ultimate Question of Life, the Universe, and Everything".

    -

    - -

    -

    Mathematics[edit]

    -
      -
    • Forty-two is a pronic number and an abundant number; its prime factorization 2 · 3 · 7 makes it the second sphenic number and also the second of the form { 2 · 3 · r }. As with all sphenic numbers of this form, the aliquot sum is abundant by 12. 42 is also the second sphenic number to be bracketed by twin primes; 30 is also a pronic number and also rests between two primes. 42 has a 14 member aliquot sequence 42, 54, 66, 78, 90, 144, 259, 45, 33, 15, 9, 4, 3, 1, 0 and is itself part of the aliquot sequence commencing with the first sphenic number 30. Further, 42 is the 10th member of the 3-aliquot tree.
    • -
    • It is the third primary pseudoperfect number.
    • -
    • It is a Catalan number. Consequently; 42 is the number of noncrossing partitions of a set of five elements, the number of triangulations of a heptagon, the number of rooted ordered binary trees with six leaves, the number of ways in which five pairs of nested parentheses can be arranged, etc.
    • -
    • It is the number of partitions of 10 - the number of ways of expressing 10 as a sum of positive integers (note a different sense of partition from that above).
    • -
    -
    -
    -
    -
    -The 3 × 3 × 3 magic cube with rows summing to 42.
    -
    -
    -
      -
    • Given 27 same-size cubes whose nominal values progress from 1 to 27, a 3×3×3 magic cube can be constructed such that every row, column, and corridor, and every diagonal passing through the center, is composed of 3 cubes whose sum of values is 42.
    • -
    • It is the third pentadecagonal number. It is a meandric number and an open meandric number.
    • -
    • It is conjectured to be the scaling factor in the leading order term of the "sixth moment of the Riemann zeta function". In particular, Conrey & Ghosh have conjectured that -
      -
      {1 \over T}\int_0^T \left| \zeta\left({1 \over 2} + it\right) \right|^6\,dt \sim {42 \over 9!}\prod_p \left\{1-{1\over p}\right\}^4 \left( 1 + {4 \over p} + {1 \over p^2} \right) \log^9 T,
      -
      .
      -
      where the infinite product is over all prime numbers, p.[1][2]
      -
      -
    • -
    • 42 is a Størmer number.
    • -
    • In base 10, this number is a Harshad number and a self number, while it is a repdigit in base 4 (as 222).
    • -
    • 42 is the only known value that is the number of sets of four distinct positive integers a,b,c,d, each less than the value itself, such that ab-cd, ac-bd, and ad-bc are each multiples of the value. Whether there are other values remains an open question.[3]
    • -
    • 42 is a (2,6)-perfect number (super-multiperfect), as \sigma^2(n)=\sigma(\sigma(n))=6n\,[4]
    • -
    • 42 is a perfect score on the USA Math Olympiad (USAMO)[5] and International Mathematical Olympiad (IMO).[6]
    • -
    • 42 is the maximum of core points awarded in International Baccalaureate Diploma Programme.
    • -
    • 42 is the resulting number of the original Smith number (4937775): Both the sum of its digits (4+9+3+7+7+7+5) as the sum of the digits in its prime factorization (3+5+5+(6+5+8+3+7)) result in 42.
    • -
    • The dimension of the Borel subalgebra in the exceptional Lie algebra e6 is 42.
    • -
    -

    Science[edit]

    -
      -
    • The atomic number of molybdenum.
    • -
    • The angle rounded to whole degrees for which a rainbow appears (the critical angle).
    • -
    • In 1966, mathematician Paul Cooper theorized that the fastest, most efficient way to travel across continents would be to bore a straight hollow tube directly through the Earth, connecting a set of antipodes, remove the air from the tube and fall through.[7] The first half of the journey consists of free-fall acceleration, while the second half consists of an exactly equal deceleration. The time for such a journey works out to be 42 minutes. Even if the tube does not pass through the exact center of the Earth, the time for a journey powered entirely by gravity (known as a gravity train) always works out to be 42 minutes, so long as the tube remains friction-free, as while the force of gravity would be lessened, the distance traveled is reduced at an equal rate.[8][9] (The same idea was proposed, without calculation by Lewis Carroll in 1893 in Sylvie and Bruno Concluded.[10])
    • -
    -

    Technology[edit]

    - -

    Astronomy[edit]

    - -

    Religion[edit]

    -
      -
    • In Japanese culture, the number 42 is considered unlucky because the numerals when pronounced separately — "shi ni" (four two) — sound like the phrase, "unto death".[13]
    • -
    • There are 42 principles of Ma'at, the Ancient Egyptian personification of physical and moral law, order, and truth. In the judgment scene described in the Egyptian and the Book of the Coming/Going Forth by Day (the Book of the Dead (which evolved from the Coffin Texts and the Pyramid Texts)), there are 42 gods and goddesses of Egypt, personifying the principles of Ma'at. These 42 correspond to the 42 Nomes (Governmental Units) of Egypt. If the departed successfully answers all 42, s/he becomes an Osiris.
    • -
    • 42 is the number with which God creates the Universe in Kabbalistic tradition. In Kabbalah, the most significant name is that of the En Sof (also known as "Ein Sof", "Infinite" or "Endless"), who is above the Sefirot (sometimes spelled "Sephirot").[14] The Forty-Two-Lettered Name contains four combined names which are spelled in Hebrew letters (spelled in letters = 42 letters), which is the name of Azilut (or "Atziluth" "Emanation"). While there are obvious links between the Forty-Two Lettered Name of the Babylonian Talmud and the Kabbalah's Forty-Two Lettered Name, they are probably not identical because of the Kabbalah's emphasis on numbers. The Kabbalah also contains a Forty-Five Lettered Name and a Seventy-Two Lettered Name.
    • -
    • The number 42 appears in various contexts in Christianity. There are 42 generations (names) in the Gospel of Matthew's version of the Genealogy of Jesus; it is prophesied that for 42 months the Beast will hold dominion over the Earth (Revelation 13:5); 42 men of Beth-azmaveth were counted in the census of men of Israel upon return from exile (Ezra 2:24); God sent bears to maul 42 of the teenage boys who mocked Elisha for his baldness (2 Kings 2:23), etc.
    • -
    • In Judaism, the number (in the Babylonian Talmud, compiled 375 AD to 499 AD) of the "Forty-Two Lettered Name" ascribed to God. Rab (or Rabhs), a 3rd-century source in the Talmud stated "The Forty-Two Lettered Name is entrusted only to him who is pious, meek, middle-aged, free from bad temper, sober, and not insistent on his rights". [Source: Talmud Kidduschin 71a, Translated by Rabbi Dr. I. Epstein]. Maimonides felt that the original Talmudic Forty-Two Lettered Name was perhaps composed of several combined divine names [Maimonides "Moreh"]. The apparently unpronouncable Tetragrammaton provides the backdrop from the Twelve-Lettered Name and the Forty-Two Lettered Name of the Talmud.[citation needed]
    • -
    • The Gutenberg Bible is also known as the "42-line Bible", as the book contained 42 lines per page.
    • -
    • The Forty-Two Articles (1552), largely the work of Thomas Cranmer, were intended to summarise Anglican doctrine, as it now existed under the reign of Edward VI.
    • -
    -

    Popular culture[edit]

    -

    The Hitchhiker's Guide to the Galaxy[edit]

    -

    The number 42 is, in The Hitchhiker's Guide to the Galaxy by Douglas Adams, "The Answer to the Ultimate Question of Life, the Universe, and Everything", calculated by an enormous supercomputer over a period of 7.5 million years. Unfortunately no one knows what the question is. Thus, to calculate the Ultimate Question, a special computer the size of a small planet and built from organic components was created and named "Earth". This appeared first in the radio play and later in the novelization of The Hitchhiker's Guide to the Galaxy. The fourth book in the series, the novel So Long, and Thanks for All the Fish, contains 42 chapters. According to the novel Mostly Harmless, 42 is the street address of Stavromula Beta. In 1994 Adams created the 42 Puzzle, a game based on the number 42.

    -

    The book 42: Douglas Adams' Amazingly Accurate Answer to Life, the Universe and Everything[15] examines Adams' choice of the number 42 and also contains a compendium of some instances of the number in science, popular culture, and humour.

    -

    Works of Lewis Carroll[edit]

    -

    Lewis Carroll[16] made repeated use of this number in his writings.[17]

    -

    Examples of Carroll's use of 42:

    -
      -
    • Alice's Adventures in Wonderland has 42 illustrations.
    • -
    • Rule Forty-two in Alice's Adventures in Wonderland ("All persons more than a mile high to leave the court").
    • -
    • Rule 42 of the Code in the preface[18] to The Hunting of the Snark ("No one shall speak to the Man at the Helm").
    • -
    • In "fit the first" of The Hunting of the Snark the Baker had "forty-two boxes, all carefully packed, With his name painted clearly on each."[19]
    • -
    • The White Queen announces her age as "one hundred and one, five months and a day", which - if the best possible date is assumed for the action of Through the Looking-Glass - gives a total of 37,044 days. With the further (textually unconfirmed) assumption that both Queens were born on the same day their combined age becomes 74,088 days, which is 42 x 42 x 42. Some commentators have asserted that this is deliberate on Carroll's part.[20]
    • -
    -

    Music[edit]

    - -

    Television and film[edit]

    -
      -
    • The Kumars at No. 42 television series. In 2003, Sanjeev Bhaskar hosted a BBC show nominating The Hitchhiker's Guide to the Galaxy as Britain's Best Loved Book.
    • -
    • A made for TV movie 42: Forty Two Up - an installment in a series of documentaries wherein the director revisits the same group of British-born individuals every 7 years.[21]
    • -
    • "42" is an episode of Doctor Who, set in real time lasting approximately 42 minutes.
    • -
    • The USS Enterprise D had 42 decks
    • -
    • In an episode of Stargate Atlantis the character John Sheppard reveals that the number is the ultimate answer to life, the universe and everything, to the confusion of his alien companion.
    • -
    • On the game show Jeopardy!, "Watson" the IBM supercomputer, has 42 "threads" in its avatar.[22]
    • -
    • On the Unusuals TV-show there's an episode called "42". Detective Leo Banks recently turned 42. On account of his father, uncle, and grandfather dropping dead at 42, Leo is convinced he'll share their fate. There were 42s all over the episode.
    • -
    • 42 (film) is a film on the life of American baseball player Jackie Robinson.
    • -
    • I, Robot (film) 42 is the number of the first robot shown in the movie, a FedEx Delivery robot.
    • -
    • 42 is the number of Tony Stark's latest armor (Mark 42) in Marvel Studios' movie Iron Man 3 by Shane Black starring Robert Downey Jr.
    • -
    -

    Video games[edit]

    -
      -
    • 42 Entertainment is the company responsible for several alternate reality games, including I Love Bees, Year Zero, and Why So Serious.
    • -
    • In Spore, reaching the center of the galaxy yields a powerful item known as the "Staff of Life" which has a limited 42 uses. It also grants the player an achievement titled "42".
    • -
    • In Fable II, the last in a series of ancient artifacts the player can find says "Now just think of the number 42."
    • -
    • In Left 4 Dead 2, 42 is the number of Moustachios that must be shot in the Dark Carnival campaign's Whack-a-Mole style mini-game in order to unlock the STACH WACKER achievement.
    • -
    • In Halo Wars there is a Spartan-II Commando called Douglas-042.
    • -
    -

    Sports[edit]

    -
    -
    -
    -
    -Jackie Robinson in his now-retired number 42 jersey.
    -
    -
    - -

    Other fields[edit]

    - -

    Other languages[edit]

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    References[edit]

    -
    -
      -
    1. ^ J. B. Conrey & A. Ghosh, "A conjecture for the sixth power moment of the Riemann zeta-function" International Mathematics Research Notices (1998)
    2. -
    3. ^ J. B. Conrey & S. M. Gonek, "High moments of the Riemann zeta-function" Duke Math J. 107 3 (2001): 577 – 604
    4. -
    5. ^ Differently Perfect - mathpages.com
    6. -
    7. ^ Sequence A019283 in OEIS
    8. -
    9. ^ Alex Zhai ties for second-highest score in 2007 USA Mathematical Olympiad - By Andrew Lovdahl Gargoyle staff reporter Posted Monday, May 7, 2007, The OG, news & student awards - Online Gargoyle
    10. -
    11. ^ CBC News staff, "Canadian math champ's skills add up to a perfect score" CBC News July 20, 2004. "A 16-year-old Canadian was one of four students who achieved a perfect score at an international mathematics competition. Jacob Tsimerman of Toronto scored 42 out of 42, making him one of 45 individual gold medallists at the 45th International Mathematical Olympiad in Athens."
    12. -
    13. ^ Cooper, Paul W. (1966). "Through the Earth in Forty Minutes". American Journal of Physics 34 (1): 68–69. doi:10.1119/1.1972773. 
    14. -
    15. ^ "To Everywhere in 42 Minutes". Time. February 11, 1966. Archived from the original on 12 May 2008. Retrieved 2008-05-18. 
    16. -
    17. ^ "Jumping into a 7,965 mile deep hole". Archived from the original on June 2, 2008. Retrieved 2008-05-18. 
    18. -
    19. ^ Carroll, Lewis (29 December 1893). "Chapter 7". Sylvie and Bruno Concluded 2. illustrated by Harry Furniss. United Kingdom: Macmillan and Co. "Each railway is in a long tunnel, perfectly straight: so of course the middle of it is nearer the centre of the globe than the two ends: so every train runs half-way down-hill, and that gives it force enough to run the other half up-hill." 
    20. -
    21. ^ Lee Middleton; Jayanthi Sivaswamy (2002). "Framework for practical hexagonal-image processing". Journal of Electronic Imaging 11 (104). doi:10.1117/1.1426078. Retrieved January 17, 2010 (abstract only). 
    22. -
    23. ^ "Maximum password age". Microsoft TechNet. Retrieved 15 January 2014. 
    24. -
    25. ^ Niiya, Brian. Japanese American history: an A-to-Z reference from 1868 to the present. Facts on File, Inc., 1993, p. 352
    26. -
    27. ^ Joel Primack; Nancy E. Abrams. "In A Beginning...Quantum Cosmology and Kabbalah" (PDF). Retrieved 2008-03-14. 
    28. -
    29. ^ Gill, Peter (February 3, 2011). "42: Douglas Adams' Amazingly Accurate Answer to Life the Universe and Everything". London: Guardian. Retrieved 03/04/2011. 
    30. -
    31. ^ Lewis Carroll and Douglas Adams
    32. -
    33. ^ The Mystery of Lewis Carroll, Jenny Woolf
    34. -
    35. ^ The Hunting of the Snark, by Lewis Carroll
    36. -
    37. ^ The Hunting of the Snark, by Lewis Carroll
    38. -
    39. ^ What Lewis Carroll Taught Us: Alice's creator knew all about role-playing. by Seth Lerer, March 4, 2010
    40. -
    41. ^ 42: Forty Two Up at IMDB
    42. -
    43. ^ http://www.slate.com/id/2284721/ Ken Jennings
    44. -
    -
    -

    External links[edit]

    - - - - - - - - - - - - -


    - - - - - - - - - - - - - -
    -
    -
    -
    -
    -

    Navigation menu

    -
    - -
    - - -
    -
    - - - -
    -
    - -
    - - - - - - - + + +42 (number) - Wikipedia, the free encyclopedia + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +

    42 (number)

    +
    +
    From Wikipedia, the free encyclopedia
    +
    +
    +
    +Jump to: navigation, search +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +
    414243
    +
    + + + +
    Cardinalforty-two
    Ordinal42nd
    +(forty-second)
    Factorization2 · 3 · 7
    Divisors1, 2, 3, 6, 7, 14, 21, 42
    Roman numeralXLII
    Unicode symbol(s)
    Greek prefixμβ
    Binary1010102
    Ternary11203
    Quaternary2224
    Quinary1325
    Senary1106
    Octal528
    Duodecimal3612
    Hexadecimal2A16
    Vigesimal2220
    Base 361636
    +

    42 (forty-two) is the natural number immediately following 41 and directly preceding 43. The number has received considerable attention in popular culture as a result of its central appearance in The Hitchhiker's Guide to the Galaxy as the "Answer to The Ultimate Question of Life, the Universe, and Everything".

    +

    + +

    +

    Mathematics[edit]

    +
      +
    • Forty-two is a pronic number and an abundant number; its prime factorization 2 · 3 · 7 makes it the second sphenic number and also the second of the form { 2 · 3 · r }. As with all sphenic numbers of this form, the aliquot sum is abundant by 12. 42 is also the second sphenic number to be bracketed by twin primes; 30 is also a pronic number and also rests between two primes. 42 has a 14 member aliquot sequence 42, 54, 66, 78, 90, 144, 259, 45, 33, 15, 9, 4, 3, 1, 0 and is itself part of the aliquot sequence commencing with the first sphenic number 30. Further, 42 is the 10th member of the 3-aliquot tree.
    • +
    • It is the third primary pseudoperfect number.
    • +
    • It is a Catalan number. Consequently; 42 is the number of noncrossing partitions of a set of five elements, the number of triangulations of a heptagon, the number of rooted ordered binary trees with six leaves, the number of ways in which five pairs of nested parentheses can be arranged, etc.
    • +
    • It is the number of partitions of 10 - the number of ways of expressing 10 as a sum of positive integers (note a different sense of partition from that above).
    • +
    +
    +
    +
    +
    +The 3 × 3 × 3 magic cube with rows summing to 42.
    +
    +
    +
      +
    • Given 27 same-size cubes whose nominal values progress from 1 to 27, a 3×3×3 magic cube can be constructed such that every row, column, and corridor, and every diagonal passing through the center, is composed of 3 cubes whose sum of values is 42.
    • +
    • It is the third pentadecagonal number. It is a meandric number and an open meandric number.
    • +
    • It is conjectured to be the scaling factor in the leading order term of the "sixth moment of the Riemann zeta function". In particular, Conrey & Ghosh have conjectured that +
      +
      {1 \over T}\int_0^T \left| \zeta\left({1 \over 2} + it\right) \right|^6\,dt \sim {42 \over 9!}\prod_p \left\{1-{1\over p}\right\}^4 \left( 1 + {4 \over p} + {1 \over p^2} \right) \log^9 T,
      +
      .
      +
      where the infinite product is over all prime numbers, p.[1][2]
      +
      +
    • +
    • 42 is a Størmer number.
    • +
    • In base 10, this number is a Harshad number and a self number, while it is a repdigit in base 4 (as 222).
    • +
    • 42 is the only known value that is the number of sets of four distinct positive integers a,b,c,d, each less than the value itself, such that ab-cd, ac-bd, and ad-bc are each multiples of the value. Whether there are other values remains an open question.[3]
    • +
    • 42 is a (2,6)-perfect number (super-multiperfect), as \sigma^2(n)=\sigma(\sigma(n))=6n\,[4]
    • +
    • 42 is a perfect score on the USA Math Olympiad (USAMO)[5] and International Mathematical Olympiad (IMO).[6]
    • +
    • 42 is the maximum of core points awarded in International Baccalaureate Diploma Programme.
    • +
    • 42 is the resulting number of the original Smith number (4937775): Both the sum of its digits (4+9+3+7+7+7+5) as the sum of the digits in its prime factorization (3+5+5+(6+5+8+3+7)) result in 42.
    • +
    • The dimension of the Borel subalgebra in the exceptional Lie algebra e6 is 42.
    • +
    +

    Science[edit]

    +
      +
    • The atomic number of molybdenum.
    • +
    • The angle rounded to whole degrees for which a rainbow appears (the critical angle).
    • +
    • In 1966, mathematician Paul Cooper theorized that the fastest, most efficient way to travel across continents would be to bore a straight hollow tube directly through the Earth, connecting a set of antipodes, remove the air from the tube and fall through.[7] The first half of the journey consists of free-fall acceleration, while the second half consists of an exactly equal deceleration. The time for such a journey works out to be 42 minutes. Even if the tube does not pass through the exact center of the Earth, the time for a journey powered entirely by gravity (known as a gravity train) always works out to be 42 minutes, so long as the tube remains friction-free, as while the force of gravity would be lessened, the distance traveled is reduced at an equal rate.[8][9] (The same idea was proposed, without calculation by Lewis Carroll in 1893 in Sylvie and Bruno Concluded.[10])
    • +
    +

    Technology[edit]

    + +

    Astronomy[edit]

    + +

    Religion[edit]

    +
      +
    • In Japanese culture, the number 42 is considered unlucky because the numerals when pronounced separately — "shi ni" (four two) — sound like the phrase, "unto death".[13]
    • +
    • There are 42 principles of Ma'at, the Ancient Egyptian personification of physical and moral law, order, and truth. In the judgment scene described in the Egyptian and the Book of the Coming/Going Forth by Day (the Book of the Dead (which evolved from the Coffin Texts and the Pyramid Texts)), there are 42 gods and goddesses of Egypt, personifying the principles of Ma'at. These 42 correspond to the 42 Nomes (Governmental Units) of Egypt. If the departed successfully answers all 42, s/he becomes an Osiris.
    • +
    • 42 is the number with which God creates the Universe in Kabbalistic tradition. In Kabbalah, the most significant name is that of the En Sof (also known as "Ein Sof", "Infinite" or "Endless"), who is above the Sefirot (sometimes spelled "Sephirot").[14] The Forty-Two-Lettered Name contains four combined names which are spelled in Hebrew letters (spelled in letters = 42 letters), which is the name of Azilut (or "Atziluth" "Emanation"). While there are obvious links between the Forty-Two Lettered Name of the Babylonian Talmud and the Kabbalah's Forty-Two Lettered Name, they are probably not identical because of the Kabbalah's emphasis on numbers. The Kabbalah also contains a Forty-Five Lettered Name and a Seventy-Two Lettered Name.
    • +
    • The number 42 appears in various contexts in Christianity. There are 42 generations (names) in the Gospel of Matthew's version of the Genealogy of Jesus; it is prophesied that for 42 months the Beast will hold dominion over the Earth (Revelation 13:5); 42 men of Beth-azmaveth were counted in the census of men of Israel upon return from exile (Ezra 2:24); God sent bears to maul 42 of the teenage boys who mocked Elisha for his baldness (2 Kings 2:23), etc.
    • +
    • In Judaism, the number (in the Babylonian Talmud, compiled 375 AD to 499 AD) of the "Forty-Two Lettered Name" ascribed to God. Rab (or Rabhs), a 3rd-century source in the Talmud stated "The Forty-Two Lettered Name is entrusted only to him who is pious, meek, middle-aged, free from bad temper, sober, and not insistent on his rights". [Source: Talmud Kidduschin 71a, Translated by Rabbi Dr. I. Epstein]. Maimonides felt that the original Talmudic Forty-Two Lettered Name was perhaps composed of several combined divine names [Maimonides "Moreh"]. The apparently unpronouncable Tetragrammaton provides the backdrop from the Twelve-Lettered Name and the Forty-Two Lettered Name of the Talmud.[citation needed]
    • +
    • The Gutenberg Bible is also known as the "42-line Bible", as the book contained 42 lines per page.
    • +
    • The Forty-Two Articles (1552), largely the work of Thomas Cranmer, were intended to summarise Anglican doctrine, as it now existed under the reign of Edward VI.
    • +
    +

    Popular culture[edit]

    +

    The Hitchhiker's Guide to the Galaxy[edit]

    +

    The number 42 is, in The Hitchhiker's Guide to the Galaxy by Douglas Adams, "The Answer to the Ultimate Question of Life, the Universe, and Everything", calculated by an enormous supercomputer over a period of 7.5 million years. Unfortunately no one knows what the question is. Thus, to calculate the Ultimate Question, a special computer the size of a small planet and built from organic components was created and named "Earth". This appeared first in the radio play and later in the novelization of The Hitchhiker's Guide to the Galaxy. The fourth book in the series, the novel So Long, and Thanks for All the Fish, contains 42 chapters. According to the novel Mostly Harmless, 42 is the street address of Stavromula Beta. In 1994 Adams created the 42 Puzzle, a game based on the number 42.

    +

    The book 42: Douglas Adams' Amazingly Accurate Answer to Life, the Universe and Everything[15] examines Adams' choice of the number 42 and also contains a compendium of some instances of the number in science, popular culture, and humour.

    +

    Works of Lewis Carroll[edit]

    +

    Lewis Carroll[16] made repeated use of this number in his writings.[17]

    +

    Examples of Carroll's use of 42:

    +
      +
    • Alice's Adventures in Wonderland has 42 illustrations.
    • +
    • Rule Forty-two in Alice's Adventures in Wonderland ("All persons more than a mile high to leave the court").
    • +
    • Rule 42 of the Code in the preface[18] to The Hunting of the Snark ("No one shall speak to the Man at the Helm").
    • +
    • In "fit the first" of The Hunting of the Snark the Baker had "forty-two boxes, all carefully packed, With his name painted clearly on each."[19]
    • +
    • The White Queen announces her age as "one hundred and one, five months and a day", which - if the best possible date is assumed for the action of Through the Looking-Glass - gives a total of 37,044 days. With the further (textually unconfirmed) assumption that both Queens were born on the same day their combined age becomes 74,088 days, which is 42 x 42 x 42. Some commentators have asserted that this is deliberate on Carroll's part.[20]
    • +
    +

    Music[edit]

    + +

    Television and film[edit]

    +
      +
    • The Kumars at No. 42 television series. In 2003, Sanjeev Bhaskar hosted a BBC show nominating The Hitchhiker's Guide to the Galaxy as Britain's Best Loved Book.
    • +
    • A made for TV movie 42: Forty Two Up - an installment in a series of documentaries wherein the director revisits the same group of British-born individuals every 7 years.[21]
    • +
    • "42" is an episode of Doctor Who, set in real time lasting approximately 42 minutes.
    • +
    • The USS Enterprise D had 42 decks
    • +
    • In an episode of Stargate Atlantis the character John Sheppard reveals that the number is the ultimate answer to life, the universe and everything, to the confusion of his alien companion.
    • +
    • On the game show Jeopardy!, "Watson" the IBM supercomputer, has 42 "threads" in its avatar.[22]
    • +
    • On the Unusuals TV-show there's an episode called "42". Detective Leo Banks recently turned 42. On account of his father, uncle, and grandfather dropping dead at 42, Leo is convinced he'll share their fate. There were 42s all over the episode.
    • +
    • 42 (film) is a film on the life of American baseball player Jackie Robinson.
    • +
    • I, Robot (film) 42 is the number of the first robot shown in the movie, a FedEx Delivery robot.
    • +
    • 42 is the number of Tony Stark's latest armor (Mark 42) in Marvel Studios' movie Iron Man 3 by Shane Black starring Robert Downey Jr.
    • +
    +

    Video games[edit]

    +
      +
    • 42 Entertainment is the company responsible for several alternate reality games, including I Love Bees, Year Zero, and Why So Serious.
    • +
    • In Spore, reaching the center of the galaxy yields a powerful item known as the "Staff of Life" which has a limited 42 uses. It also grants the player an achievement titled "42".
    • +
    • In Fable II, the last in a series of ancient artifacts the player can find says "Now just think of the number 42."
    • +
    • In Left 4 Dead 2, 42 is the number of Moustachios that must be shot in the Dark Carnival campaign's Whack-a-Mole style mini-game in order to unlock the STACH WACKER achievement.
    • +
    • In Halo Wars there is a Spartan-II Commando called Douglas-042.
    • +
    +

    Sports[edit]

    +
    +
    +
    +
    +Jackie Robinson in his now-retired number 42 jersey.
    +
    +
    + +

    Other fields[edit]

    + +

    Other languages[edit]

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    References[edit]

    +
    +
      +
    1. ^ J. B. Conrey & A. Ghosh, "A conjecture for the sixth power moment of the Riemann zeta-function" International Mathematics Research Notices (1998)
    2. +
    3. ^ J. B. Conrey & S. M. Gonek, "High moments of the Riemann zeta-function" Duke Math J. 107 3 (2001): 577 – 604
    4. +
    5. ^ Differently Perfect - mathpages.com
    6. +
    7. ^ Sequence A019283 in OEIS
    8. +
    9. ^ Alex Zhai ties for second-highest score in 2007 USA Mathematical Olympiad - By Andrew Lovdahl Gargoyle staff reporter Posted Monday, May 7, 2007, The OG, news & student awards - Online Gargoyle
    10. +
    11. ^ CBC News staff, "Canadian math champ's skills add up to a perfect score" CBC News July 20, 2004. "A 16-year-old Canadian was one of four students who achieved a perfect score at an international mathematics competition. Jacob Tsimerman of Toronto scored 42 out of 42, making him one of 45 individual gold medallists at the 45th International Mathematical Olympiad in Athens."
    12. +
    13. ^ Cooper, Paul W. (1966). "Through the Earth in Forty Minutes". American Journal of Physics 34 (1): 68–69. doi:10.1119/1.1972773. 
    14. +
    15. ^ "To Everywhere in 42 Minutes". Time. February 11, 1966. Archived from the original on 12 May 2008. Retrieved 2008-05-18. 
    16. +
    17. ^ "Jumping into a 7,965 mile deep hole". Archived from the original on June 2, 2008. Retrieved 2008-05-18. 
    18. +
    19. ^ Carroll, Lewis (29 December 1893). "Chapter 7". Sylvie and Bruno Concluded 2. illustrated by Harry Furniss. United Kingdom: Macmillan and Co. "Each railway is in a long tunnel, perfectly straight: so of course the middle of it is nearer the centre of the globe than the two ends: so every train runs half-way down-hill, and that gives it force enough to run the other half up-hill." 
    20. +
    21. ^ Lee Middleton; Jayanthi Sivaswamy (2002). "Framework for practical hexagonal-image processing". Journal of Electronic Imaging 11 (104). doi:10.1117/1.1426078. Retrieved January 17, 2010 (abstract only). 
    22. +
    23. ^ "Maximum password age". Microsoft TechNet. Retrieved 15 January 2014. 
    24. +
    25. ^ Niiya, Brian. Japanese American history: an A-to-Z reference from 1868 to the present. Facts on File, Inc., 1993, p. 352
    26. +
    27. ^ Joel Primack; Nancy E. Abrams. "In A Beginning...Quantum Cosmology and Kabbalah" (PDF). Retrieved 2008-03-14. 
    28. +
    29. ^ Gill, Peter (February 3, 2011). "42: Douglas Adams' Amazingly Accurate Answer to Life the Universe and Everything". London: Guardian. Retrieved 03/04/2011. 
    30. +
    31. ^ Lewis Carroll and Douglas Adams
    32. +
    33. ^ The Mystery of Lewis Carroll, Jenny Woolf
    34. +
    35. ^ The Hunting of the Snark, by Lewis Carroll
    36. +
    37. ^ The Hunting of the Snark, by Lewis Carroll
    38. +
    39. ^ What Lewis Carroll Taught Us: Alice's creator knew all about role-playing. by Seth Lerer, March 4, 2010
    40. +
    41. ^ 42: Forty Two Up at IMDB
    42. +
    43. ^ http://www.slate.com/id/2284721/ Ken Jennings
    44. +
    +
    +

    External links[edit]

    + + + + + + + + + + + + +


    + + + + + + + + + + + + + +
    +
    +
    +
    +
    +

    Navigation menu

    +
    + +
    + + +
    +
    + + + +
    +
    + +
    + + + + + + + \ No newline at end of file diff --git a/test/data/parser-feedback/adoption01.test b/test/data/parser-feedback/adoption01.test index 851ee4f..e737022 100644 --- a/test/data/parser-feedback/adoption01.test +++ b/test/data/parser-feedback/adoption01.test @@ -1,6 +1,7 @@ { "tests": [ { + "fragmentContext": null, "description": "

    ", "input": "

    ", "output": [ @@ -25,6 +26,7 @@ ] }, { + "fragmentContext": null, "description": "1

    23

    ", "input": "1

    23

    ", "output": [ @@ -61,6 +63,7 @@ ] }, { + "fragmentContext": null, "description": "1", "input": "1", "output": [ @@ -97,6 +100,7 @@ ] }, { + "fragmentContext": null, "description": "123", "input": "123", "output": [ @@ -133,6 +137,7 @@ ] }, { + "fragmentContext": null, "description": "1
    2
    34
    5
    ", "input": "1
    2
    34
    5
    ", "output": [ @@ -186,6 +191,7 @@ ] }, { + "fragmentContext": null, "description": "1

    23

    ", "input": "
    1

    23

    ", "output": [ @@ -227,6 +233,7 @@ ] }, { + "fragmentContext": null, "description": "

    ", "input": "

    ", "output": [ @@ -257,6 +264,7 @@ ] }, { + "fragmentContext": null, "description": "

    ", "input": "

    ", "output": [ @@ -287,6 +295,7 @@ ] }, { + "fragmentContext": null, "description": "

    ", "input": "

    ", "output": [ @@ -317,6 +326,7 @@ ] }, { + "fragmentContext": null, "description": "

    123

    45", "input": "

    123

    45", "output": [ @@ -374,6 +384,7 @@ ] }, { + "fragmentContext": null, "description": "
    13
    2
    ", "input": "13
    2
    ", "output": [ @@ -415,6 +426,7 @@ ] }, { + "fragmentContext": null, "description": "AC
    B
    ", "input": "AC
    B
    ", "output": [ @@ -451,6 +463,7 @@ ] }, { + "fragmentContext": null, "description": "
    ", "input": "
    ", "output": [ @@ -481,6 +494,7 @@ ] }, { + "fragmentContext": null, "description": "
    ", "input": "
    ", "output": [ @@ -556,6 +570,7 @@ ] }, { + "fragmentContext": null, "description": "
    ", "input": "
    ", "output": [ @@ -601,6 +616,7 @@ ] }, { + "fragmentContext": null, "description": "xy", "input": "xy", "output": [ @@ -651,6 +667,7 @@ ] }, { + "fragmentContext": null, "description": "

    x", "input": "

    x", "output": [ @@ -689,6 +706,51 @@ "x" ] ] + }, + { + "fragmentContext": "div", + "description": "