[9] [DFN[[RUBYB[HTML構文]@en[The HTML syntax]]]] は、 [[HTML]] の構文の一種で、最もよく使われているものです。 [[HTML構文]]は [[SGML]] 風の構文を持っていますが、 [[SGML]] の[[部分集合]]でも[[超集合]]でもなく、
互換性はありません。

;;
[10] [[HTML構文]]に対して、 [[XML]] を構文として採用したものを [[XHTML構文]]と呼びます。 
[[XHTML構文]]は実際にはほとんど使われていません。


[12] [[DOM]] における [CODE(DOMi)@en[[[Document]]]] には
[DFN[[RUBYB[[[HTML文書]]]@en[HTML document]]]]と[[XML文書]]の2種類があります
[SRC[[[HTML5]]]]。両者は、元々どちらの構文で書かれていたかとおおむね一致します。

;; 「おおむね」なのは、 [[DOM]] 上の操作で作られた [CODE(DOMi)@en[[[Document]]]]
も存在するからです。

;; ただし、両者を特に区別せずに「[[HTML文書]]」ということもあります ([[HTML5]]
仕様書の章節名自体がそうなっています)。

* 仕様書

[REFS[
-[13] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-12-31 05:55:07 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#syntax>
]REFS]

* 媒体型

[14] [[HTML文書]] ([[HTML構文]]で記述された[[文書]]) は、[[媒体型]]
[CODE(MIME)@en[[[text/html]]]] として[[札付け]]しなければ[['''なりません''']]
[SRC@en[[[HTML5]]]]。

[15] 逆に、[CODE(MIME)@en[[[text/html]]]] と[[札付け]]された[[文書]]は
[[HTML構文]]として解釈されます [SRC[[[HTML5]]]]。

* 構文

[FIG(list short)[ [189] [[HTML]] の構文
- [[要素]]
-- [[void要素]]
-- [[RCDATA要素]]
-- [[生テキスト要素]]
-- [[外来要素]]
-- [[カスタム要素]]
- [[開始タグ]]
-- [[属性]]
--- [CODE[is][is=""]]
--- [[護符]]
-- [[認められている斜線]]
- [[終了タグ]]
- [[文字参照]]
- [[CDATA区間]]
- [[注釈宣言]]
- [[DOCTYPE]]
]FIG]

[HISTORY[
[98] 過去に [[HTML]] で用いられていたこともある構文には次のものがあります。

[FIG(short list)[
- [[条件付き注釈]]
- [[saved from url]]
- [[RDF/XML/HTML注釈]]
- [[スクリプトマクロ]]
- [[処理指令]]
- [[SGML宣言]]
- [[HTMLにおける他言語統合点]]
]FIG]
]HISTORY]

* 他の言語への HTML の埋め込み構文

[FIG(short list)[
- [[escaped markup]]
]FIG]

* 特別な制約

[4] [[文字符号化宣言]]については、[[文字参照]]を使ってはいけないことや先頭1024バイトに含まれないといけないことのような通常の[[要素]]と異なる制約があります。

[102] [[Pingback]] はその [CODE(HTMLe)@en[[[pingback]]]] [[要素]]の[[文字列]]表現に特別な制約を設けています。

* 構文解析

;; [88] [[HTML構文解析器]]と[[XML構文解析器]]に共通の事項に関しては、
[[構文解析器 (Web)]] を参照してください。

** 仕様書

[REFS[
- [50] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-12-31 05:55:07 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#parsing>
- [51] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2012-12-31 05:55:07 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#parsing-html-fragments>
]REFS]

[52] >>50 では単独の[[文書]]としての[[構文解析]]が、>>51 では特定の [CODE(DOMi)@en[[[Element]]]]
の文脈や任意の [CODE(DOMi)@en[[[Document]]]] の文脈での[[構文解析]] ([CODE(DOMa)@en[[[innerHTML]]]]) が規定されています。

** 刺激的な概念

[FIG(list short)[
- [[change the encoding]]
- [18] [[DOCTYPEスイッチ]]
- [16] [[里親付け]]
- [17] [[養子縁組代理店算法]] ([[AAA]])
- [40] [[多妻ノアの箱舟]]
- [63] [[frameset-ok]]
- [[スクリプトフラグ]]
]FIG]

** 構文解析器の構成要素

[FIG(list short)[
- [[入力ストリーム]]・[[入力バイトストリーム]]
- [[preload scanner]]
- [[構文解析エラー]]
- [[開いている要素のスタック]]
- [[活性書式付け要素のリスト]]
]FIG]

[FIG(list members)[
:[[script nesting level]]:[CODE(JS)@en[[[document.open]]]] から参照されます。
:[[script-created parser]]:[CODE(JS)@en[[[document.open]]]] で作られたかどうかを表します。
:構文解析したテキスト:[CODE(JS)@en[[[document.open]]]] から参照されます。
[[文書]]の [[reload override buffer]] と同じかもしれません。
[CODE(JS)@en[[[document.open]]]] を参照。
]FIG]

;; [[構文解析器 (Web)]] も参照。

[170] [CODE(JS)@en[document.write]] から[[HTML構文解析器]]が呼び出され、
[CODE(HTMLe)@en[script]] [[要素]]が[[挿入]]される場合、
[[利用者エージェント]]依存の方法で[[スクリプト]]を実行するか判断できることになっています。

;; [CODE(HTMLe)@en[script]] 参照。

* 直列化

[190] [[HTMLの直列化]]参照。

* その他の話題

[FIG(list short)[
- [34] [[HTMLのレンダリングの開始]]
- [CODE(JS)@en[[[document.open]]]]
]FIG]

* 非線形な変形

[77] [[HTML構文解析器]]は通常[[節点]]を[[親]]から[[子]]へ、[[兄]]から[[弟]]へ、
[[属性]]から[[内容]]へと順に[[DOM木]]を構築していき、逆方向に進むことはありません。
しかし例外的に次のケースでは、それ以外の[[節点]]に変更が加えられることがあります。

[FIG(list short)[
- [[change the encoding]]
- [[里親付け]]
- [[AAA]]
- [CODE(HTMLe)@en[[[frameset]]]]
- 重複 [CODE(HTMLe)@en[[[html]]]]、[CODE(HTMLe)@en[[[body]]]] タグ
- [CODE(HTMLe)@en[[[head]]]] 後、 [CODE(HTMLe)@en[[[body]]]] 後
- [CODE(HTMLe)@en[[[script]]]]
]FIG]

[89] [[restart the parser]] が発動すると[[構文解析器]]のみならず
[[navigate]] のレベルで処理が再起動されることがあります。

[78] [[里親付け]]が発生すると、開いている [CODE(HTMLe)@en[[[table]]]]
[[要素]]の[[兄]]として[[要素]]などが挿入されることがあります。

[79] [[AAA]] が発動すると、[[節点]]が移動することがあります。

[REFS[
- [80] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2014-07-10 19:47:06 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#misnested-tags:-b-p-/b-/p>
]REFS]

[81] [[frameset-ok]] フラグが ok な状態で [CODE(HTMLe)@en[[[frameset]]]]
[[開始タグ]]が現れると、 [CODE(HTMLe)@en[[[body]]]] [[要素]]が削除されます。

[82] [CODE(HTMLe)@en[[[html]]]] [[開始タグ]]や [CODE(HTMLe)@en[[[body]]]]
[[開始タグ]]は、2つ目以降であっても[[属性]]は (既に設定されていなければ)
無視されずに設定されます。

;; [83] [[スクリプト]]によって設定された[[属性]]も含めて、[[開始タグ]]時点で設定されていない場合のみ2つ目以降の[[開始タグ]]の[[属性]]が該当[[要素]]に設定されます。
[REFS[
- <http://software.hixie.ch/utilities/js/live-dom-viewer/?%3Cbody%3E%0A%0A%3Cscript%3E%0A%20%20document.body.setAttribute%20(%27a%27%2C%202)%3B%0A%3C%2Fscript%3E%0A%0A%3Cbody%20a%3D1%3E>
]REFS]

[86] [CODE(HTMLe)@en[[[head]]]] [[終了タグ]]より後で [CODE(HTMLe)@en[[[body]]]]
[[開始タグ]]より前に現れた [CODE(HTMLe)@en[[[head]]]] [[要素]]の中に現れる[[要素]]は
[CODE(HTMLe)@en[[[head]]]] [[要素]]に挿入され、
[CODE(HTMLe)@en[[[body]]]] [[終了タグ]]より後に現れた[[子要素]]や[[テキスト]]は
[CODE(HTMLe)@en[[[body]]]] [[要素]]に挿入されます。
同じ位置でも[[空白]]や[[注釈]]なら見かけ上の[[親要素]]に挿入されますから、
[[空白]]や[[注釈]]の後に[[子要素]]や[[空白]]以外の[[テキスト]]があると、
[[DOM]] 上の順序が入れ替わります。更に [CODE(HTMLe)@en[[[body]]]]
[[要素]]に関しては、一度[[要素]]や[[テキスト]]が現れると
[CODE(HTMLe)@en[[[body]]]] が[[開いている要素のスタック]]に戻されるので、
その後現れた[[注釈]]や[[空白]]は [CODE(HTMLe)@e[[[body]]]]
[[要素]]に追加されるようになります。

[84] [[構文解析器]]の動作の途中で実行された [CODE(HTMLe)@en[[[script]]]]
により、[[構文解析器]]の途中の[[DOM木]]は任意の形に変形されることがあります。
そのような変形があった後でも、[[構文解析器]]は[[里親付け]]を除き、
[[DOM木]]の最新の状態ではなく[[構文解析]]直後の状態に基づき処理を進めていきます。

[EG[
[85] 例えば[[構文解析]]の途中で [CODE(HTMLe)@en[[[script]]]] が[[開いている要素のスタック]]上の[[要素]]を他の[[文書]]に移動すると、
以後[[構文解析]]が進んでいくと現れる[[要素]]はそちらの[[文書]]に挿入されていくことになります。
]EG]

[90] [[スクリプト]]によって [CODE(HTMLe)@en[[[table]]]] [[要素]]が[[根要素]]となった状態で[[里親付け]]が発生すると、
[[要素]]や[[テキスト]]の挿入先が [CODE(DOMi)@en[[[Document]]]]
になり、 [[DOM]] の制限上挿入できないため、[[構文解析]]の結果が捨てられることとなります。
(捨てられる部分に[[スクリプト]]が含まれていると、[[文書]]に[[挿入]]されないので、
実行もされません。)

* 奇癖モード

[94] [[奇癖モード]]や[[限定奇癖モード]]には、 [[DOCTYPEスイッチ]]によって切り替わります。

[91] [[奇癖モード]]で [CODE(HTMLe)@en[[[p]]]]
[[要素]]が開いている時に [CODE(HTMLe)@en[[[table]]]]
[[要素]]の[[開始タグ]]が現れても、 [CODE(HTMLe)@en[[[p]]]]
[[要素]]は閉じられず、 [CODE(HTMLe)@en[[[table]]]] [[要素]]は [CODE(HTMLe)@en[[[p]]]]
[[要素]]の[[子孫]]となります。

[92] 現在の [[HTML Standard]] では、モードによって[[構文解析]]の動作が変わるのはこれだけです。

;; [93] 歴史的には[[注釈]]の[[構文解析]]の方法が違っていたりしました。
詳しくは[[奇癖モード]]を参照してください。

[95] [[構文解析]]の途中で[[スクリプト]]により [CODE(JS)@en[[[document.open]]]] が呼び出されると、
[CODE(DOMi)@en[[[Document]]]] のモードが途中で変化することがあります。
しかし [CODE(JS)@en[[[document.open]]]] は[[構文解析器]]を停止させ、
新しい[[構文解析器]]で以後の [CODE(JS)@en[[[document.write]]]]
を処理します。ですから、一旦 [[DOCTYPEスイッチ]]でモードが決まると、
その後モードが変わることはありません。

;; 複数 [[DOCTYPE]] があっても、最初のもの以外は無視されます。

* テキストファイルの DOM 構築

[106] [[HTML構文解析器]]は、[[テキストファイル]]への [[navigate]]
でも使われます。

[107] [[HTML構文解析器]]は、 [[MIME型]]として [CODE(MIME)@en[[[text/html]]]]
以外を指定した時の [CODE(JS)@en[[[document.open]]]] の処理でも使われます。

;; [108] [[テキストファイルのDOM構築]]を参照。

* 媒体文書とプラグイン文書、エラー文書

[109] [[navigate]] における[[媒体文書]]、[[プラグイン文書]]、エラー文書の生成では、
[[HTML構文解析器]]は使われませんが、それにほぼ相当する動作が行われます。

;; [110] 例えば [[AppCache選択アルゴリズム]]や [[stop parsing]] が適宜呼び出されます。

;; [111] [[[CODE(HTMLe)@en[iframe]] [CODE(HTMLa)@en[srcdoc]]文書]]の[[構文解析]]のように、
[[DOCTYPE]] はありませんが、[[無奇癖モード]]として扱われるようです。

* 歴史

** SGML 時代

[135] HTML 4 仕様書の制約に従う
[[SGML文書]]。 HTML document。
<https://www.w3.org/TR/html4/conform.html#didx-HTML_document>

[136] [[ISO/IEC15445]] に従って構造化された[[文書]]。
([[ISO‐HTML]] <http://purl.org/NET/ISO+IEC.15445/15445.html#DEFS> 4.15 参照。)

** Web Forms 2.0 HTML 構文の構文解析

[1] [[Web Forms 2.0]] は従来の [[HTML]] と
[[XHTML]] の両方の構文を認めています。
この章では、 [[HTML]] 構文の[[構文解析]]について扱います。

[2] 仕様書:
- [[Web Forms 2.0]]
-- [CSECTION@en[2.18. Handling unexpected elements and values]]
<IW:WF2:"#handling">

[3] '''誤り処理'''

[[Web Forms 2.0]] は、 [[SGML]]
で規定されない曖昧な場合にどう[[構文解析]]するか正確には規定しません。
[[利用者エージェント]]の実装者は、
既存の製品を[[逆工学]]し、適当な動作を模倣[['''するべきです''']]。
[SRC@en[WF2 2.18]]

[5]
[[Web Forms 2.0]] は [[HTML 4]] の拡張として定義されており、
その [[HTML 4]] が [[SGML]] に基づいているので、
>>3 のように規定されているのだと思われます。
しかし、 [[Web Forms 2.0]] の [[HTML]]
[[文書]]は一般に[[妥当]]な [[SGML]]
[[文書]]ではありません ([[DTD]] がないので)。
誤っている[[文書]]は >>4 のように処理するとして、
誤っていない[[文書]]をどう[[構文解析]]するのがいいのかは
[[Web Forms 2.0]] は (わざと) 曖昧にしています。

** HTML5 仕様書による構文解析算法の明確化

[137] [CITE[Re: several messages about serialising HTML and related	subjects]] ([[Ian Hickson <ian@...>]] 著, [CODE[2008-02-29 02:23:03 +09:00]] 版) <http://permalink.gmane.org/gmane.org.w3c.whatwg.discuss/13371>

[138] [CITE[Re: several messages about the HTML syntax]] ([[Ian Hickson <ian@...>]] 著, [CODE[2008-03-02 23:02:07 +09:00]] 版) <http://permalink.gmane.org/gmane.org.w3c.whatwg.discuss/13415>

[139] [CITE[Re: several messages about the tree construction stage of HTML parsing]] ([[Ian Hickson <ian@...>]] 著, [TIME[2008-03-05 07:45:57 +09:00]] 版) <http://permalink.gmane.org/gmane.org.w3c.whatwg.discuss/13438>

[8] [CITE['''['''whatwg''']''' HTML5 Parsing spec first draft ready]] ([TIME[2008-04-02 11:17:11 +09:00]] 版) <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2006-February/005807.html>

[67] [[HTML5]] の[[構文解析]]の仕様は既存の [[Webブラウザー]]の[[HTML構文解析器]]を[[逆工学]]したものでしたが、
既存の[[構文解析器]]は細部においては異なっていましたから、どの [[Webブラウザー]]とも完全には一致していませんでした。
そのためすべての主要 [[Webブラウザー]]が[[構文解析器]]を書き直すことになりました。
この新世代の[[構文解析器]]は一般に[DFN[[RUBYB[HTML5構文解析器]@en[HTML5 parser]]]]と呼ばれています。

[REFS[
- [68] [CITE[Surfin' Safari - Blog Archive » The HTML5 Parsing Algorithm]] ([TIME[2014-04-24 10:47:09 +09:00]] 版) <https://www.webkit.org/blog/1273/the-html5-parsing-algorithm/>
- [69] [CITE@en-US[HTML5 Parser - Web developer guide | MDN]] ([TIME[2014-03-21 12:22:14 +09:00]] 版) <https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/HTML5_Parser>
- [71] [CITE@en[Dev.Opera — 100% Ragnarök’n’roll]] ([TIME[2014-04-24 08:33:46 +09:00]] 版) <http://dev.opera.com/blog/100-ragnarok-n-roll/>
- [70] [CITE@en[HTML5 Parsing in IE10 - IEBlog - Site Home - MSDN Blogs]] ([TIME[2014-04-24 10:49:14 +09:00]] 版) <http://blogs.msdn.com/b/ie/archive/2011/07/06/html5-parsing-in-ie10.aspx>
]REFS]

[132] [[HTML5]] では、[[HTML構文]]のことを [DFN[[[HTML5]]]] と呼んでいました。

;; [133] [[XHTML構文]]は [[XHTML5]] と呼ばれていました。

[11] [[HTML5]] (構文) や [[XHTML5]] は、どちらも [[HTML5]] 仕様書で定義されていました。
(紛らわしかったです。)

[134] [[HTML5]] (と [[XHTML5]]) は、 [CITE[HTML5]] [[仕様書]]が [CITE[HTML Standard]]
となった時、 [[HTML]] (と [[XHTML]]) に改称されました。

* 実装

[76] [[IE9]] は [CODE(XMLe)@en[[[svg]]]] [[開始タグ]]を正しく処理できますが、
[CODE(XMLe)@en[[[math]]]] [[開始タグ]]は未知の [[HTML]] [[開始タグ]]とみなすようです。

* メモ

[203] [CITE[Software Reuse Libraries with Mosaic]], [TIME[2024-10-10T06:16:53.000Z]], [TIME[2001-06-17T16:11:45.904Z]] <https://web.archive.org/web/20010617160658/http://archive.ncsa.uiuc.edu/SDG/IT94/Proceedings/DDay/werkman/www94.html>


[204] >>203
今の[[Webブラウザー]]ではほぼ全文が謎に[[斜体]]で表示される。

ソースを見ると Abstract の [CODE[<p>]] の前に [CODE[<cite>]]
があって、 Abstract 本体の後に [CODE[</cite>]]
がある。

Abstract だけを斜体にしたかったのだろう。当時の [[Webブラウザー]] ([[Mosaic]] かな?)
では [CODE[</cite>]] で[[斜体]]が終わっていたらしい。今は [CODE[p]]
[[要素]]が開いているところに [CODE[</cite>]] があっても閉じられない。



[6]
[CITE@en[Tag Soup: How Mac IE 5 and Safari handle <x> <y> </x> </y>]] ([[Henri Sivonen]] 著, [CODE[2005-07-28 02:07:37 +09:00]] 版) <http://hsivonen.iki.fi/soup-dom/>

[7]
[CITE[Bug 311366 &#8211; should make custom elements able to contain blocks (<section>)]] ([TIME[2007-09-17 12:38:22 +09:00]] 版) <https://bugzilla.mozilla.org/show_bug.cgi?id=311366>


[19] [CITE[IRC logs: freenode / #whatwg / 20090813]]
([TIME[2009-10-10 21:27:36 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20090813#l-171>

[20] [CITE[IRC logs: freenode / #whatwg / 20100324]]
([TIME[2010-04-03 01:03:00 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20100324>

[21] [CITE[Notes on HTML5 Parser History — Anne’s Weblog]]
([TIME[2010-06-03 08:06:42 +09:00]] 版)
<http://annevankesteren.nl/2010/05/html5-parser-history>

[22] [CITE['''['''webkit-dev''']''' HTML5 tokenizer landing soon]]
([TIME[2010-06-22 06:33:13 +09:00]] 版)
<https://lists.webkit.org/pipermail/webkit-dev/2010-June/013244.html>

[23] [CITE[IRC logs: freenode / #whatwg / 20100727]]
([TIME[2010-08-11 00:06:17 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20100727#l-1210>

[24] [CITE[IRC logs: freenode / #whatwg / 20100805]]
([TIME[2010-08-12 23:43:53 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20100805#l-303>

[25] [CITE[IRC logs: freenode / #whatwg / 20100913]]
( ([TIME[2010-09-26 22:31:37 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20100913#l-265>

[26] [CITE[IRC logs: freenode / #whatwg / 20100915]]
( ([TIME[2010-09-28 00:57:22 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20100915#l-454>

[27] [CITE@en[Web Applications 1.0 r5521     Parser foreign lands: Get rid of secondary insertion mode, always use 'in body', scope HTML in foreign lands so that we won't try to close elements cross-namespace (e.g. <svg><p><desc><form> won't imply a </p> that closes the <p>...; <td> won't close all the SVG if the SVG is in a cell).Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10314]]
( ([TIME[2010-09-28 08:45:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=5520&to=5521>

[28] [CITE@en[Web Applications 1.0 r5522     Parser foreign lands: Oops, I missed one of the ways that scoping happens.Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10314]]
( ([TIME[2010-09-28 08:54:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=5521&to=5522>

[29] [CITE@en[Web Applications 1.0 r5563 Revamp how the foreign lands are defined to make it easier to add the U+0000 handling. This checkin should have no normative effect. If there are any normative changes in this patch, that's a bug, pleasel let me know ASAP.Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=9659]]
( ([TIME[2010-09-30 10:40:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=5562&to=5563>

[30] [CITE@en[Web Applications 1.0 r5638     Add in some hard-coded limits for dealing with unclosed formatting elements to limit the explosive growth of the list of formatting elements in commonly-seen cases.Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10802]]
( ([TIME[2010-10-16 07:56:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=5637&to=5638>

[31] [CITE[Bug 10802 – Limit the number of identical items on the list of active formatting elements by removing previous duplicates when adding new items]]
( ([TIME[2010-10-16 08:37:29 +09:00]] 版))
<http://www.w3.org/Bugs/Public/show_bug.cgi?id=10802>

[32] [CITE[Bug 10801 – Limit the number of iterations in the loops in the AAA]]
( ([TIME[2010-10-16 08:38:38 +09:00]] 版))
<http://www.w3.org/Bugs/Public/show_bug.cgi?id=10801>

[33] [CITE[IRC logs: freenode / #whatwg / 20101021]]
( ([TIME[2010-10-29 23:31:18 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20101021>

[35] [CITE@en[Web Applications 1.0 r5920     Change how MathML and SVG are parsed in text/html: use a three-level tree constructor design instead of the two-level design we had before.]]
( ([TIME[2011-03-01 08:56:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=5919&to=5920>

[36] [CITE[IRC logs: freenode / #whatwg / 20110203]]
( ([TIME[2011-03-19 11:46:31 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20110203#l-1313>

[37] [CITE@en-US[htmlparser: Summary]]
( ([TIME[2011-03-19 16:38:17 +09:00]] 版))
<http://hg.mozilla.org/projects/htmlparser/>

[38] [CITE[IRC logs: freenode / #whatwg / 20110608]]
( ([TIME[2011-06-11 01:00:34 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20110608>

[39] [CITE[IRC logs: freenode / #whatwg / 20110724]]
( ([TIME[2011-08-06 17:45:59 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20110724#l-388>

[41] [CITE[''''''[''''''whatwg'''''']'''''' <!DOCTYPE html><body><table><math><mi>foo</mi></math></table> and other parser questions]]
( ([TIME[2011-12-14 08:37:32 +09:00]] 版))
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-December/034163.html>

[42] [CITE@en[Web Applications 1.0 r6870       Try to fix the problem David Flanagan raised a while back with the <!DOCTYPE html><body><table><math><mi>foo</mi></math></table> test case.]]
( ([TIME[2011-12-14 07:36:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=6869&to=6870>

[43] [CITE[IRC logs: freenode / #whatwg / 20120107]]
( ([TIME[2012-01-08 00:12:25 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20120107>

[44] [CITE[''''''[''''''whatwg'''''']'''''' HTMLLinkElement.disabled and HTMLLinkElement.sheet behavior]]
( ([TIME[2012-01-28 11:20:09 +09:00]] 版))
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-January/034544.html>

[45] [CITE[''''''[''''''whatwg'''''']'''''' document.write("\r"): the spec doesn't say how to handle it.]]
( ([TIME[2012-02-14 08:40:30 +09:00]] 版))
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-February/034867.html>

[46] [CITE@en[Web Applications 1.0 r6991     Rejig the wording of the character encoding section to make it more precise and in particular to not make CR processing require look-ahead.]]
( ([TIME[2012-02-14 07:48:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=6990&to=6991>

[47] [CITE[''''''[''''''whatwg'''''']'''''' A plea to Hixie to adopt <main>, and main element parsing behaviour]]
( ([TIME[2012-11-08 07:11:56 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-November/037828.html>

[48] ( ([TIME[2012-11-09 02:23:02 +09:00]] 版))
<http://www.score.is.tsukuba.ac.jp/~minamide/papers/minamide-FM2012.pdf>

[49] ( ([TIME[2012-03-12 04:52:17 +09:00]] 版))
<http://www.score.cs.tsukuba.ac.jp/~minamide/html5spec/model.html5>

[53] [CITE[''''''[''''''webkit-dev'''''']'''''' Feature Announcement: Moving HTML Parser off the Main Thread]]
( ([TIME[2013-01-10 19:57:20 +09:00]] 版))
<http://lists.webkit.org/pipermail/webkit-dev/2013-January/023271.html>

[54] [CITE[HTML parser design - Google ドライブ]] ([TIME[2013-02-16 05:58:52 +09:00]] 版) <https://docs.google.com/a/google.com/drawings/d/1hwYyvkT7HFLAtTX_7LQp2lxA6LkaEWkXONmjtGCQjK0/edit>


[55] [CITE[Threaded HTML parser enabled on trunk - Google グループ]]
( ([TIME[2013-05-26 05:42:39 +09:00]] 版))
<https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/hBUVtg7gacE>

[56] [[Chrome]] は [[JavaScript]] の実行をドメインごとにブロックできますが、
ブロックまたはブロック解除の直後は [[JavaScript]] の実行のみオン・オフされ、[[HTML]]
の構文解析器は従前のモードのままになります。[[ウィンドウ]]を閉じて開き直すと完全に反映されます。
このため構文解析器は [CODE(HTMLe)@en[[[noscript]]]] の中身を解釈するのに [[JavaScript]]
が実行されたり、その逆になったりします。 [TIME[2013-06-07T05:52:05.700Z]]

[57] [CITE@en[Web Applications 1.0 r7999     Another very risky change! Please review! This attempts to refactor the parser logic so that the ownerDocument is explicitly set at each place a node is created by the parser. This actually fixes an ambiguity, which was what should happen when a script has transplated a node that is still on the stack of open elements into a Document without a browsing context, if the node created has some magic (e.g. <img src>, <script>).]]
( ([TIME[2013-06-26 05:55:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7998&to=7999>

[58] [CITE@en[Web Applications 1.0 r7998 Very risky editorial change! Please review! This attempts to refactor the parser logic so that the foster parenting is actually done inline in a single algorithm that is called by anywhere in the parser that could be affected by it. This will allow us to add the <template> magic with minimal actual magic in the prose, hopefully.]]
( ([TIME[2013-06-25 14:37:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7997&to=7998>

[59] [CITE[''''''[''''''whatwg'''''']'''''' Namespaces and tag names in the HTML parser]]
( ([TIME[2013-07-02 07:53:15 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-July/039913.html>

[60] [CITE[''''''[''''''whatwg'''''']'''''' Another issue in 12.2.5.5 parsing tokens in foreign content]]
( ([TIME[2013-08-01 01:41:59 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-July/040314.html>

[61] [CITE@en-GB-x-Hixie[Hixie's Natural Log: Tag Soup: How UAs handle <x> <y> </x> </y>]]
( ([TIME[2013-08-18 19:11:22 +09:00]] 版))
<http://ln.hixie.ch/?start=1037910467&count=1>

[62] [CITE@en[Streamable non-fatal non-conforming HTML parser error recovery  strategy]]
( ([[Simon Pieters]] 著, [TIME[2013-10-03 23:25:16 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-archive/2013Oct/0009.html>

[64] [CITE@en[Parsing (Windows)]]
( ([TIME[2013-11-13 13:54:34 +09:00]] 版))
<http://msdn.microsoft.com/en-us/library/ie/hh673554(v=vs.85).aspx>

[65] [CITE[''''''[''''''whatwg'''''']'''''' Should ambiguous ampersand be a parse error?]]
( ([TIME[2014-01-22 23:54:55 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-January/041905.html>

[66] [CITE@en[Web Applications 1.0 r8554       Drop filterRes SVG attribute from the HTML parser, since it has fallen into disrepute.]]
( ([TIME[2014-03-19 03:36:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8553&to=8554>

[72] [CITE[IRC logs: freenode / #whatwg / 20140427]]
( ([TIME[2014-04-29 10:55:29 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20140427>

[73] [CITE@en[Web Applications 1.0 r8592     PARSER CHANGE: remove some attributes from the SVG attribute mapping]]
( ([TIME[2014-05-01 03:55:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8591&to=8592>

[74] [CITE[nolanw/HTMLReader]]
( ([TIME[2014-06-14 02:51:00 +09:00]] 版))
<https://github.com/nolanw/HTMLReader>

[75] [CITE[IRC logs: freenode / #whatwg / 20140613]]
( ([TIME[2014-06-14 11:47:11 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20140613#l-683>

[87] [CITE[Flag HTML response as "HTML document". Set encoding also for XML. https:... · 572a6c6 · whatwg/xhr]]
( ([TIME[2014-01-08 07:27:26 +09:00]] 版))
<https://github.com/whatwg/xhr/commit/572a6c6c86562d31a217dac95d3e845ecc9a0fe4>

[96] [CITE[IRC logs: freenode / #whatwg / 20091112]]
([TIME[2009-12-17 23:21:20 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20091112>

[97] [CITE[''''''[''''''whatwg'''''']'''''' Parser-related philosophy]]
( ([TIME[2013-07-27 06:52:19 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-July/040261.html>


[99] [CITE[Surfin' Safari - Blog Archive » The HTML5 Parsing Algorithm]]
( ([TIME[2014-09-03 04:18:21 +09:00]] 版))
<https://www.webkit.org/blog/1273/the-html5-parsing-algorithm/>

[100] [CITE@en[886390 – Assigning to innerHTML on an SVG element should create elements in the SVG namespace]]
( ([TIME[2014-09-09 02:17:17 +09:00]] 版))
<https://bugzilla.mozilla.org/show_bug.cgi?id=886390>

[101] [CITE@en[Web Applications 1.0 r8856 Try to clarify stuff around fragment parsing (this removes the ability to call the fragment parsing algorithm without a context node; I couldn't find anyone doing that, but if I missed a case please let me know)]]
( ([TIME[2014-11-21 03:08:00 +09:00]] 版))
<https://html5.org/r/8856>

[103] [CITE@en[Web Applications 1.0 r8889 Clarify the handling of CRLF in HTML.]]
([TIME[2015-03-05 09:29:00 +09:00]] 版)
<https://html5.org/r/8889>

[104] [CITE[Part1 - browsersec - Browser Security Handbook, part 1 - Browser Security Handbook - Google Project Hosting]]
([TIME[2015-03-31 16:58:06 +09:00]] 版)
<https://code.google.com/p/browsersec/wiki/Part1#Hypertext_Markup_Language>

[105] [CITE@en[Ygg01/html5ever]]
([TIME[2015-04-29 00:32:43 +09:00]] 版)
<https://github.com/Ygg01/html5ever>

[112] [CITE[Hixie's Natural Log: Tag Soup: Crazy parsing adventures]] 
<http://ln.hixie.ch/?start=1137740632&count=1>

おかしな[[HTML]][[文書]]から各ブラウザが生成する[[DOM]]は奇々怪々。
([[名無しさん]] [WEAK[2006-01-21 04:09:31 +00:00]])



[113] [CITE@en[Editorial: synchronize with the DOM Standard · whatwg/html@21c6ec7]]
([TIME[2016-03-20 18:09:42 +09:00]] 版)
<https://github.com/whatwg/html/commit/21c6ec77594eb89b836d4872222f5916910967fd>

[114] [CITE@en[Formalize bogus comment state · whatwg/html@28a40d1]]
([TIME[2016-04-07 21:02:56 +09:00]] 版)
<https://github.com/whatwg/html/commit/28a40d193f38903bd328f4cf7fab460ad67058b3>

[115] [CITE@en[Fixup previous commit's MathML element references · whatwg/html@77c3dc4]]
([TIME[2016-04-09 12:41:57 +09:00]] 版)
<https://github.com/whatwg/html/commit/77c3dc4863a212cc944eede0e09907bec52cde43>

[116] [CITE@en[Formalize CDATA section state · whatwg/html@cbf837d]]
([TIME[2016-04-09 16:03:20 +09:00]] 版)
<https://github.com/whatwg/html/commit/cbf837db2dab5eb68bab2204f1cefc7b64b2df75>

[117] [CITE@en[Fix #234: Change <menuitem> from void to like-<option> · whatwg/html@5e49a20]]
([TIME[2016-04-16 20:59:04 +09:00]] 版)
<https://github.com/whatwg/html/commit/5e49a20874fabef620bf7ea0be7534c73fbd58c4>

[118] [CITE@en[Editorial: define "reconsume" and avoid duplication of its steps · whatwg/html@d82b76d]]
([TIME[2016-04-17 14:18:40 +09:00]] 版)
<https://github.com/whatwg/html/commit/d82b76dd6c1f87c3100126e87da8d66a6708b888>

[119] [CITE@en[''''''[''''''giow'''''']'''''' (2) Make 'emit' always come after 'switch', and remove any men… · whatwg/html@1e5bf56]]
([TIME[2010-07-14T21:10:48Z]] 版)
<https://github.com/whatwg/html/commit/1e5bf56f577ce924683470d595931865a197fb1f>

[120] [CITE@en[Remove <isindex> and <input name=isindex> · whatwg/html@5c44abc]]
([TIME[2016-04-25 17:28:01 +09:00]] 版)
<https://github.com/whatwg/html/commit/5c44abc734eb483f9a7ec79da5844d2fe63d9c3b>

[121] [CITE@en[Add custom elements to HTML · whatwg/html@6e7eaa4]]
([TIME[2016-04-26 18:24:53 +09:00]] 版)
<https://github.com/whatwg/html/commit/6e7eaa4bd2912965fd83766f99f984f249531f3a>

[122] [CITE@en[Rust macros in html5ever]]
( ([TIME[2015-06-07 01:37:41 +09:00]]))
<https://kmcallister.github.io/talks/rust/2014-rust-macros/slides.html>

[123] [CITE@en[Fix wording mistake in parsing a character reference]]
( ([[zcorpan]]著, [TIME[2016-06-01 22:08:31 +09:00]]))
<https://github.com/whatwg/html/commit/918a56e5d1e9e86695770bf10c1893dd7bae6946>

[124] [CITE@en[Add examples for non-roundtrippable HTML]]
( ([[zcorpan]]著, [TIME[2016-06-08 06:12:37 +09:00]]))
<https://github.com/whatwg/html/commit/970ef7eb56bdb1fa709b7b084818597a2b686bfa>

[125] [CITE@en[Allow dashes in comments]]
([[zcorpan]]著, [TIME[2016-06-21 06:46:50 +09:00]])
<https://github.com/whatwg/html/commit/518d16fdc672d1023dcfd2847d86f559d13a842f>

[126] [CITE@en[Allow comments to end with <!-->]]
([[zcorpan]]著, [TIME[2016-06-24 01:20:26 +09:00]])
<https://github.com/whatwg/html/commit/1633b9aadab815e6daba17950c4ff81a80b896ed>

[127] [CITE@en[Remove <menuitem> from Special category]]
([[nolanw]]著, [TIME[2016-07-04 15:39:37 +09:00]])
<https://github.com/whatwg/html/commit/7ecbcf1a037449c3d58e26ec704f5cb4cbdcf903>

[128] [[Webブラウザー]]以外の (おそらく適当なパターンマッチしかしていない)
ツールでは、 [CODE(HTMLe)@en[head]] や [CODE(HTMLe)@en[body]]
の[[タグ]]の省略すら正しく扱えない雑なものもあります。
[TIME[2016-07-28T03:14:05.900Z]]

[129] [CITE@en[Simplify EOF handling in the parser]]
([[RReverser]]著, [TIME[2016-08-09 15:20:18 +09:00]])
<https://github.com/whatwg/html/commit/d2461df035aaccd4765a5ed6ea891f30303722d0>

[130] [CITE@en[Reconstruct active formatting elements for <menuitem>]]
([[zcorpan]]著, [TIME[2016-08-11 02:46:18 +09:00]])
<https://github.com/whatwg/html/commit/2999aa01438bdef11ba10aef82b775293efbef79>

[131] [CITE@en[Pass token instead of tag name to the adoption agency algorithm]]
([[zcorpan]]著, [TIME[2016-08-11 02:54:53 +09:00]])
<https://github.com/whatwg/html/commit/c3190514c682953f598f7d1df02f0ad16dc960ae>

[140] [CITE@en[Make document.write etc. throw during parsing custom elements]]
([[domenic]]著, [TIME[2016-08-17 15:44:39 +09:00]])
<https://github.com/whatwg/html/commit/00c6fa07bdb9f0d08a28f6c6e1ababca7d08618c>

[141] [CITE@en[Process custom element connectedCallback immediately during parsing]]
([[domenic]]著, [TIME[2016-08-24 15:32:24 +09:00]])
<https://github.com/whatwg/html/commit/ca818ee1c8458c3b862acd00d11779294cb89eea>

[142] [CITE@en[Don't serialize an extra LF in <pre>, <textarea>, <listing>]]
([[zcorpan]]著, [TIME[2016-09-24 18:47:14 +09:00]])
<https://github.com/whatwg/html/commit/2aa0000433f8c34263d29cee31bc95b1efdfef46>

[143] [CITE@en[Restore <xmp> to the "special" elements list]]
([[cscott]]著, [TIME[2016-10-18 09:00:27 +09:00]])
<https://github.com/whatwg/html/commit/00f25b32f60022329202825e87c3b82afbd55c16>

[144] [CITE@en[Web Applications 1.0 r6333 Move some of the quirky API requirements to DOM Core.]]
([TIME[2011-07-28 08:10:00 +09:00]] 版)
<http://html5.org/tools/web-apps-tracker?from=6332&to=6333>


[145] [CITE@en['''['''cgiowt''']''' (2) Reduce redundant parse errors in some edge cases involvi…]]
([[Hixie]]著, [TIME[2014-06-05 12:09:07 +09:00]])
<https://github.com/whatwg/html/commit/5e703c13ebbb94891511c4924ac36a45e6905e0f>

[146] [CITE@en['''['''cgiowt''']''' (3) PARSER: Change whether <template><td></template> is a pa…]]
([[Hixie]]著, [TIME[2014-06-14 07:00:22 +09:00]])
<https://github.com/whatwg/html/commit/b29ecbe1b74218130ba5c82fa79a943a35f3daea>

[147] [CITE@en['''['''ct''']''' (3) PARSER: apply r2806 fix to eof tokens as well]]
([[Hixie]]著, [TIME[2014-06-11 13:04:23 +09:00]])
<https://github.com/whatwg/html/commit/64037adb40c16b41a38699c48e9110e0dacc980c>

[148] [CITE@en['''['''cgiowt''']''' (3) PARSER: when inlining the fake tags, I missed that <sele…]]
([[Hixie]]著, [TIME[2014-06-10 15:33:22 +09:00]])
<https://github.com/whatwg/html/commit/56a9a3f2e77092f6cf953b09b117217232e9d852>

[149] [CITE@en['''['''e''']''' (0) Clean up some stuff in the 'in select' insertion mode]]
([[Hixie]]著, [TIME[2014-06-10 15:43:28 +09:00]])
<https://github.com/whatwg/html/commit/2e0d23dbd5a28b49aea0e14debbef481e3339d8b>

[150] [CITE@en['''['''giowct''']''' (3) PARSER: Add a parse error for non-space characters in <t…]]
([[Hixie]]著, [TIME[2014-06-09 14:43:49 +09:00]])
<https://github.com/whatwg/html/commit/dab72ccea3b31bb74489358c6be5d7cc1cfe8ead>

[151] [CITE@en['''['''giowt''']''' (3) PARSER: Only run the SVG script execution logic if a <scr…]]
([[Hixie]]著, [TIME[2014-06-13 04:39:31 +09:00]])
<https://github.com/whatwg/html/commit/7ae642f94e0c262d1f816b73f3fa23de8867d595>

[152] [CITE@en['''['''e''']''' (0) PARSER: clarify what it means for there to be no 'adjusted cu…]]
([[Hixie]]著, [TIME[2014-06-13 04:32:46 +09:00]])
<https://github.com/whatwg/html/commit/6de16099bfe08c7bfe49fde6f1bc75189ba34582>

[153] [CITE@en['''['''cgiowt''']''' (3) PARSER CHANGE: Change the Adoption Agency Algorithm so t…]]
([[Hixie]]著, [TIME[2014-03-07 04:48:44 +09:00]])
<https://github.com/whatwg/html/commit/ca405b3e4f1a7b6c5f50a12d6a8d144dbfdd7c25>

[154] [CITE@en[Remove obsolete permitted DOCTYPEs]]
([[sideshowbarker]]著, [TIME[2016-11-18 00:22:24 +09:00]])
<https://github.com/whatwg/html/commit/31c20af4913f997926b3c806e218d3d16a2944f2>

[155] [CITE@en[Restrict comment syntax to not contain --> or --!>]]
([[yuyokk]]著, [TIME[2016-11-29 07:17:01 +09:00]])
<https://github.com/whatwg/html/commit/4637996e5f1579659e0351a6fac5c930c3ea553e>

[156] [CITE@en-GB-hixie[Web Applications 1.0]]
([TIME[2016-12-16 09:10:02 +09:00]])
<https://web.archive.org/web/20050507071329/http://www.whatwg.org/specs/web-apps/current-work/#parsing>

[157] [CITE@en-GB-hixie[Web Applications 1.0]]
([TIME[2016-12-16 09:11:43 +09:00]])
<https://web.archive.org/web/20060202011253/http://whatwg.org/specs/web-apps/current-work/#parsing>

[158] [CITE@en[Make <menuitem> parse like an unknown element]]
([[zcorpan]]著, [TIME[2017-02-03 18:25:11 +09:00]])
<https://github.com/whatwg/html/commit/0ca0377a7ca6d87fb40e0b97e0ee074300b39a32>

[159] [CITE@en[Regression fix: ASCII lower alpha → ASCII upper alpha in the parser]]
([[annevk]]著, [TIME[2017-02-22 01:11:32 +09:00]])
<https://github.com/whatwg/html/commit/f1afebd3c04d12172ead806debf2bbbfff47f5e1>

[160] [CITE@en[Editorial: use noncharacter and control from Infra]]
([[annevk]]著, [TIME[2017-04-03 19:40:46 +09:00]])
<https://github.com/whatwg/html/commit/70925237a88d9802bfe7224fe9c78b146af615be>

[161] [CITE@en[Regression fix: deal with ASCII digits before ASCII hex digits]]
([[annevk]]著, [TIME[2017-04-04 20:48:46 +09:00]])
<https://github.com/whatwg/html/commit/f8e75a974ed9185e5b462bc5b2dfb32034bd1145>

[162] [CITE@en[Editorial: Introduce named character reference state]]
([[inikulin]]著, [TIME[2017-04-26 21:34:45 +09:00]])
<https://github.com/whatwg/html/commit/7d3201282d31c30cdba2583445d3727a94390286>

[163] [CITE@en[Editorial: Formalize markup declaration open state]]
([[inikulin]]著, [TIME[2017-04-26 21:23:42 +09:00]])
<https://github.com/whatwg/html/commit/2d5febb2ab617c915f1542744fef1b544bacb460>

[164] [CITE@en[Add unique ids to each parse error · Issue #1339 · whatwg/html]]
([TIME[2017-05-12 14:58:32 +09:00]])
<https://github.com/whatwg/html/issues/1339>

[165] [CITE@en[HTML Parse Error Standartization Working Group]]
([TIME[2017-05-12 14:58:44 +09:00]])
<https://github.com/HTMLParseErrorWG>

[166] [CITE@en[meta/WORKFLOW.md at master · HTMLParseErrorWG/meta]]
([TIME[2017-05-12 14:59:56 +09:00]])
<https://github.com/HTMLParseErrorWG/meta/blob/master/WORKFLOW.md>

[167] [CITE@en[Remove parse error on NULLs from input stream preprocessing stage]]
([[inikulin]]著, [TIME[2017-05-12 21:07:36 +09:00]])
<https://github.com/whatwg/html/commit/8fa65b73575ed692ec7f75665bde32134acc4dd6>

[168] [CITE@en[Assign IDs to and explain all tokenization parse errors]]
([[inikulin]]著, [TIME[2017-06-01 07:28:58 +09:00]])
<https://github.com/whatwg/html/commit/32dbd7d5b938ffda725e74dba8a50ed0c3b83b6d>

[169] [CITE@en[Allow not executing scripts inserted by document.write()]]
([[domenic]]著, [TIME[2017-07-14 05:37:38 +09:00]])
<https://github.com/whatwg/html/commit/15b258dc74ffe1ba321b81a1c876f129681a97c2>

[171] [CITE@en[Clarify that 0x0D CR is not allowed in entities]]
([[Alcaro]]著, [TIME[2017-08-05 09:06:42 +09:00]])
<https://github.com/whatwg/html/commit/efcf0af907c13343d898bf47b5ab004ed59724dd>

[172] [CITE@en[Handle ambiguous ampersands of arbitrary length]]
([[inikulin]]著, [TIME[2017-06-24 04:00:15 +09:00]])
<https://github.com/whatwg/html/commit/ee198945e388bd3298b73fb842fa0175d5b6a0f9>

[173] [CITE@en['''['''Parser''']''' Handle ambiguous ampersands of arbitrary length (closes #1257) by inikulin · Pull Request #2731 · whatwg/html]]
([TIME[2017-08-25 22:37:56 +09:00]])
<https://github.com/whatwg/html/pull/2731>

[174] [CITE@en[Make U+0000 a parse error in bogus comment and bogus DOCTYPE states]]
([[zcorpan]]著, [TIME[2017-08-17 23:03:56 +09:00]])
<https://github.com/whatwg/html/commit/5a6fef58056832140fecf1580ca815f385730cec>

[175] [CITE@en[Parse errors on NULLs in bogus comment. · Issue #2684 · whatwg/html]]
([TIME[2017-08-25 22:42:42 +09:00]])
<https://github.com/whatwg/html/issues/2684>

[176] [CITE@en[Make U+0000 a parse error in bogus comment and bogus DOCTYPE states by zcorpan · Pull Request #2939 · whatwg/html]]
([TIME[2017-08-25 22:43:37 +09:00]])
<https://github.com/whatwg/html/pull/2939>

[177] [CITE@en[Track HTML parser form-associated elements with a flag]]
([[annevk]]著, [TIME[2017-08-19 16:02:48 +09:00]])
<https://github.com/whatwg/html/commit/384c30c56d6dfd26dfbd3a5024ae10e7f7134483>

[178] [CITE@en[Remove <applet> (except for parsing rules) · Issue #454 · whatwg/html]]
([TIME[2017-08-25 23:41:49 +09:00]])
<https://github.com/whatwg/html/issues/454>

[179] [CITE@en[Regression fix: Lost ampersands in Character Reference State's Anythi…]]
([[JonathanO]]著, [TIME[2017-08-16 15:06:21 +09:00]])
<https://github.com/whatwg/html/commit/8d2875784cd4684fd85f4421a1d173902d0e1760>

[180] [CITE@en[Editorial: Clarify what happens to U+0000 chars]]
([[sideshowbarker]]著, [TIME[2017-08-28 16:11:20 +09:00]])
<https://github.com/whatwg/html/commit/05d0ae71e82871e2fd1785829d180218da83abe7>

[181] [CITE@en[Editorial: Clarify what happens to U+0000 chars by sideshowbarker · Pull Request #2968 · whatwg/html]]
([TIME[2017-08-29 11:25:27 +09:00]])
<https://github.com/whatwg/html/pull/2968>

[182] [CITE@en[Improve <style> and <script> processing and conformance]]
([[domenic]]著, [TIME[2017-09-14 18:42:48 +09:00]])
<https://github.com/whatwg/html/commit/9c612ac8641b5174849a2d3cb924fe662a8d3a09>

[183] [CITE@en[Improve <style> and <script> processing and conformance by domenic · Pull Request #3024 · whatwg/html]]
([TIME[2017-09-19 22:47:04 +09:00]])
<https://github.com/whatwg/html/pull/3024>

[184] [CITE@en[Require UTF-8]]
([[sideshowbarker]]著, [TIME[2017-10-06 19:09:17 +09:00]])
<https://github.com/whatwg/html/commit/fae77e3c558b9f083dfb9086752863a4789268f5>

[185] [CITE@en[Elements with duplicated attributes are not nonceable.]]
([[mikewest]]著, [TIME[2017-11-27 17:28:11 +09:00]])
<https://github.com/w3c/webappsec-csp/commit/649393514b9aaf9277bfd21ee1834f4befd029be>

[186] [CITE@en[Editorial: further cleanup "abort these steps"]]
([[shreyateeza]]著, [TIME[2018-01-09 20:22:36 +09:00]])
<https://github.com/whatwg/html/commit/99e2cdfc484c2ff14cbf5c38b859f4d6da17e64c>

[187] [CITE@en[Allow UAs to conditionally block on stylesheet loading]]
([[domfarolino]]著, [TIME[2018-01-12 17:19:01 +09:00]])
<https://github.com/whatwg/html/commit/42dd707cbfc0f5d8f88b04ef270f4fcb121a10ff>

[188] [CITE@en[Hide `nonce` content attribute values. (#2369) by mikewest · Pull Request #2373 · whatwg/html]]
([TIME[2018-02-17 23:23:34 +09:00]])
<https://github.com/whatwg/html/pull/2373>

[191] [CITE@en["Hexademical character reference start state" · Issue #4006 · whatwg/html]]
([TIME[2018-10-17 13:03:42 +09:00]])
<https://github.com/whatwg/html/issues/4006>

[192] [CITE@en[Editorial: sentence-case “Escapable raw text elements”]]
([[eeeps]]著, [TIME[2018-11-15 08:43:17 +09:00]])
<https://github.com/whatwg/html/commit/b921d020af9523ac4e4972097ef20530185ca939>

[193] [CITE@en["escapable raw text elements" · Issue #3895 · whatwg/html]]
([TIME[2019-03-10 18:57:20 +09:00]])
<https://github.com/whatwg/html/issues/3895>

[194] [CITE@en[Editorial: sentence-case “Escapable raw text elements” by eeeps · Pull Request #3896 · whatwg/html]]
([TIME[2019-03-10 18:57:28 +09:00]])
<https://github.com/whatwg/html/pull/3896>

[195] [CITE@en[Restrict application caches to secure contexts]]
([[annevk]]著, [TIME[2018-11-10 06:46:16 +09:00]])
<https://github.com/whatwg/html/commit/81344cc9f567bfafaed57805fd9cdf9f4a4237bf>

[196] [CITE@en[Treat CR, LF, CRLF the same for alert/confirm/prompt]]
([[domenic]]著, [TIME[2018-11-21 08:19:05 +09:00]])
<https://github.com/whatwg/html/commit/76638126838951c21aee4a1220cd0a4e57f3081d>

[FIG(quote)[
[FIGCAPTION[
[197] [CITE@lang=[EUも廃止の方向へ。日本のサマータイム導入って結局どうなった? | ジョイキャリア]]
([TIME[2019-08-15 10:19:25 +09:00]])
<https://career.joi.media/workstyle/2019/05/24/8879/?source=category>
]FIGCAPTION]

> <!doctype html><html lang="lang="ja"
>  prefix="og: http://ogp.me/ns#" "><head>

]FIG]


[198] [CITE@en[Idiosyncrasies of the HTML parser - The HTML Parser Book]]
([TIME[2020-12-18T03:16:22.000Z]])
<https://htmlparser.info/>

[199] [CITE@en[zcorpan/html-parser-book: Idiosyncracies of the HTML parser]]
([TIME[2020-12-18T03:16:52.000Z]])
<https://github.com/zcorpan/html-parser-book/>


[200] [CITE@ja[HTML を取り扱う | ちいさな Web ブラウザを作ってみよう]], [TIME[2021-08-09T23:21:30.000Z]], [TIME[2023-08-01T06:21:40.553Z]] <https://browserbook.shift-js.info/chapters/parsing-html>

>
他の多くのプログラミング言語と異なり、HTML の取り扱いがやっかいな理由の一つに、HTML Standard は HTML の字句規則や構文規則が正規表現や BNF のような形で記述されていないという事実が挙げられます。 本来、正規表現や BNF のような形で HTML の字句規則や構文規則が定義されているのであれば、HTML の取り扱いには、一般的なコンパイラ作成のときの考え方をそのまま適用できるはずなのにです。 とりわけ世の中には flex や bison といった字句解析器・構文解析器を生成するためのツールも存在しますから、この場合、実装難易度は大きく下がるはずです。
>
いま、HTML の構文が BNF のような形で記述されていない背景には、多少マークアップが雑でも Web ページの利用に支障が出ないように、HTML が非常にゆるい文法を採用していることが挙げられます。

[201] >>200 この説明は'''誤り'''。 [[HTML]] が [[BNF]] を使わないのは、
[[BNF]] では [[HTML構文解析器]]を正確に記述できないから。
「生成規則を flex や bison に食わせれば構文解析器は簡単に作れる」
というまさにその考え方 [WEAK[(によってもたらされる[[相互運用性]]の低下)]] への反省が今の 
[CITE[HTML Standard]] を形作っている。

[202] 
[CITE[HTML Standard]] が [[BNF]] を使っていないのは、
「ゆるい文法」
が [[BNF]] で記述できないからではない。
実際、 
[CITE[HTML Standard]] の ([[構文解析器]]ではなく) [[HTML構文]]の章は、
[[英語]]で書かれているが、 [[BNF]] にほぼ逐語訳できる。
文法を [[BNF]] で書けるかどうかと[[構文解析器]]の挙動は別の問題で、
それぞれちゃんと記述したのが [CITE[[[HTML5]]]]
の成果。






[FIG(data)[ [216] [[HTML要素概説]]


:注釈:
-
[DFN[[RUBYB[HTML5構文解析器][HTML5 parser]]]]
[CITE[HTML5]]
の規定に従った[[構文解析器]]。
[CITE[HTML5]]
の[[構文解析器]]は [[Internet Explorer]]
をはじめとするそれ以前の主要な[[Webブラウザー]]の挙動を解析して規定されたものだったが、
当時は実装ごとの違いも多かった。
主要な[[Webブラウザー]]は
[CITE[HTML5]]
の規定に従い[[構文解析器]]を全面改修したため、
従来の[[構文解析器]]と区別して[[HTML5構文解析器]]という。
現在ではすべてが[[HTML5構文解析器]]である
(ただし [CITE[HTML5]] 以後の仕様変更を含む)。


]FIG]




[205] 
[[Internet Archive]] は [[HTMLの構文解析]]も自前でやるように書き換えてたりするの?

- [206] [CITE[i-DNS.net International]], [TIME[2025-06-24T12:49:00.000Z]] <https://web.archive.org/web/20060113220809im_/http://www.i-dns.net/samples/tamil.html>
- [207] [CITE[null]], [TIME[2025-06-24T12:49:08.000Z]], [TIME[2006-01-13T22:08:09.685Z]] <https://web.archive.org/web/20060113220809/http://www.i-dns.net/samples/tamil.html>

無変換の >>206 は [[Firefox]] でも [[Chrome]] でもそれっぽく表示されるが、
改変のある >>207 は変な [[DOM]] が作られている。
[CODE[body]] 要素の子供に [CODE[html]] があってその子供に [CODE[head]]]
があってその子供に [CODE[meta]] があってその子供に [CODE[title]]
があってその子供に [CODE[link]]
の子供に [CODE[body]]
しばらく飛んで [CODE[table]] の下に [CODE[tbody]] がなぜかないのに [CODE[tr]]
があって更に飛んで [CODE[br]] の子供にいろいろが入っている。めちゃくちゃ!
[[Firefox]] でも [[Chrome]] でもこのへんな [[DOM]] になる。
[TIME[2025-06-24T12:52:13.400Z]]








