| 1 |
apache |
1.7 |
#pattern
|
| 2 |
|
|
<span class=secno>* </span>Parsing HTML documents
|
| 3 |
apache |
1.4 |
#ja
|
| 4 |
apache |
1.7 |
<span class=secno>$1 </span>HTML 文書の構文解析
|
| 5 |
apache |
1.4 |
|
| 6 |
|
|
#en
|
| 7 |
|
|
<em>This section only applies to user agents, data mining tools, and
|
| 8 |
|
|
conformance checkers.</em>
|
| 9 |
|
|
#ja
|
| 10 |
|
|
<em>この節は利用者エージェント、データ・マイニング・ツール、
|
| 11 |
|
|
適合性検査器のみに適用されます。</em>
|
| 12 |
|
|
|
| 13 |
|
|
#en
|
| 14 |
wakaba |
1.59 |
The rules for parsing <a href=#xml-documents>XML documents</a> (and
|
| 15 |
|
|
thus <a href=#xhtml5>XHTML</a> documents) into DOM trees are covered by
|
| 16 |
apache |
1.4 |
the XML and Namespaces in XML specifications, and are out of scope of this
|
| 17 |
wakaba |
1.59 |
specification. <a href=#refsXML>[XML]</a> <a
|
| 18 |
|
|
href=#refsXMLNS>[XMLNS]</a> <!-- XXX refs -->
|
| 19 |
apache |
1.4 |
#ja
|
| 20 |
wakaba |
1.59 |
<a href=#xml-documents>XML 文書</a> (や <a href=#xhtml5>XHTML</a> 文書)
|
| 21 |
apache |
1.4 |
を構文解析して DOM 木を得るための規則は XML や XML 名前空間の仕様書で扱われており、
|
| 22 |
wakaba |
1.59 |
この仕様書の適用範囲外です。 <a href=#refsXML>[XML]</a> <a
|
| 23 |
apache |
1.4 |
|
| 24 |
|
|
#en
|
| 25 |
wakaba |
1.59 |
For <a href=#html-documents>HTML documents</a>, user agents must use the
|
| 26 |
apache |
1.4 |
parsing rules described in this section to generate the DOM trees.
|
| 27 |
|
|
Together, these rules define what is referred to as the <dfn
|
| 28 |
wakaba |
1.59 |
id=html-parser>HTML parser</dfn>.
|
| 29 |
apache |
1.4 |
#ja
|
| 30 |
wakaba |
1.59 |
<a href=#html-documents>HTML 文書</a>については、利用者エージェントは、 DOM
|
| 31 |
apache |
1.4 |
木を生成するためにこの節で説明する構文解析規則を使用しなければ[[MUST:なりません]]。
|
| 32 |
|
|
また、この規則は<dfn
|
| 33 |
wakaba |
1.59 |
id=html-parser>HTML 構文解析器</dfn>と呼ばれるものを定義します。
|
| 34 |
apache |
1.4 |
|
| 35 |
|
|
#en
|
| 36 |
|
|
While the HTML form of HTML5 bears a close resemblance to SGML and XML,
|
| 37 |
|
|
it is a separate language with its own parsing rules.
|
| 38 |
|
|
#ja
|
| 39 |
|
|
HTML5 の HTML 形式は SGML や XML によく似ていますが、
|
| 40 |
|
|
独自の構文解析規則を持つ別の言語です。
|
| 41 |
|
|
|
| 42 |
|
|
#en
|
| 43 |
|
|
Some earlier versions of HTML (in particular from HTML2 to HTML4) were
|
| 44 |
|
|
based on SGML and used SGML parsing rules. However, few (if any) web
|
| 45 |
|
|
browsers ever implemented true SGML parsing for HTML documents; the only
|
| 46 |
|
|
user agents to strictly handle HTML as an SGML application have
|
| 47 |
|
|
historically been validators. The resulting confusion — with
|
| 48 |
|
|
validators claiming documents to have one representation while widely
|
| 49 |
|
|
deployed Web browsers interoperably implemented a different
|
| 50 |
|
|
representation — has wasted decades of productivity. This version
|
| 51 |
|
|
of HTML thus returns to a non-SGML basis.
|
| 52 |
|
|
#ja
|
| 53 |
|
|
以前のいくつかの版の HTML (特に HTML2 から HTML4 まで) は SGML
|
| 54 |
|
|
に基づき、 SGML の構文解析規則を用いていました。しかし、 HTML
|
| 55 |
|
|
文書用に真の SGML 構文解析を実装していたウェブ・ブラウザは (あったとしても)
|
| 56 |
|
|
皆無に近い数でした。 HTML を厳密に SGML 応用として扱う唯一の利用者エージェントは歴史的に妥当性検証器だけでした。
|
| 57 |
|
|
その結果、妥当性検査器は文書がある形式であることを要求し、
|
| 58 |
|
|
一方で広く実用されている Web ブラウザはそれとは異なる形式を相互運用可能な形で実装するという混乱が生じ、
|
| 59 |
|
|
生産性を大きく低下させています。
|
| 60 |
|
|
ですので、この版の HTML は非 SGML ベースに回帰します。
|
| 61 |
|
|
|
| 62 |
|
|
#en
|
| 63 |
|
|
Authors interested in using SGML tools in their authoring pipeline are
|
| 64 |
|
|
encouraged to use XML tools and the XML serialization of HTML5.
|
| 65 |
|
|
#ja
|
| 66 |
|
|
文書準備の過程で SGML ツールを使いたいと考える著者には、
|
| 67 |
|
|
XML ツールと HTML5 の XML 直列化を用いることをお勧めします。
|
| 68 |
|
|
|
| 69 |
|
|
#en
|
| 70 |
|
|
This specification defines the parsing rules for HTML documents, whether
|
| 71 |
|
|
they are syntactically correct or not. Certain points in the parsing
|
| 72 |
wakaba |
1.59 |
algorithm are said to be <dfn id=parse-a-date-string title="parse error">parse
|
| 73 |
apache |
1.4 |
errors</dfn>. The error handling for parse errors is well-defined: user
|
| 74 |
|
|
agents must either act as described below when encountering such problems,
|
| 75 |
|
|
or must abort processing at the first error that they encounter for which
|
| 76 |
|
|
they do not wish to apply the rules described below.
|
| 77 |
|
|
#ja
|
| 78 |
|
|
この仕様書は、構文的に正しいか否かに関わらず HTML
|
| 79 |
wakaba |
1.59 |
文書を構文解析する規則を定義します。構文解析算法中のいくつかの箇所は<dfn id=parse-a-date-string title="parse error">構文解析誤り</dfn>であるとしています。
|
| 80 |
apache |
1.4 |
構文解析誤りの処理は明確に定義します。利用者エージェントは、
|
| 81 |
|
|
そのような問題に遭遇したときに後述のように動作するか、または後述の規則を適用することを望まないような誤りにはじめて遭遇した箇所で処理を停止しなければ[[MUST:なりません]]。
|
| 82 |
|
|
|
| 83 |
|
|
#en
|
| 84 |
|
|
Conformance checkers must report at least one parse error condition to
|
| 85 |
|
|
the user if one or more parse error conditions exist in the document and
|
| 86 |
|
|
must not report parse error conditions if none exist in the document.
|
| 87 |
|
|
Conformance checkers may report more than one parse error condition if
|
| 88 |
|
|
more than one parse error conditions exist in the document. Conformance
|
| 89 |
|
|
checkers are not required to recover from parse errors.
|
| 90 |
|
|
#ja
|
| 91 |
|
|
適合性検査器は、文書中に1つ以上の構文解析誤り条件が存在する場合、利用者に最低1つの構文解析誤り条件を報告しなければ[[MUST:ならず]]、
|
| 92 |
|
|
文書に誤りが存在しない場合、構文解析誤り条件を報告しては[[MUST NOT:なりません]]。
|
| 93 |
|
|
適合性検査器は、文書中に複数の構文解析誤り条件が存在する場合、
|
| 94 |
|
|
複数の構文解析誤り条件を報告して[[MAY:構いません]]。
|
| 95 |
|
|
適合性検査器は構文解析誤りから回復することを[[REQUIRED:要求]]されません。
|
| 96 |
|
|
|
| 97 |
|
|
#en
|
| 98 |
|
|
Parse errors are only errors with the <em>syntax</em> of
|
| 99 |
|
|
HTML. In addition to checking for parse errors, conformance checkers will
|
| 100 |
|
|
also verify that the document obeys all the other conformance requirements
|
| 101 |
|
|
described in this specification.
|
| 102 |
|
|
#ja
|
| 103 |
|
|
構文解析誤りは、 HTML の<em>構文</em>の誤りに過ぎません。
|
| 104 |
|
|
適合性検査器は、構文解析誤りの検査に加え、
|
| 105 |
|
|
文書がこの仕様書で説明されている他の適合性要件に従っているかも検査することになります。
|
| 106 |
apache |
1.7 |
|
| 107 |
|
|
|
| 108 |
|
|
#pattern
|
| 109 |
|
|
<span class=secno>* </span>The scripting state
|
| 110 |
|
|
#ja
|
| 111 |
|
|
<span class=secno>$1 </span>スクリプティング状態
|
| 112 |
|
|
|
| 113 |
|
|
#en
|
| 114 |
wakaba |
1.59 |
The <dfn id=scripting-is-disabled>scripting flag</dfn> is set to "enabled" if the
|
| 115 |
apache |
1.7 |
<code>Document</code> with which the parser is associated was <a
|
| 116 |
wakaba |
1.59 |
href=#with-script>with script</a> when the parser was created, and
|
| 117 |
apache |
1.7 |
"disabled" otherwise.
|
| 118 |
|
|
#ja
|
| 119 |
wakaba |
1.59 |
<dfn id=scripting-is-disabled>スクリプティング旗</dfn>は、構文解析器が関連付けられている
|
| 120 |
apache |
1.7 |
<code>Document</code> が構文解析器の作成の時点で<a
|
| 121 |
wakaba |
1.59 |
href=#with-script>スクリプト付き</a>である場合には「有効」、
|
| 122 |
apache |
1.7 |
それ以外の場合には「無効」です。
|
| 123 |
|
|
|
| 124 |
|
|
#pattern
|
| 125 |
|
|
<span class=secno>* </span><dfn
|
| 126 |
wakaba |
1.59 |
>Tokenization</dfn>
|
| 127 |
apache |
1.7 |
#ja
|
| 128 |
|
|
<span class=secno>$1 </span><dfn
|
| 129 |
wakaba |
1.59 |
>字句化</dfn>
|
| 130 |
apache |
1.7 |
|
| 131 |
|
|
#en
|
| 132 |
|
|
Implementations must act as if they used the following state machine to
|
| 133 |
|
|
tokenise HTML. The state machine must start in the <a
|
| 134 |
wakaba |
1.59 |
href=#data-state>data state</a>. Most states consume a single character,
|
| 135 |
apache |
1.7 |
which may have various side-effects, and either switches the state machine
|
| 136 |
|
|
to a new state to <em>reconsume</em> the same character, or switches it to
|
| 137 |
|
|
a new state (to consume the next character), or repeats the same state (to
|
| 138 |
|
|
consume the next character). Some states have more complicated behavior
|
| 139 |
|
|
and can consume several characters before switching to another state.
|
| 140 |
|
|
#ja
|
| 141 |
|
|
実装は、次の状態機械を HTML の字句化に用いているかのように作用しなければ[[MUST:なりません]]。
|
| 142 |
apache |
1.8 |
状態機械は、<a
|
| 143 |
wakaba |
1.59 |
href=#data-state>データ状態</a>で開始しなければ[[MUST:なりません]]。
|
| 144 |
apache |
1.7 |
ほとんどの状態は1文字消費しますが、
|
| 145 |
|
|
この時様々な副作用を持っても[[MAY:構わない]]他、
|
| 146 |
|
|
状態機械が新しい状態に切り替えられて同じ文字を<em>再消費</em>するか、
|
| 147 |
|
|
(次の文字を消費するために) 新しい状態に切り替えられるか、
|
| 148 |
|
|
(次の文字を消費するために) 同じ状態を繰り返すかのいずれかとなります。
|
| 149 |
|
|
より複雑な動作を持っていて、他の状態に切り替える前に複数の文字を消費することがある状態もあります。
|
| 150 |
|
|
|
| 151 |
|
|
#en
|
| 152 |
|
|
The exact behavior of certain states depends on a <dfn
|
| 153 |
wakaba |
1.59 |
id=attr-meta-http-equiv-content-language>content model flag</dfn> that is set after certain tokens are
|
| 154 |
apache |
1.7 |
emitted. The flag has several states: <em title="">PCDATA</em>, <em
|
| 155 |
|
|
title="">RCDATA</em>, <em title="">CDATA</em>, and <em
|
| 156 |
|
|
title="">PLAINTEXT</em>. Initially it must be in the PCDATA state. In the
|
| 157 |
wakaba |
1.59 |
RCDATA and CDATA states, a further <dfn id=escape-flag>escape flag</dfn> is
|
| 158 |
apache |
1.7 |
used to control the behavior of the tokeniser. It is either true or false,
|
| 159 |
|
|
and initially must be set to the false state. The <span>insertion
|
| 160 |
wakaba |
1.59 |
mode</span> and the <a href=#stack-of-open-elements>stack of open elements</a> also
|
| 161 |
apache |
1.7 |
affects tokenization.
|
| 162 |
|
|
#ja
|
| 163 |
|
|
特定の状態の正確な動作は、特定の字句が放出された後に設定される<dfn
|
| 164 |
wakaba |
1.59 |
id=attr-meta-http-equiv-content-language>内容モデル旗</dfn>に依存します。
|
| 165 |
apache |
1.7 |
この旗は状態 <em title="">PCDATA</em>, <em
|
| 166 |
|
|
title="">RCDATA</em>, <em title="">CDATA</em>, <em
|
| 167 |
|
|
title="">PLAINTEXT</em> を持ちます。はじめは PCDATA
|
| 168 |
|
|
状態でなければ[[MUST:なりません]]。 RCDATA 状態と CDATA 状態では、
|
| 169 |
wakaba |
1.59 |
更に<dfn id=escape-flag>逃避旗</dfn>が字句化器の動作を制御するために用いられます。
|
| 170 |
apache |
1.7 |
これは真か偽かのいずれかであり、はじめは偽の状態に設定されなければ[[MUST:なりません]]。
|
| 171 |
wakaba |
1.59 |
挿入モードと<a href=#stack-of-open-elements>開いているようそのスタック</a>も字句化器に影響します。
|
| 172 |
apache |
1.7 |
|
| 173 |
|
|
#en
|
| 174 |
|
|
The output of the tokenization step is a series of zero or more of the
|
| 175 |
|
|
following tokens: DOCTYPE, start tag, end tag, comment, character,
|
| 176 |
|
|
end-of-file. DOCTYPE tokens have a name, a public identifier, a system
|
| 177 |
|
|
identifier, and a <i>force-quirks flag</i>. When a DOCTYPE token is
|
| 178 |
|
|
created, its name, public identifier, and system identifier must be marked
|
| 179 |
|
|
as missing (which is a distinct state from the empty string), and the
|
| 180 |
|
|
<i>force-quirks flag</i> must be set to <i>off</i> (its other state is
|
| 181 |
|
|
<i>on</i>). Start and end tag tokens have a tag name, a <i>self-closing
|
| 182 |
|
|
flag</i>, and a list of attributes, each of which has a name and a value.
|
| 183 |
|
|
When a start or end tag token is created, its <i>self-closing flag</i>
|
| 184 |
|
|
|
| 185 |
|
|
must be unset (its other state is that it be set), and its attributes list
|
| 186 |
|
|
must be empty. Comment and character tokens have data.
|
| 187 |
|
|
#ja
|
| 188 |
|
|
字句化期の出力は、 DOCTYPE、開始タグ、終了タグ、注釈、文字、ファイル末のいずれかの字句の零個以上の系列です。
|
| 189 |
|
|
DOCTYPE 字句は名前、公開識別子、システム識別子、<i>奇癖強制旗</i>を持ちます。
|
| 190 |
|
|
When a DOCTYPE token is
|
| 191 |
|
|
created, its name, public identifier, and system identifier must be marked
|
| 192 |
|
|
as missing (which is a distinct state from the empty string), and the
|
| 193 |
|
|
<i>force-quirks flag</i> must be set to <i>off</i> (its other state is
|
| 194 |
|
|
<i>on</i>). Start and end tag tokens have a tag name, a <i>self-closing
|
| 195 |
|
|
flag</i>, and a list of attributes, each of which has a name and a value.
|
| 196 |
|
|
When a start or end tag token is created, its <i>self-closing flag</i>
|
| 197 |
|
|
|
| 198 |
|
|
must be unset (its other state is that it be set), and its attributes list
|
| 199 |
|
|
must be empty. Comment and character tokens have data.
|
| 200 |
|
|
|
| 201 |
|
|
|
| 202 |
apache |
1.4 |
|
| 203 |
|
|
|
| 204 |
|
|
|
| 205 |
apache |
1.5 |
#pattern
|
| 206 |
|
|
<span class=secno>* </span>Parse state
|
| 207 |
|
|
#ja
|
| 208 |
|
|
<span class=secno>$1 </span>構文解析状態
|
| 209 |
|
|
|
| 210 |
|
|
#pattern
|
| 211 |
|
|
<span class=secno>* </span>The insertion mode
|
| 212 |
|
|
#ja
|
| 213 |
|
|
<span class=secno>$1 </span>挿入モード
|
| 214 |
|
|
|
| 215 |
|
|
#en
|
| 216 |
wakaba |
1.59 |
Initially the <span>insertion mode</span> is "<a href=#the-initial-insertion-mode
|
| 217 |
apache |
1.5 |
title="insertion mode: initial">initial</a>". It can change to "<a
|
| 218 |
wakaba |
1.59 |
href=#before-attribute-name-state title="insertion mode: before html">before html</a>", "<a
|
| 219 |
|
|
href=#before-attribute-value-state title="insertion mode: before head">before head</a>", "<a
|
| 220 |
|
|
href=#parsing-main-inhead title="insertion mode: in head">in head</a>", "<a
|
| 221 |
|
|
href=#parsing-main-inheadnoscript title="insertion mode: in head noscript">in head
|
| 222 |
|
|
noscript</a>", "<a href=#after-attribute-name-state title="insertion mode: after head">after
|
| 223 |
|
|
head</a>", "<a href=#parsing-main-inbody title="insertion mode: in body">in
|
| 224 |
|
|
body</a>", "<a href=#parsing-main-intable title="insertion mode: in table">in
|
| 225 |
|
|
table</a>", "<a href=#parsing-main-incaption title="insertion mode: in caption">in
|
| 226 |
|
|
caption</a>", "<a href=#parsing-main-incolgroup title="insertion mode: in column
|
| 227 |
|
|
group">in column group</a>", "<a href=#parsing-main-intbody title="insertion mode:
|
| 228 |
|
|
in table body">in table body</a>", "<a href=#parsing-main-intr title="insertion
|
| 229 |
|
|
mode: in row">in row</a>", "<a href=#parsing-main-intd title="insertion mode: in
|
| 230 |
|
|
cell">in cell</a>", "<a href=#parsing-main-inselect title="insertion mode: in
|
| 231 |
|
|
select">in select</a>", "<a href=#parsing-main-inselectintable title="insertion mode: in
|
| 232 |
|
|
select in table">in select in table</a>", "<a href=#parsing-main-inforeign
|
| 233 |
apache |
1.5 |
title="insertion mode: in foreign content">in foreign content</a>", "<a
|
| 234 |
wakaba |
1.59 |
href=#after-attribute-value-(quoted)-state title="insertion mode: after body">after body</a>", "<a
|
| 235 |
|
|
href=#parsing-main-inframeset title="insertion mode: in frameset">in frameset</a>",
|
| 236 |
|
|
"<a href=#after-doctype-name-state title="insertion mode: after frameset">after
|
| 237 |
|
|
frameset</a>", "<a href=#after-doctype-public-identifier-state title="insertion mode: after after
|
| 238 |
|
|
body">after after body</a>", and "<a href=#after-doctype-system-identifier-state title="insertion mode:
|
| 239 |
apache |
1.5 |
after after frameset">after after frameset</a>" during the course of the
|
| 240 |
wakaba |
1.59 |
parsing, as described in the <a href=#tree-construction>tree
|
| 241 |
apache |
1.5 |
construction</a> stage. The insertion mode affects how tokens are
|
| 242 |
|
|
processed and whether CDATA blocks are supported.
|
| 243 |
|
|
#ja
|
| 244 |
wakaba |
1.59 |
はじめ、<span>挿入モード</span>は "<a href=#the-initial-insertion-mode
|
| 245 |
apache |
1.5 |
title="insertion mode: initial">initial</a>" です。挿入モードは、
|
| 246 |
wakaba |
1.59 |
構文解析の過程で、<a href=#tree-construction>木構築</a>期で説明するように、
|
| 247 |
apache |
1.5 |
"<a
|
| 248 |
wakaba |
1.59 |
href=#before-attribute-name-state title="insertion mode: before html">before html</a>", "<a
|
| 249 |
|
|
href=#before-attribute-value-state title="insertion mode: before head">before head</a>", "<a
|
| 250 |
|
|
href=#parsing-main-inhead title="insertion mode: in head">in head</a>", "<a
|
| 251 |
|
|
href=#parsing-main-inheadnoscript title="insertion mode: in head noscript">in head
|
| 252 |
|
|
noscript</a>", "<a href=#after-attribute-name-state title="insertion mode: after head">after
|
| 253 |
|
|
head</a>", "<a href=#parsing-main-inbody title="insertion mode: in body">in
|
| 254 |
|
|
body</a>", "<a href=#parsing-main-intable title="insertion mode: in table">in
|
| 255 |
|
|
table</a>", "<a href=#parsing-main-incaption title="insertion mode: in caption">in
|
| 256 |
|
|
caption</a>", "<a href=#parsing-main-incolgroup title="insertion mode: in column
|
| 257 |
|
|
group">in column group</a>", "<a href=#parsing-main-intbody title="insertion mode:
|
| 258 |
|
|
in table body">in table body</a>", "<a href=#parsing-main-intr title="insertion
|
| 259 |
|
|
mode: in row">in row</a>", "<a href=#parsing-main-intd title="insertion mode: in
|
| 260 |
|
|
cell">in cell</a>", "<a href=#parsing-main-inselect title="insertion mode: in
|
| 261 |
|
|
select">in select</a>", "<a href=#parsing-main-inselectintable title="insertion mode: in
|
| 262 |
|
|
select in table">in select in table</a>", "<a href=#parsing-main-inforeign
|
| 263 |
apache |
1.5 |
title="insertion mode: in foreign content">in foreign content</a>", "<a
|
| 264 |
wakaba |
1.59 |
href=#after-attribute-value-(quoted)-state title="insertion mode: after body">after body</a>", "<a
|
| 265 |
|
|
href=#parsing-main-inframeset title="insertion mode: in frameset">in frameset</a>",
|
| 266 |
|
|
"<a href=#after-doctype-name-state title="insertion mode: after frameset">after
|
| 267 |
|
|
frameset</a>", "<a href=#after-doctype-public-identifier-state title="insertion mode: after after
|
| 268 |
|
|
body">after after body</a>", "<a href=#after-doctype-system-identifier-state title="insertion mode:
|
| 269 |
apache |
1.5 |
after after frameset">after after frameset</a>"
|
| 270 |
|
|
に変わることができます。挿入モードは、字句がどう処理されるか、 CDATA
|
| 271 |
|
|
ブロックに対応するかどうかに影響します。
|
| 272 |
|
|
|
| 273 |
|
|
#en
|
| 274 |
wakaba |
1.59 |
Seven of these modes, namely "<a href=#parsing-main-inhead title="insertion mode:
|
| 275 |
|
|
in head">in head</a>", "<a href=#parsing-main-inbody title="insertion mode: in
|
| 276 |
|
|
body">in body</a>", "<a href=#parsing-main-intable title="insertion mode: in
|
| 277 |
|
|
table">in table</a>", "<a href=#parsing-main-intbody title="insertion mode: in
|
| 278 |
|
|
table body">in table body</a>", "<a href=#parsing-main-intr title="insertion mode:
|
| 279 |
|
|
in row">in row</a>", "<a href=#parsing-main-intd title="insertion mode: in
|
| 280 |
|
|
cell">in cell</a>", and "<a href=#parsing-main-inselect title="insertion mode: in
|
| 281 |
apache |
1.5 |
select">in select</a>", are special, in that the other modes defer to them
|
| 282 |
|
|
at various times. When the algorithm below says that the user agent is to
|
| 283 |
wakaba |
1.59 |
do something "<dfn>using the rules for</dfn> the <var
|
| 284 |
apache |
1.5 |
title="">m</var> insertion mode", where <var title="">m</var> is one of
|
| 285 |
|
|
these modes, the user agent must use the rules described under that
|
| 286 |
|
|
<span>insertion mode</span>'s section, but must leave the <span>insertion
|
| 287 |
|
|
mode</span> unchanged (unless the rules in that section themselves switch
|
| 288 |
|
|
the <span>insertion mode</span>).
|
| 289 |
|
|
#ja
|
| 290 |
wakaba |
1.59 |
挿入モードのうちの7つ、"<a href=#parsing-main-inhead title="insertion mode:
|
| 291 |
|
|
in head">in head</a>", "<a href=#parsing-main-inbody title="insertion mode: in
|
| 292 |
|
|
body">in body</a>", "<a href=#parsing-main-intable title="insertion mode: in
|
| 293 |
|
|
table">in table</a>", "<a href=#parsing-main-intbody title="insertion mode: in
|
| 294 |
|
|
table body">in table body</a>", "<a href=#parsing-main-intr title="insertion mode:
|
| 295 |
|
|
in row">in row</a>", "<a href=#parsing-main-intd title="insertion mode: in
|
| 296 |
|
|
cell">in cell</a>", "<a href=#parsing-main-inselect title="insertion mode: in
|
| 297 |
apache |
1.5 |
select">in select</a>" は特別で、他のモードが数箇所でこれらのモードに委ねています。
|
| 298 |
|
|
後述の算法が利用者エージェントは何かを「<var
|
| 299 |
wakaba |
1.59 |
title="">m</var> 挿入モードの<dfn>規則を用いて</dfn>」
|
| 300 |
apache |
1.5 |
(<var title="">m</var> はこれらのモードのいずれか。) 行うと言っている時は、
|
| 301 |
|
|
利用者エージェントは、当該挿入モードの節で説明されている規則を用いなければ[[MUST:なりません]]が、
|
| 302 |
|
|
挿入モードは変更しないでおかなければ[[MUST:なりません]] (その節の規則自体が挿入モードを切り替える場合を除きます)。
|
| 303 |
|
|
|
| 304 |
|
|
#en
|
| 305 |
wakaba |
1.59 |
When the insertion mode is switched to "<a href=#parsing-main-inforeign
|
| 306 |
apache |
1.5 |
title="insertion mode: in foreign content">in foreign content</a>", the
|
| 307 |
wakaba |
1.59 |
<dfn id=secondary-insertion-mode>secondary insertion mode</dfn> is also set. This
|
| 308 |
|
|
secondary mode is used within the rules for the "<a href=#parsing-main-inforeign
|
| 309 |
apache |
1.5 |
title="insertion mode: in foreign content">in foreign content</a>" mode to
|
| 310 |
|
|
handle HTML (i.e. not foreign) content.
|
| 311 |
|
|
#ja
|
| 312 |
wakaba |
1.59 |
挿入モードが "<a href=#parsing-main-inforeign
|
| 313 |
apache |
1.5 |
title="insertion mode: in foreign content">in foreign content</a>"
|
| 314 |
wakaba |
1.59 |
に切り替えられる時には、<dfn id=secondary-insertion-mode>二次挿入モード</dfn>も設定されます。
|
| 315 |
|
|
この二次モードは、 "<a href=#parsing-main-inforeign
|
| 316 |
apache |
1.5 |
title="insertion mode: in foreign content">in foreign content</a>"
|
| 317 |
|
|
モードの規則の中で HTML (つまり、異言語でない) 内容を取り扱う際に使用します。
|
| 318 |
|
|
|
| 319 |
|
|
#en
|
| 320 |
wakaba |
1.59 |
When the steps below require the UA to <dfn id=reset-button-state>reset the insertion
|
| 321 |
apache |
1.5 |
mode appropriately</dfn>, it means the UA must follow these steps:
|
| 322 |
|
|
#ja
|
| 323 |
wakaba |
1.59 |
後述の段階が利用者エージェントに<dfn id=reset-button-state>挿入モードを適切に再設定する</dfn>ことを要求する場合、
|
| 324 |
apache |
1.5 |
利用者エージェントは次の段階に従わなければ[[MUST:ならない]]ことを意味しています。
|
| 325 |
|
|
|
| 326 |
|
|
#pattern
|
| 327 |
|
|
Let * be false.
|
| 328 |
|
|
#ja
|
| 329 |
|
|
$1 を偽とします。
|
| 330 |
|
|
|
| 331 |
|
|
#en
|
| 332 |
|
|
Let <var title="">node</var> be the last node in the <a
|
| 333 |
wakaba |
1.59 |
href=#stack-of-open-elements>stack of open elements</a>.
|
| 334 |
apache |
1.5 |
#ja
|
| 335 |
|
|
<var title="">node</var> を<a
|
| 336 |
wakaba |
1.59 |
href=#stack-of-open-elements>開いている要素のスタック</a>の最後の節点とします。
|
| 337 |
apache |
1.5 |
|
| 338 |
|
|
#en
|
| 339 |
|
|
If <var title="">node</var> is the first node in the stack of open
|
| 340 |
|
|
elements, then set <var title="">last</var> to true and set <var
|
| 341 |
|
|
title="">node</var> to the <var title="">context</var> element. (<a
|
| 342 |
wakaba |
1.59 |
href=#fragment-case>fragment case</a>)
|
| 343 |
apache |
1.5 |
#ja
|
| 344 |
|
|
<var title="">node</var> が開いている要素のスタックの最初の節点の場合、
|
| 345 |
|
|
<var title="">last</var> を真に設定し、 <var
|
| 346 |
|
|
title="">node</var> を <var title="">context</var> 要素に設定します。
|
| 347 |
|
|
(<a
|
| 348 |
wakaba |
1.59 |
href=#fragment-case>素片の場合</a>)
|
| 349 |
apache |
1.5 |
|
| 350 |
apache |
1.6 |
#pattern
|
| 351 |
|
|
If <var title="">node</var> is a * element, then
|
| 352 |
|
|
switch the <span>insertion mode</span> to "*" and abort these steps.
|
| 353 |
wakaba |
1.59 |
(<a href=#fragment-case>fragment case</a>)
|
| 354 |
apache |
1.5 |
#ja
|
| 355 |
apache |
1.6 |
<var title="">node</var> が $1 要素の場合、挿入モードを "$2" に切り替え、
|
| 356 |
apache |
1.5 |
これらの段階を停止します。
|
| 357 |
|
|
(<a
|
| 358 |
wakaba |
1.59 |
href=#fragment-case>素片の場合</a>)
|
| 359 |
apache |
1.5 |
|
| 360 |
|
|
#pattern
|
| 361 |
|
|
If <var title="">node</var> is a * element, then
|
| 362 |
|
|
switch the <span>insertion mode</span> to "*" and abort these steps.
|
| 363 |
|
|
#ja
|
| 364 |
|
|
<var title="">node</var> が $1
|
| 365 |
|
|
要素の場合、挿入モードを "$2" に切り替え、
|
| 366 |
|
|
これらの段階を停止します。
|
| 367 |
|
|
|
| 368 |
|
|
#en
|
| 369 |
wakaba |
1.59 |
If <var title="">node</var> is a <code><a href=#the-td-element>td</a></code> or
|
| 370 |
|
|
<code><a href=#the-th-element>th</a></code> element and <var title="">last</var> is
|
| 371 |
|
|
false, then switch the <span>insertion mode</span> to "<a href=#parsing-main-intd title="insertion mode: in cell">in cell</a>" and abort these steps.
|
| 372 |
|
|
#ja
|
| 373 |
|
|
<var title="">node</var> が <code><a href=#the-td-element>td</a></code> 要素か
|
| 374 |
|
|
<code><a href=#the-th-element>th</a></code> 要素の場合で <var title="">last</var>
|
| 375 |
|
|
が偽の場合、挿入モードを "<a href=#parsing-main-intd title="insertion mode: in cell">in cell</a>" に切り替え、これらの段階を停止します。
|
| 376 |
apache |
1.6 |
|
| 377 |
|
|
#en
|
| 378 |
apache |
1.5 |
If <var title="">node</var> is an element from the <a
|
| 379 |
wakaba |
1.59 |
href=#mathml-namespace>MathML
|
| 380 |
apache |
1.5 |
namespace</a><!--XXXSVG or the <span>SVG namespace</span>-->, then switch
|
| 381 |
wakaba |
1.59 |
the <span>insertion mode</span> to "<a href=#parsing-main-inforeign
|
| 382 |
apache |
1.5 |
title="insertion mode: in foreign content">in foreign content</a>", let
|
| 383 |
wakaba |
1.59 |
the <a href=#secondary-insertion-mode>secondary insertion mode</a> be "<a
|
| 384 |
|
|
href=#parsing-main-inbody title="insertion mode: in body">in body</a>", and abort
|
| 385 |
apache |
1.5 |
these steps.
|
| 386 |
|
|
#ja
|
| 387 |
|
|
<var title="">node</var> が <a
|
| 388 |
wakaba |
1.59 |
href=#mathml-namespace>MathML
|
| 389 |
|
|
名前空間</a>の要素の場合、挿入モードを "<a href=#parsing-main-inforeign
|
| 390 |
apache |
1.5 |
title="insertion mode: in foreign content">in foreign content</a>"
|
| 391 |
wakaba |
1.59 |
に切り替え、<a href=#secondary-insertion-mode>二次挿入モード</a>を "<a
|
| 392 |
|
|
href=#parsing-main-inbody title="insertion mode: in body">in body</a>"
|
| 393 |
apache |
1.5 |
とし、これらの段階を停止します。
|
| 394 |
|
|
|
| 395 |
|
|
#en
|
| 396 |
wakaba |
1.59 |
If <var title="">node</var> is a <code><a href=#the-head-element>head</a></code>
|
| 397 |
apache |
1.5 |
element, then switch the <span>insertion mode</span> to "<a
|
| 398 |
wakaba |
1.59 |
href=#parsing-main-inbody title="insertion mode: in body">in body</a>" ("<a
|
| 399 |
|
|
href=#parsing-main-inbody title="insertion mode: in body">in body</a>"! <em> not
|
| 400 |
|
|
"<a href=#parsing-main-inhead title="insertion mode: in head">in head</a>"</em>!)
|
| 401 |
|
|
and abort these steps. (<a href=#fragment-case>fragment case</a>)
|
| 402 |
apache |
1.5 |
#ja
|
| 403 |
wakaba |
1.59 |
<var title="">node</var> が <code><a href=#the-head-element>head</a></code>
|
| 404 |
apache |
1.5 |
要素の場合、挿入モードを "<a
|
| 405 |
wakaba |
1.59 |
href=#parsing-main-inbody title="insertion mode: in body">in body</a>" ("<a
|
| 406 |
|
|
href=#parsing-main-inbody title="insertion mode: in body">in body</a>"! <em>"<a href=#parsing-main-inhead title="insertion mode: in head">in head</a>"
|
| 407 |
apache |
1.5 |
ではなく</em>!) に切り替え、これらの段階を停止します。
|
| 408 |
wakaba |
1.59 |
(<a href=#fragment-case>素片の場合</a>)
|
| 409 |
apache |
1.5 |
|
| 410 |
|
|
#en
|
| 411 |
|
|
If <var title="">node</var> is an <code><a
|
| 412 |
wakaba |
1.59 |
href=#the-html-element>html</a></code> element, then: if the <a
|
| 413 |
|
|
href=#head-element-pointer><code title="">head</code> element pointer</a> is
|
| 414 |
|
|
null, switch the <span>insertion mode</span> to "<a href=#before-attribute-value-state
|
| 415 |
apache |
1.5 |
title="insertion mode: before head">before head</a>", otherwise, switch
|
| 416 |
wakaba |
1.59 |
the <span>insertion mode</span> to "<a href=#after-attribute-name-state title="insertion
|
| 417 |
apache |
1.5 |
mode: after head">after head</a>". In either case, abort these steps. (<a
|
| 418 |
wakaba |
1.59 |
href=#fragment-case>fragment case</a>)
|
| 419 |
apache |
1.5 |
#ja
|
| 420 |
|
|
<var title="">node</var> が <code><a
|
| 421 |
wakaba |
1.59 |
href=#the-html-element>html</a></code> 要素の場合: <a
|
| 422 |
|
|
href=#head-element-pointer><code title="">head</code> 要素指示子</a>が null
|
| 423 |
|
|
である場合には、挿入モードを "<a href=#before-attribute-value-state
|
| 424 |
apache |
1.5 |
title="insertion mode: before head">before head</a>"
|
| 425 |
wakaba |
1.59 |
に切り替えます。そうでない場合には、挿入モードを "<a href=#after-attribute-name-state title="insertion
|
| 426 |
apache |
1.5 |
mode: after head">after head</a>" に切り替えます。いずれの場合にも、
|
| 427 |
wakaba |
1.59 |
これらの段階を停止します。 (<a href=#fragment-case>素片の場合</a>)
|
| 428 |
apache |
1.5 |
|
| 429 |
|
|
#en
|
| 430 |
|
|
If <var title="">last</var> is true, then switch the <span>insertion
|
| 431 |
wakaba |
1.59 |
mode</span> to "<a href=#parsing-main-inbody title="insertion mode: in body">in
|
| 432 |
|
|
body</a>" and abort these steps. (<a href=#fragment-case>fragment case</a>)
|
| 433 |
apache |
1.5 |
#ja
|
| 434 |
|
|
<var title="">last</var> が真であれば、挿入モードを
|
| 435 |
wakaba |
1.59 |
"<a href=#parsing-main-inbody title="insertion mode: in body">in
|
| 436 |
apache |
1.5 |
body</a>" に切り替え、これらの段階を停止します。
|
| 437 |
wakaba |
1.59 |
(<a href=#fragment-case>素片の場合</a>)
|
| 438 |
apache |
1.5 |
|
| 439 |
|
|
#en
|
| 440 |
|
|
Let <var title="">node</var> now be the node before <var
|
| 441 |
wakaba |
1.59 |
title="">node</var> in the <a href=#stack-of-open-elements>stack of open elements</a>.
|
| 442 |
apache |
1.6 |
#ja
|
| 443 |
wakaba |
1.59 |
新たな <var title="">node</var> を<a href=#stack-of-open-elements>開いている要素のスタック</a>で <var
|
| 444 |
apache |
1.5 |
title="">node</var> の前にある節点とします。
|
| 445 |
|
|
|
| 446 |
|
|
|
| 447 |
|
|
|
| 448 |
|
|
|
| 449 |
|
|
|
| 450 |
apache |
1.4 |
|
| 451 |
|
|
#pattern
|
| 452 |
|
|
A sequence of bytes starting with: *
|
| 453 |
|
|
#ja
|
| 454 |
|
|
$1 で始まるバイト列
|
| 455 |
|
|
|
| 456 |
|
|
#en
|
| 457 |
|
|
Any other byte
|
| 458 |
|
|
#ja
|
| 459 |
|
|
その他のバイト
|
| 460 |
|
|
|
| 461 |
|
|
#en
|
| 462 |
wakaba |
1.59 |
Consume the <a href=#next-input-character>next input character</a>:
|
| 463 |
apache |
1.4 |
#ja
|
| 464 |
wakaba |
1.59 |
<a href=#next-input-character>次入力文字</a>を消費:
|
| 465 |
apache |
1.4 |
|
| 466 |
|
|
#en
|
| 467 |
|
|
A comment token
|
| 468 |
|
|
#ja
|
| 469 |
|
|
注釈字句
|
| 470 |
|
|
|
| 471 |
|
|
#en
|
| 472 |
|
|
A DOCTYPE token
|
| 473 |
|
|
#ja
|
| 474 |
|
|
DOCTYPE 字句
|
| 475 |
|
|
|
| 476 |
|
|
#pattern
|
| 477 |
|
|
A start tag whose tag name is "*"
|
| 478 |
|
|
#ja
|
| 479 |
|
|
タグ名が "$1" の開始タグ
|
| 480 |
|
|
|
| 481 |
|
|
#pattern
|
| 482 |
|
|
A start tag whose tag name is one of: *
|
| 483 |
|
|
#ja
|
| 484 |
|
|
タグ名が $1 のいずれかの開始タグ
|
| 485 |
|
|
|
| 486 |
|
|
#pattern
|
| 487 |
|
|
An end tag whose tag name is "*"
|
| 488 |
|
|
#ja
|
| 489 |
|
|
タグ名が "$1" の終了タグ
|
| 490 |
|
|
|
| 491 |
|
|
#pattern
|
| 492 |
|
|
An end tag whose tag name is one of: *
|
| 493 |
|
|
#ja
|
| 494 |
|
|
タグ名が $1 のいずれかの終了タグ
|
| 495 |
|
|
|
| 496 |
|
|
#en
|
| 497 |
|
|
Any other start tag
|
| 498 |
|
|
#ja
|
| 499 |
|
|
その他の開始タグ
|
| 500 |
|
|
|
| 501 |
|
|
#en
|
| 502 |
|
|
Any other end tag
|
| 503 |
|
|
#ja
|
| 504 |
|
|
その他の終了タグ
|
| 505 |
|
|
|
| 506 |
|
|
#en
|
| 507 |
|
|
Anything else
|
| 508 |
|
|
#ja
|
| 509 |
|
|
その他のもの
|
| 510 |
|
|
|
| 511 |
|
|
#en
|
| 512 |
|
|
Run the following algorithm:
|
| 513 |
|
|
#ja
|
| 514 |
|
|
次の算法を実行します:
|
| 515 |
|
|
|
| 516 |
|
|
#en
|
| 517 |
|
|
Otherwise:
|
| 518 |
|
|
#ja
|
| 519 |
|
|
それ以外の場合:
|
| 520 |
|
|
|
| 521 |
|
|
#pattern
|
| 522 |
|
|
Return to step *.
|
| 523 |
|
|
#ja
|
| 524 |
|
|
手順 $1 に戻ります。
|
| 525 |
|
|
|
| 526 |
|
|
#pattern
|
| 527 |
|
|
Act as if a start tag token with the tag name "*" had been seen,
|
| 528 |
|
|
then reprocess the current token.
|
| 529 |
|
|
#ja
|
| 530 |
|
|
タグ名が "$1" の開始タグ字句を見たかのように動作してから、
|
| 531 |
|
|
現在字句を再処理します。
|
| 532 |
|
|
|
| 533 |
|
|
#en
|
| 534 |
wakaba |
1.59 |
<a href=#parse-a-local-date-and-time-string>Parse error</a>.
|
| 535 |
apache |
1.4 |
#ja
|
| 536 |
wakaba |
1.59 |
<a href=#parse-a-local-date-and-time-string>構文解析誤り</a>。
|
| 537 |
apache |
1.4 |
|
| 538 |
|
|
#en
|
| 539 |
wakaba |
1.59 |
<a href=#parse-a-local-date-and-time-string>Parse error</a>. Ignore the token.
|
| 540 |
apache |
1.4 |
#ja
|
| 541 |
wakaba |
1.59 |
<a href=#parse-a-local-date-and-time-string>構文解析誤り</a>。字句を無視します。
|
| 542 |
apache |
1.9 |
|
| 543 |
|
|
#en
|
| 544 |
|
|
Take a deep breath, then act as described in the "any other end tag"
|
| 545 |
|
|
entry below.
|
| 546 |
|
|
#ja
|
| 547 |
|
|
深呼吸をして、後述の「その他の終了タグ」の項で説明されているように作用します。
|
| 548 |
|
|
|
| 549 |
|
|
#en
|
| 550 |
wakaba |
1.59 |
If the <a href=#list-of5>list of active formatting elements</a>
|
| 551 |
apache |
1.9 |
contains an element whose tag name is "a" between the end of the list
|
| 552 |
|
|
and the last marker on the list (or the start of the list if there is no
|
| 553 |
wakaba |
1.59 |
marker on the list), then this is a <a href=#parse-a-date-string>parse error</a>;
|
| 554 |
apache |
1.9 |
act as if an end tag with the tag name "a" had been seen, then remove
|
| 555 |
wakaba |
1.59 |
that element from the <a href=#list-of5>list of active formatting
|
| 556 |
|
|
elements</a> and the <a href=#stack-of-open-elements>stack of open elements</a> if the
|
| 557 |
apache |
1.9 |
end tag didn't already remove it (it might not have if the element is
|
| 558 |
wakaba |
1.59 |
not <a href=#has-an-element-in-table-scope title="has an element in table scope">in table
|
| 559 |
apache |
1.9 |
scope</a>).
|
| 560 |
|
|
#ja
|
| 561 |
wakaba |
1.59 |
<a href=#list-of5>活性書式付け要素のリスト</a>がタグ名 "a"
|
| 562 |
apache |
1.9 |
の要素をリストの終わりとリスト中のリスト・マーカー (またはリスト中にマーカーがない場合はリストのはじめ)
|
| 563 |
|
|
の間に含まれている場合には、
|
| 564 |
wakaba |
1.59 |
これは<a href=#parse-a-date-string>構文解析誤り</a>です。
|
| 565 |
apache |
1.9 |
タグ名 "a" の終了タグを見たかのように作用した後に、
|
| 566 |
wakaba |
1.59 |
その要素を<a href=#list-of5>活性書式付け要素のリスト</a>と<a href=#stack-of-open-elements>開いている要素のスタック</a>
|
| 567 |
|
|
(終了タグにより除去されていない場合。要素が<a href=#has-an-element-in-table-scope title="has an element in table scope">表範囲中</a>にない場合には除去されていないかもしれません。) から除去します。
|
| 568 |
apache |
1.9 |
|
| 569 |
|
|
#en
|
| 570 |
|
|
In the non-conforming stream
|
| 571 |
wakaba |
1.59 |
<code><a href=a>a<table><a href=b>b</table>x</code>,
|
| 572 |
|
|
the first <code><a href=#the-a-element>a</a></code> element would be closed upon
|
| 573 |
apache |
1.9 |
seeing the second one, and the "x" character would be inside a link to
|
| 574 |
|
|
"b", not to "a". This is despite the fact that the outer <code><a
|
| 575 |
wakaba |
1.59 |
href=#the-a-element>a</a></code> element is not in table scope (meaning that a
|
| 576 |
apache |
1.9 |
regular <code></a></code> end tag at the start of the table wouldn't
|
| 577 |
wakaba |
1.59 |
close the outer <code><a href=#the-a-element>a</a></code> element).
|
| 578 |
apache |
1.9 |
#ja
|
| 579 |
apache |
1.10 |
不適合ストリーム
|
| 580 |
wakaba |
1.59 |
<code><a href=a>a<table><a href=b>b</table>x</code>
|
| 581 |
|
|
において、最初の <code><a href=#the-a-element>a</a></code> 要素は2つ目のを見たときに閉じられ、
|
| 582 |
apache |
1.9 |
「x」文字は「a」へのリンクではなく、「b」へのリンクの内側に入ります。
|
| 583 |
|
|
これは、外側の <code><a
|
| 584 |
wakaba |
1.59 |
href=#the-a-element>a</a></code> 要素が表範囲中にないためです
|
| 585 |
apache |
1.9 |
(つまり、表の最初に普通の <code></a></code> 終了タグがあったとしても、
|
| 586 |
wakaba |
1.59 |
外側の <code><a href=#the-a-element>a</a></code> 要素を閉じないということになります)。
|
| 587 |
apache |
1.9 |
|
| 588 |
|
|
#en
|
| 589 |
wakaba |
1.59 |
<a href=#reconstruct-the-active-formatting-elements>Reconstruct the active formatting elements</a>,
|
| 590 |
apache |
1.9 |
if any.
|
| 591 |
|
|
#ja
|
| 592 |
wakaba |
1.59 |
<a href=#reconstruct-the-active-formatting-elements>活性書式付け要素を再構築</a>できれば、します。
|
| 593 |
apache |
1.9 |
|
| 594 |
|
|
#en
|
| 595 |
wakaba |
1.59 |
<a href=#insert-an-html-element>Insert an HTML element</a> for the token. Add that
|
| 596 |
|
|
element to the <a href=#list-of5>list of active formatting
|
| 597 |
apache |
1.9 |
elements</a>.
|
| 598 |
|
|
#ja
|
| 599 |
wakaba |
1.59 |
当該字句について <a href=#insert-an-html-element>HTML 要素を挿入</a>します。
|
| 600 |
|
|
その要素を<a href=#list-of5>活性書式付け要素のリスト</a>に追加します。
|
| 601 |
apache |
1.9 |
|
| 602 |
apache |
1.36 |
|
| 603 |
|
|
|
| 604 |
|
|
#en
|
| 605 |
apache |
1.31 |
The behavior further depends on the character after the U+0023 NUMBER
|
| 606 |
apache |
1.36 |
SIGN:
|
| 607 |
|
|
#ja
|
| 608 |
apache |
1.31 |
動作は更に U+0023 NUMBER
|
| 609 |
|
|
SIGN の次の文字によって決まります。
|
| 610 |
apache |
1.36 |
|
| 611 |
|
|
|
| 612 |
|
|
#en
|
| 613 |
|
|
Consume the U+0023 NUMBER SIGN.
|
| 614 |
|
|
#ja
|
| 615 |
|
|
U+0023 NUMBER SIGN を消費します。
|
| 616 |
|
|
|
| 617 |
|
|
#en
|
| 618 |
|
|
Consume the X.
|
| 619 |
|
|
#ja
|
| 620 |
|
|
X を消費します。
|
| 621 |
|
|
|
| 622 |
|
|
#en
|
| 623 |
apache |
1.34 |
Follow the steps below, but using the range of characters U+0030
|
| 624 |
|
|
DIGIT ZERO through to U+0039 DIGIT NINE, U+0061 LATIN SMALL LETTER A
|
| 625 |
|
|
through to U+0066 LATIN SMALL LETTER F, and U+0041 LATIN CAPITAL
|
| 626 |
|
|
LETTER A, through to U+0046 LATIN CAPITAL LETTER F (in other words,
|
| 627 |
apache |
1.36 |
0-9, A-F, a-f).
|
| 628 |
|
|
#ja
|
| 629 |
apache |
1.35 |
次の段階に従いますが、文字の範囲 U+0030
|
| 630 |
|
|
DIGIT ZERO ~ U+0039 DIGIT NINE、U+0061 LATIN SMALL LETTER A
|
| 631 |
|
|
~ U+0066 LATIN SMALL LETTER F、 U+0041 LATIN CAPITAL
|
| 632 |
|
|
LETTER A ~ U+0046 LATIN CAPITAL LETTER F (つまり
|
| 633 |
|
|
0-9、A-F、a-f) を使います。
|
| 634 |
apache |
1.58 |
|
| 635 |
|
|
|
| 636 |
|
|
#en
|
| 637 |
apache |
1.37 |
When it comes to interpreting the number, interpret it as a
|
| 638 |
apache |
1.58 |
hexadecimal number.
|
| 639 |
|
|
#ja
|
| 640 |
|
|
数を解釈する折には、十六進数として解釈します。
|
| 641 |
|
|
|
| 642 |
|
|
#en
|
| 643 |
apache |
1.38 |
Follow the steps below, but using the range of characters U+0030
|
| 644 |
apache |
1.58 |
DIGIT ZERO through to U+0039 DIGIT NINE (i.e. just 0-9).
|
| 645 |
|
|
#ja
|
| 646 |
apache |
1.38 |
次の段階に従いますが、文字の範囲 U+0030
|
| 647 |
apache |
1.58 |
DIGIT ZERO ~ U+0039 DIGIT NINE (つまり 0-9 だけ) を使います。
|
| 648 |
|
|
|
| 649 |
|
|
#en
|
| 650 |
apache |
1.39 |
When it comes to interpreting the number, interpret it as a decimal
|
| 651 |
apache |
1.58 |
number.
|
| 652 |
|
|
#ja
|
| 653 |
|
|
数を解釈する折には、十進数として解釈します。
|
| 654 |
|
|
|
| 655 |
|
|
#en
|
| 656 |
apache |
1.40 |
Consume as many characters as match the range of characters given
|
| 657 |
apache |
1.58 |
above.
|
| 658 |
|
|
#ja
|
| 659 |
|
|
前述の文字の範囲に一致する文字を、一致するだけすべて消費します。
|
| 660 |
|
|
|
| 661 |
|
|
#en
|
| 662 |
apache |
1.41 |
If no characters match the range, then don't consume any characters
|
| 663 |
|
|
(and unconsume the U+0023 NUMBER SIGN character and, if appropriate, the
|
| 664 |
wakaba |
1.59 |
X character). This is a <a href=#parse-a-date-string>parse error</a>; nothing is
|
| 665 |
apache |
1.58 |
returned.
|
| 666 |
|
|
#ja
|
| 667 |
apache |
1.41 |
範囲に一致する文字がない場合は、文字を消費しません
|
| 668 |
|
|
(更に、 U+0023 NUMBER SIGN 文字と、必要であれば X 文字をも消費しなかったこととします)。
|
| 669 |
wakaba |
1.59 |
これは<a href=#parse-a-date-string>構文解析誤り</a>です。何も返しません。
|
| 670 |
apache |
1.58 |
|
| 671 |
|
|
#en
|
| 672 |
apache |
1.42 |
Otherwise, if the next character is a U+003B SEMICOLON, consume that
|
| 673 |
wakaba |
1.59 |
too. If it isn't, there is a <a href=#parse-a-date-string>parse error</a>.
|
| 674 |
apache |
1.58 |
#ja
|
| 675 |
apache |
1.42 |
そうでない場合、次の文字が U+003B SEMICOLON
|
| 676 |
wakaba |
1.59 |
であれば、これも消費します。そうでない場合は、<a href=#parse-a-date-string>構文解析誤り</a>です。
|
| 677 |
apache |
1.58 |
|
| 678 |
|
|
#en
|
| 679 |
apache |
1.43 |
If one or more characters match the range, then take them all and
|
| 680 |
|
|
interpret the string of characters as a number (either hexadecimal or
|
| 681 |
apache |
1.58 |
decimal as appropriate).
|
| 682 |
|
|
#ja
|
| 683 |
apache |
1.43 |
1文字以上が一致した場合は、それらすべてによる文字列を数 (十六進数または十進数の適切な方)
|
| 684 |
apache |
1.58 |
として解釈します。
|
| 685 |
|
|
|
| 686 |
|
|
#en
|
| 687 |
apache |
1.44 |
If that number is one of the numbers in the first column of the
|
| 688 |
wakaba |
1.59 |
following table, then this is a <a href=#parse-a-date-string>parse error</a>. Find
|
| 689 |
apache |
1.44 |
the row with that number in the first column, and return a character
|
| 690 |
apache |
1.58 |
token for the Unicode character given in the second column of that row.
|
| 691 |
|
|
#ja
|
| 692 |
apache |
1.44 |
その数が次の表の最初の列の数のいずれかである場合は、
|
| 693 |
wakaba |
1.59 |
<a href=#parse-a-date-string>構文解析誤り</a>です。
|
| 694 |
apache |
1.44 |
その数が最初の列に現れる行を探し、
|
| 695 |
apache |
1.58 |
その行の2つ目の列に示された Unicode 文字の文字字句を返します。
|
| 696 |
|
|
|
| 697 |
|
|
#en
|
| 698 |
|
|
Number
|
| 699 |
|
|
#ja
|
| 700 |
|
|
数
|
| 701 |
|
|
|
| 702 |
|
|
#en
|
| 703 |
|
|
Unicode character
|
| 704 |
|
|
#ja
|
| 705 |
|
|
Unicode 文字
|
| 706 |
|
|
|
| 707 |
|
|
#en
|
| 708 |
apache |
1.47 |
Otherwise, if the number is in the range 0x0000 to 0x0008, <!--
|
| 709 |
|
|
space characters allowed -->
|
| 710 |
|
|
0x000E to 0x001F, <!-- ASCII allowed
|
| 711 |
|
|
--> 0x007F
|
| 712 |
|
|
<!--to 0x0084, (0x0085 NEL not allowed), 0x0086--> to 0x009F, 0xD800 to
|
| 713 |
|
|
0xDFFF <!-- surrogates not allowed -->, 0xFDD0 to 0xFDDF, or is one of
|
| 714 |
|
|
0xFFFE, 0xFFFF, 0x1FFFE, 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE, 0x3FFFF,
|
| 715 |
|
|
0x4FFFE, 0x4FFFF, 0x5FFFE, 0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE, 0x7FFFF,
|
| 716 |
|
|
0x8FFFE, 0x8FFFF, 0x9FFFE, 0x9FFFF, 0xAFFFE, 0xAFFFF, 0xBFFFE, 0xBFFFF,
|
| 717 |
|
|
0xCFFFE, 0xCFFFF, 0xDFFFE, 0xDFFFF, 0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF,
|
| 718 |
|
|
0x10FFFE, or 0x10FFFF, or is higher than 0x10FFFF, then this is a <a
|
| 719 |
wakaba |
1.59 |
href=#parse-a-date-string>parse error</a>; return a character token for the U+FFFD
|
| 720 |
apache |
1.58 |
REPLACEMENT CHARACTER character instead.
|
| 721 |
|
|
#ja
|
| 722 |
apache |
1.47 |
それ以外の場合、数が範囲 0x0000 ~ 0x0008、<!--
|
| 723 |
|
|
space characters allowed -->
|
| 724 |
|
|
0x000E、 0x001F、<!-- ASCII allowed
|
| 725 |
|
|
--> 0x007F
|
| 726 |
|
|
<!--to 0x0084, (0x0085 NEL not allowed), 0x0086--> ~ 0x009F、
|
| 727 |
|
|
0xD800 ~
|
| 728 |
|
|
0xDFFF <!-- surrogates not allowed -->、0xFDD0 ~ 0xFDDF
|
| 729 |
|
|
のいずれかにあるか、
|
| 730 |
|
|
0xFFFE、0xFFFF、0x1FFFE、0x1FFFF、0x2FFFE、0x2FFFF、0x3FFFE、0x3FFFF、
|
| 731 |
|
|
0x4FFFE、0x4FFFF、0x5FFFE、0x5FFFF、0x6FFFE、0x6FFFF、 0x7FFFE、0x7FFFF、
|
| 732 |
|
|
0x8FFFE、0x8FFFF、0x9FFFE、0x9FFFF、0xAFFFE、0xAFFFF、0xBFFFE、0xBFFFF、
|
| 733 |
|
|
0xCFFFE、0xCFFFF、0xDFFFE、0xDFFFF、0xEFFFE、0xEFFFF、0xFFFFE、0xFFFFF、
|
| 734 |
|
|
0x10FFFE、0x10FFFF のいずれかであるか、
|
| 735 |
|
|
0x10FFFF より大きい場合、<a
|
| 736 |
wakaba |
1.59 |
href=#parse-a-date-string>構文解析誤り</a>です。
|
| 737 |
apache |
1.47 |
代わりに U+FFFD
|
| 738 |
|
|
REPLACEMENT CHARACTER 文字の文字字句を返します。
|
| 739 |
apache |
1.58 |
|
| 740 |
|
|
|
| 741 |
|
|
#en
|
| 742 |
apache |
1.48 |
Otherwise, return a character token for the Unicode character whose
|
| 743 |
apache |
1.58 |
code point is that number.
|
| 744 |
|
|
#ja
|
| 745 |
|
|
それ以外の場合、符号位置がその数である Unicode 文字の文字字句を返します。
|
| 746 |
|
|
|
| 747 |
|
|
#en
|
| 748 |
apache |
1.49 |
Consume the maximum number of characters possible, with the consumed
|
| 749 |
|
|
characters matching one of the identifiers in the first column of the <a
|
| 750 |
wakaba |
1.59 |
href=#named-character-references>named character references</a> table (in a <a
|
| 751 |
|
|
href=#case-sensitive>case-sensitive</a> manner).
|
| 752 |
apache |
1.58 |
#ja
|
| 753 |
apache |
1.49 |
<a
|
| 754 |
wakaba |
1.59 |
href=#named-character-references>名前付き文字参照</a>の表の最初の列にある識別子のいずれかと一致するような、
|
| 755 |
apache |
1.58 |
可能な最大数の文字を消費します。
|
| 756 |
|
|
|
| 757 |
|
|
#en
|
| 758 |
wakaba |
1.59 |
<a href=#insert-an-html-element>Insert an HTML element</a> for the token.
|
| 759 |
apache |
1.58 |
#ja
|
| 760 |
wakaba |
1.59 |
当該字句について <a href=#insert-an-html-element>HTML
|
| 761 |
apache |
1.58 |
要素を挿入</a>します。
|
| 762 |
|
|
|
| 763 |
|
|
#en
|
| 764 |
wakaba |
1.59 |
Set the <a href=#head-element-pointer><code title="">head</code> element
|
| 765 |
|
|
pointer</a> to the newly created <code><a href=#the-head-element>head</a></code>
|
| 766 |
apache |
1.58 |
element.
|
| 767 |
|
|
#ja
|
| 768 |
wakaba |
1.59 |
<a href=#head-element-pointer><code title="">head</code>
|
| 769 |
|
|
要素指示子</a>を新たに作られた <code><a href=#the-head-element>head</a></code>
|
| 770 |
apache |
1.51 |
要素に設定します。
|
| 771 |
apache |
1.58 |
|
| 772 |
|
|
|
| 773 |
|
|
#en
|
| 774 |
wakaba |
1.59 |
Switch the <span>insertion mode</span> to "<a href=#parsing-main-inhead
|
| 775 |
apache |
1.58 |
title="insertion mode: in head">in head</a>".
|
| 776 |
|
|
#ja
|
| 777 |
wakaba |
1.59 |
<span>挿入モード</span>を "<a href=#parsing-main-inhead
|
| 778 |
apache |
1.52 |
title="insertion mode: in head">in head</a>" に切り替えます。
|
| 779 |
apache |
1.58 |
|
| 780 |
|
|
|
| 781 |
|
|
#en
|
| 782 |
apache |
1.53 |
Act as if a start tag token with the tag name "head" and no attributes
|
| 783 |
apache |
1.58 |
had been seen, then reprocess the current token.
|
| 784 |
|
|
#ja
|
| 785 |
apache |
1.53 |
タグ名 "head" で属性のない開始タグ字句を見たかのように作用した後、
|
| 786 |
apache |
1.58 |
現在の字句を再処理します。
|
| 787 |
|
|
|
| 788 |
|
|
#en
|
| 789 |
apache |
1.54 |
This will result in an empty <code><a
|
| 790 |
wakaba |
1.59 |
href=#the-head-element>head</a></code> element being generated, with the current
|
| 791 |
|
|
token being reprocessed in the "<a href=#the-after-head-insertion-mode title="insertion mode:
|
| 792 |
apache |
1.58 |
after head">after head</a>" <span>insertion mode</span>.
|
| 793 |
|
|
#ja
|
| 794 |
apache |
1.54 |
この結果空の <code><a
|
| 795 |
wakaba |
1.59 |
href=#the-head-element>head</a></code> 要素が生成され、
|
| 796 |
|
|
現在の字句は "<a href=#the-after-head-insertion-mode title="insertion mode:
|
| 797 |
apache |
1.58 |
after head">after head</a>" <span>挿入モード</span>で再処理されることとなります。
|
| 798 |
|
|
|
| 799 |
|
|
#pattern
|
| 800 |
apache |
1.55 |
<span class=secno>* </span>The "<dfn
|
| 801 |
apache |
1.58 |
id=* title="insertion mode: *">*</dfn>" insertion mode
|
| 802 |
|
|
#ja
|
| 803 |
apache |
1.55 |
<span class=secno>$1 </span> "<dfn
|
| 804 |
apache |
1.58 |
id=$2 title="insertion mode: $3">$4</dfn>" 挿入モード
|
| 805 |
|
|
|
| 806 |
|
|
#pattern
|
| 807 |
wakaba |
1.59 |
When the <span>insertion mode</span> is "<a href=#*
|
| 808 |
apache |
1.56 |
title="insertion mode: *">*</a>", tokens must be handled as
|
| 809 |
apache |
1.58 |
follows:
|
| 810 |
|
|
#ja
|
| 811 |
wakaba |
1.59 |
<span>挿入モード</span>が "<a href=#$1
|
| 812 |
apache |
1.56 |
title="insertion mode: $2">$3</a>" の時、
|
| 813 |
|
|
字句は次のように取り扱わなければ[[MUST:なりません]]。
|
| 814 |
apache |
1.58 |
|
| 815 |
|
|
|
| 816 |
|
|
#en
|
| 817 |
wakaba |
1.59 |
<a href=#insert-a-character title="insert a character">Insert the character</a>
|
| 818 |
|
|
into the <a href=#current-node>current node</a>.
|
| 819 |
apache |
1.58 |
#ja
|
| 820 |
wakaba |
1.59 |
<a href=#current-node>現在節点</a>に<a href=#insert-a-character title="insert a character">文字を挿入</a>します。 |