没有合适的资源?快使用搜索试试~ 我知道了~
首页2015版HTML官方标准文档:详实内容与特性详解
HTML官方标准文档,发布于2015年8月29日,是一份详细的文档,共计1158页,涵盖了HTML的核心内容及其最新发展。这份文档是W3C(World Wide Web Consortium)和WHATWG(Web Hypertext Application Technology Working Group)合作维护的,旨在提供对HTML语言的全面而权威的指导。
该文档分为多个部分,包括:
1. **介绍**:明确了本规范在HTML标准体系中的位置,指出它并不等同于HTML5,而是代表了HTML的一个持续演进过程。这部分还回顾了HTML的历史背景,阐述了其设计原则和目标受众。
2. **共同基础设施**:介绍了HTML的基础元素和结构,如文档类型声明、元数据以及HTML文档的通用属性和行为。
3. **HTML文档的语义、结构和API**:详细解释了HTML元素如何组织内容、赋予意义,并阐述了与用户交互、加载网页、网络通信等相关API。
4. **HTML元素**:涵盖了各种元素的定义和用法,包括常用的段落、列表、图像、链接等。
5. **Microdata**:这部分关注的是语义化的扩展技术,用于增强网页内容的机器可读性。
6. **用户交互**:讲解了表单、事件处理、媒体控制等用户界面交互方面的内容。
7. **加载网页**:涉及网页的加载策略、缓存和资源请求等方面。
8. **Web应用APIs**:介绍了与Web应用程序相关的API,如Web Workers和Web Storage,支持后台处理和持久化数据存储。
9. **通信**:涉及HTTP、WebSocket等协议,以及与服务器和客户端的双向通信机制。
10. **Web Workers**:详细解释了多线程编程模型,用于提升浏览器的性能和并行计算能力。
11. **Web Storage**:介绍本地存储技术,如localStorage和sessionStorage,用于持久数据的存储。
12. **HTML和XHTML语法**:区分并阐述了这两种标记语言的异同,以及它们在现代HTML中的角色。
13. **渲染**:讨论了浏览器渲染HTML的方式,包括CSS规则和视觉呈现。
14. **已弃用特性**:列出过时或不再推荐使用的特性,以便开发者了解当前最佳实践。
15. **IANA考虑**:关注国际互联网编号分配机构(IANA)的角色,与互联网协议和服务的标准化有关。
文档结尾提供了索引、参考文献、致谢以及详细的目录,方便读者查找所需内容。此外,还提供了链接至官方验证器、邮件列表和实时更新的变更日志,便于跟踪和参与HTML标准的进一步发展。
这份HTML官方标准文档是开发人员、设计师和研究人员不可或缺的参考资料,它确保了HTML语言的稳定性、一致性和向前兼容性,为构建现代Web应用提供了坚实的技术基础。
8.6.1.3.2 Sample user interface ........................................................................................ 866
8.6.1.4 Manually releasing the storage mutex..................................................................................... 868
8.6.1.5 Plugins..................................................................................................................................... 868
8.6.2 The External interface .............................................................................................................................. 873
8.7 Images............................................................................................................................................................................... 874
8.8 Animation Frames ............................................................................................................................................................. 878
9 Communication ...................................................................................................................................................................................... 880
9.1 The MessageEvent interfaces......................................................................................................................................... 880
9.2 Server-sent events ............................................................................................................................................................ 881
9.2.1 Introduction................................................................................................................................................... 881
9.2.2 The EventSource interface........................................................................................................................ 882
9.2.3 Processing model......................................................................................................................................... 883
9.2.4 Parsing an event stream .............................................................................................................................. 885
9.2.5 Interpreting an event stream ........................................................................................................................ 885
9.2.6 Authoring notes ............................................................................................................................................ 888
9.2.7 Connectionless push and other features...................................................................................................... 888
9.2.8 Garbage collection ....................................................................................................................................... 889
9.2.9 Implementation advice ................................................................................................................................. 889
9.2.10 IANA considerations................................................................................................................................... 889
9.2.10.1 text/event-stream.......................................................................................................... 889
9.2.10.2 Last-Event-ID .................................................................................................................. 890
9.3 Web sockets...................................................................................................................................................................... 891
9.3.1 Introduction................................................................................................................................................... 891
9.3.2 The WebSocket interface............................................................................................................................ 891
9.3.3 Feedback from the protocol.......................................................................................................................... 895
9.3.4 Ping and Pong frames.................................................................................................................................. 897
9.3.5 Parsing WebSocket URLs............................................................................................................................ 897
9.3.6 The CloseEvent interfaces ........................................................................................................................ 897
9.3.7 Garbage collection ....................................................................................................................................... 898
9.4 Cross-document messaging.............................................................................................................................................. 898
9.4.1 Introduction................................................................................................................................................... 899
9.4.2 Security......................................................................................................................................................... 899
9.4.2.1 Authors .................................................................................................................................... 899
9.4.2.2 User agents ............................................................................................................................. 899
9.4.3 Posting messages ........................................................................................................................................ 900
9.5 Channel messaging........................................................................................................................................................... 901
9.5.1 Introduction................................................................................................................................................... 901
9.5.1.1 Examples................................................................................................................................. 901
9.5.1.2 Ports as the basis of an object-capability model on the Web.................................................. 902
9.5.1.3 Ports as the basis of abstracting out service implementations................................................ 903
9.5.2 Message channels ....................................................................................................................................... 903
9.5.3 Message ports.............................................................................................................................................. 904
9.5.4 Broadcasting to many ports.......................................................................................................................... 907
9.5.5 Ports and garbage collection........................................................................................................................ 908
9.6 Broadcasting to other browsing contexts .......................................................................................................................... 908
10 Web workers......................................................................................................................................................................................... 911
16
10.1 Introduction...................................................................................................................................................................... 911
10.1.1 Scope ......................................................................................................................................................... 911
10.1.2 Examples.................................................................................................................................................... 911
10.1.2.1 A background number-crunching worker .............................................................................. 911
10.1.2.2 Worker used for background I/O ........................................................................................... 912
10.1.2.3 Shared workers introduction.................................................................................................. 914
10.1.2.4 Shared state using a shared worker...................................................................................... 915
10.1.2.5 Delegation ............................................................................................................................. 920
10.1.3 Tutorials...................................................................................................................................................... 921
10.1.3.1 Creating a dedicated worker ................................................................................................. 921
10.1.3.2 Communicating with a dedicated worker............................................................................... 922
10.1.3.3 Shared workers ..................................................................................................................... 922
10.2 Infrastructure ................................................................................................................................................................... 923
10.2.1 The global scope ........................................................................................................................................ 923
10.2.1.1 The WorkerGlobalScope common interface..................................................................... 923
10.2.1.2 Dedicated workers and the DedicatedWorkerGlobalScope interface............................924
10.2.1.3 Shared workers and the SharedWorkerGlobalScope interface....................................... 924
10.2.2 The event loop............................................................................................................................................ 925
10.2.3 The worker's lifetime................................................................................................................................... 925
10.2.4 Processing model....................................................................................................................................... 926
10.2.5 Runtime script errors .................................................................................................................................. 927
10.2.6 Creating workers ........................................................................................................................................ 928
10.2.6.1 The AbstractWorker abstract interface ............................................................................ 928
10.2.6.2 Script settings for workers ..................................................................................................... 928
10.2.6.3 Dedicated workers and the Worker interface....................................................................... 929
10.2.6.4 Shared workers and the SharedWorker interface............................................................... 930
10.3 APIs available to workers ................................................................................................................................................ 932
10.3.1 Importing scripts and libraries .................................................................................................................... 932
10.3.2 The WorkerNavigator object ................................................................................................................. 933
10.3.3 Worker locations......................................................................................................................................... 933
11 Web storage ......................................................................................................................................................................................... 934
11.1 Introduction...................................................................................................................................................................... 934
11.2 The API............................................................................................................................................................................ 935
11.2.1 The Storage interface .............................................................................................................................. 935
11.2.2 The sessionStorage attribute................................................................................................................ 936
11.2.3 The localStorage attribute .................................................................................................................... 936
11.2.4 The storage event ................................................................................................................................... 937
11.2.4.1 The StorageEvent interface............................................................................................... 937
11.2.5 Threads ...................................................................................................................................................... 938
11.3 Disk space....................................................................................................................................................................... 938
11.4 Privacy............................................................................................................................................................................. 939
11.4.1 User tracking .............................................................................................................................................. 939
11.4.2 Sensitivity of data ....................................................................................................................................... 940
11.5 Security............................................................................................................................................................................ 940
11.5.1 DNS spoofing attacks................................................................................................................................. 940
11.5.2 Cross-directory attacks............................................................................................................................... 940
11.5.3 Implementation risks .................................................................................................................................. 940
17
12 The HTML syntax ................................................................................................................................................................................. 941
12.1 Writing HTML documents................................................................................................................................................ 941
12.1.1 The DOCTYPE........................................................................................................................................... 941
12.1.2 Elements..................................................................................................................................................... 942
12.1.2.1 Start tags ............................................................................................................................... 944
12.1.2.2 End tags ................................................................................................................................ 944
12.1.2.3 Attributes ............................................................................................................................... 944
12.1.2.4 Optional tags ......................................................................................................................... 946
12.1.2.5 Restrictions on content models ............................................................................................. 950
12.1.2.6 Restrictions on the contents of raw text and escapable raw text elements........................... 951
12.1.3 Text............................................................................................................................................................. 951
12.1.3.1 Newlines................................................................................................................................ 951
12.1.4 Character references.................................................................................................................................. 951
12.1.5 CDATA sections ......................................................................................................................................... 952
12.1.6 Comments .................................................................................................................................................. 952
12.2 Parsing HTML documents............................................................................................................................................... 952
12.2.1 Overview of the parsing model................................................................................................................... 954
12.2.2 The input byte stream................................................................................................................................. 954
12.2.2.1 Parsing with a known character encoding............................................................................. 955
12.2.2.2 Determining the character encoding ..................................................................................... 955
12.2.2.3 Character encodings ............................................................................................................. 960
12.2.2.4 Changing the encoding while parsing ................................................................................... 960
12.2.2.5 Preprocessing the input stream............................................................................................. 960
12.2.3 Parse state ................................................................................................................................................. 961
12.2.3.1 The insertion mode................................................................................................................ 961
12.2.3.2 The stack of open elements .................................................................................................. 962
12.2.3.3 The list of active formatting elements.................................................................................... 964
12.2.3.4 The element pointers............................................................................................................. 965
12.2.3.5 Other parsing state flags ....................................................................................................... 965
12.2.4 Tokenization ............................................................................................................................................... 965
12.2.4.1 Data state .............................................................................................................................. 966
12.2.4.2 Character reference in data state.......................................................................................... 966
12.2.4.3 RCDATA state....................................................................................................................... 967
12.2.4.4 Character reference in RCDATA state .................................................................................. 967
12.2.4.5 RAWTEXT state .................................................................................................................... 967
12.2.4.6 Script data state .................................................................................................................... 967
12.2.4.7 PLAINTEXT state .................................................................................................................. 968
12.2.4.8 Tag open state ...................................................................................................................... 968
12.2.4.9 End tag open state ................................................................................................................ 968
12.2.4.10 Tag name state ................................................................................................................... 969
12.2.4.11 RCDATA less-than sign state.............................................................................................. 969
12.2.4.12 RCDATA end tag open state............................................................................................... 969
12.2.4.13 RCDATA end tag name state.............................................................................................. 970
12.2.4.14 RAWTEXT less-than sign state........................................................................................... 970
12.2.4.15 RAWTEXT end tag open state ............................................................................................ 970
12.2.4.16 RAWTEXT end tag name state ........................................................................................... 971
12.2.4.17 Script data less-than sign state ........................................................................................... 971
12.2.4.18 Script data end tag open state ............................................................................................ 972
12.2.4.19 Script data end tag name state ........................................................................................... 972
12.2.4.20 Script data escape start state.............................................................................................. 972
12.2.4.21 Script data escape start dash state ..................................................................................... 973
12.2.4.22 Script data escaped state.................................................................................................... 973
18
12.2.4.23 Script data escaped dash state ........................................................................................... 973
12.2.4.24 Script data escaped dash dash state .................................................................................. 973
12.2.4.25 Script data escaped less-than sign state............................................................................. 974
12.2.4.26 Script data escaped end tag open state.............................................................................. 974
12.2.4.27 Script data escaped end tag name state............................................................................. 974
12.2.4.28 Script data double escape start state .................................................................................. 975
12.2.4.29 Script data double escaped state ........................................................................................ 975
12.2.4.30 Script data double escaped dash state ............................................................................... 976
12.2.4.31 Script data double escaped dash dash state ...................................................................... 976
12.2.4.32 Script data double escaped less-than sign state................................................................. 976
12.2.4.33 Script data double escape end state ................................................................................... 977
12.2.4.34 Before attribute name state ................................................................................................. 977
12.2.4.35 Attribute name state ............................................................................................................ 978
12.2.4.36 After attribute name state .................................................................................................... 979
12.2.4.37 Before attribute value state ................................................................................................. 979
12.2.4.38 Attribute value (double-quoted) state .................................................................................. 980
12.2.4.39 Attribute value (single-quoted) state.................................................................................... 980
12.2.4.40 Attribute value (unquoted) state .......................................................................................... 980
12.2.4.41 Character reference in attribute value state ........................................................................ 981
12.2.4.42 After attribute value (quoted) state ...................................................................................... 981
12.2.4.43 Self-closing start tag state ................................................................................................... 982
12.2.4.44 Bogus comment state.......................................................................................................... 982
12.2.4.45 Markup declaration open state ............................................................................................ 982
12.2.4.46 Comment start state ............................................................................................................ 982
12.2.4.47 Comment start dash state ................................................................................................... 983
12.2.4.48 Comment state .................................................................................................................... 983
12.2.4.49 Comment end dash state .................................................................................................... 983
12.2.4.50 Comment end state ............................................................................................................. 984
12.2.4.51 Comment end bang state .................................................................................................... 984
12.2.4.52 DOCTYPE state .................................................................................................................. 984
12.2.4.53 Before DOCTYPE name state............................................................................................. 985
12.2.4.54 DOCTYPE name state ........................................................................................................ 985
12.2.4.55 After DOCTYPE name state................................................................................................ 986
12.2.4.56 After DOCTYPE public keyword state................................................................................. 986
12.2.4.57 Before DOCTYPE public identifier state.............................................................................. 987
12.2.4.58 DOCTYPE public identifier (double-quoted) state............................................................... 987
12.2.4.59 DOCTYPE public identifier (single-quoted) state ................................................................ 988
12.2.4.60 After DOCTYPE public identifier state................................................................................. 988
12.2.4.61 Between DOCTYPE public and system identifiers state ..................................................... 988
12.2.4.62 After DOCTYPE system keyword state............................................................................... 989
12.2.4.63 Before DOCTYPE system identifier state............................................................................ 989
12.2.4.64 DOCTYPE system identifier (double-quoted) state............................................................. 990
12.2.4.65 DOCTYPE system identifier (single-quoted) state .............................................................. 990
12.2.4.66 After DOCTYPE system identifier state............................................................................... 990
12.2.4.67 Bogus DOCTYPE state ....................................................................................................... 991
12.2.4.68 CDATA section state ........................................................................................................... 991
12.2.4.69 Tokenizing character references ......................................................................................... 991
12.2.5 Tree construction........................................................................................................................................ 993
12.2.5.1 Creating and inserting nodes ................................................................................................ 994
12.2.5.2 Parsing elements that contain only text................................................................................. 999
12.2.5.3 Closing elements that have implied end tags........................................................................ 999
12.2.5.4 The rules for parsing tokens in HTML content ...................................................................... 999
12.2.5.4.1 The "initial" insertion mode............................................................................... 999
19
12.2.5.4.2 The "before html" insertion mode ................................................................... 1001
12.2.5.4.3 The "before head" insertion mode.................................................................. 1002
12.2.5.4.4 The "in head" insertion mode .........................................................................1002
12.2.5.4.5 The "in head noscript" insertion mode............................................................ 1004
12.2.5.4.6 The "after head" insertion mode..................................................................... 1005
12.2.5.4.7 The "in body" insertion mode.......................................................................... 1006
12.2.5.4.8 The "text" insertion mode ............................................................................... 1017
12.2.5.4.9 The "in table" insertion mode.......................................................................... 1018
12.2.5.4.10 The "in table text" insertion mode................................................................. 1020
12.2.5.4.11 The "in caption" insertion mode.................................................................... 1020
12.2.5.4.12 The "in column group" insertion mode.......................................................... 1021
12.2.5.4.13 The "in table body" insertion mode............................................................... 1022
12.2.5.4.14 The "in row" insertion mode.......................................................................... 1023
12.2.5.4.15 The "in cell" insertion mode.......................................................................... 1024
12.2.5.4.16 The "in select" insertion mode...................................................................... 1025
12.2.5.4.17 The "in select in table" insertion mode .........................................................1026
12.2.5.4.18 The "in template" insertion mode.................................................................. 1027
12.2.5.4.19 The "after body" insertion mode ................................................................... 1028
12.2.5.4.20 The "in frameset" insertion mode .................................................................1028
12.2.5.4.21 The "after frameset" insertion mode............................................................. 1029
12.2.5.4.22 The "after after body" insertion mode........................................................... 1029
12.2.5.4.23 The "after after frameset" insertion mode..................................................... 1030
12.2.5.5 The rules for parsing tokens in foreign content ................................................................... 1030
12.2.6 The end .................................................................................................................................................... 1033
12.2.7 Coercing an HTML DOM into an infoset .................................................................................................. 1034
12.2.8 An introduction to error handling and strange cases in the parser........................................................... 1034
12.2.8.1 Misnested tags: <b><i></b></i>.......................................................................................... 1035
12.2.8.2 Misnested tags: <b><p></b></p> ....................................................................................... 1035
12.2.8.3 Unexpected markup in tables.............................................................................................. 1037
12.2.8.4 Scripts that modify the page as it is being parsed............................................................... 1038
12.2.8.5 The execution of scripts that are moving across multiple documents ................................. 1039
12.2.8.6 Unclosed formatting elements............................................................................................. 1040
12.3 Serialising HTML fragments .......................................................................................................................................... 1041
12.4 Parsing HTML fragments .............................................................................................................................................. 1043
12.5 Named character references......................................................................................................................................... 1044
13 The XHTML syntax............................................................................................................................................................................. 1054
13.1 Writing XHTML documents............................................................................................................................................ 1054
13.2 Parsing XHTML documents .......................................................................................................................................... 1054
13.3 Serialising XHTML fragments........................................................................................................................................ 1055
13.4 Parsing XHTML fragments ............................................................................................................................................ 1056
14 Rendering........................................................................................................................................................................................... 1058
14.1 Introduction.................................................................................................................................................................... 1058
14.2 The CSS user agent style sheet and presentational hints ............................................................................................ 1058
14.3 Non-replaced elements ................................................................................................................................................. 1059
14.3.1 Hidden elements ...................................................................................................................................... 1059
14.3.2 The page .................................................................................................................................................. 1059
14.3.3 Flow content ............................................................................................................................................. 1060
14.3.4 Phrasing content ...................................................................................................................................... 1062
14.3.5 Bidirectional text ....................................................................................................................................... 1064
14.3.6 Quotes...................................................................................................................................................... 1064
20
剩余1157页未读,继续阅读
2020-03-09 上传
2019-04-11 上传
463 浏览量
2018-06-05 上传
2008-08-26 上传
2018-08-12 上传
2011-11-15 上传
lovelyanimal
- 粉丝: 1
- 资源: 37
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- C语言数组操作:高度检查器编程实践
- 基于Swift开发的嘉定单车LBS iOS应用项目解析
- 钗头凤声乐表演的二度创作分析报告
- 分布式数据库特训营全套教程资料
- JavaScript开发者Robert Bindar的博客平台
- MATLAB投影寻踪代码教程及文件解压缩指南
- HTML5拖放实现的RPSLS游戏教程
- HT://Dig引擎接口,Ampoliros开源模块应用
- 全面探测服务器性能与PHP环境的iprober PHP探针v0.024
- 新版提醒应用v2:基于MongoDB的数据存储
- 《我的世界》东方大陆1.12.2材质包深度体验
- Hypercore Promisifier: JavaScript中的回调转换为Promise包装器
- 探索开源项目Artifice:Slyme脚本与技巧游戏
- Matlab机器人学习代码解析与笔记分享
- 查尔默斯大学计算物理作业HP2解析
- GitHub问题管理新工具:GIRA-crx插件介绍
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功