| 1 |
apache |
1.4 |
#pattern
|
| 2 |
apache |
1.2 |
<span class=secno>* </span>Semantics and structure of HTML
|
| 3 |
apache |
1.4 |
documents
|
| 4 |
|
|
#ja
|
| 5 |
|
|
<span class=secno>$1 </span>HTML 文書の意味と構造
|
| 6 |
|
|
|
| 7 |
|
|
#pattern
|
| 8 |
|
|
<span class=secno>* </span>Documents
|
| 9 |
|
|
#ja
|
| 10 |
apache |
1.26 |
<span class=secno>$1 </span>文書
|
| 11 |
|
|
|
| 12 |
|
|
#en
|
| 13 |
apache |
1.5 |
Every XML and HTML document in an HTML UA is represented by a
|
| 14 |
apache |
1.26 |
<code>Document</code> object. <a href="#refsDOM3CORE">[DOM3CORE]</a>
|
| 15 |
|
|
#ja
|
| 16 |
apache |
1.5 |
HTML 利用者エージェントにおけるすべての XML や HTML の文書は
|
| 17 |
apache |
1.26 |
<code>Document</code> オブジェクトにより表現されます。 <a href="#refsDOM3CORE">[DOM3CORE]</a>
|
| 18 |
|
|
|
| 19 |
|
|
#pattern
|
| 20 |
|
|
<span class=secno>* </span>Documents in the DOM
|
| 21 |
|
|
#ja
|
| 22 |
|
|
<span class=secno>$1 </span>DOM 中の文書
|
| 23 |
|
|
|
| 24 |
|
|
#en
|
| 25 |
apache |
1.7 |
<code>Document</code> objects are assumed to be <dfn
|
| 26 |
|
|
id=xml-documents>XML documents</dfn> unless they are flagged as being <dfn
|
| 27 |
|
|
id=html->HTML documents</dfn> when they are created. Whether a document is
|
| 28 |
|
|
an <a href="#html-" title="HTML documents">HTML document</a> or an <a
|
| 29 |
|
|
href="#xml-documents" title="XML documents">XML document</a> affects the
|
| 30 |
|
|
behavior of certain APIs, as well as a few CSS rendering rules. <a
|
| 31 |
apache |
1.26 |
href="#refsCSS21">[CSS21]</a>
|
| 32 |
|
|
#ja
|
| 33 |
apache |
1.7 |
<code>Document</code> オブジェクトは、作成された時に
|
| 34 |
|
|
<dfn
|
| 35 |
|
|
id=html->HTML 文書</dfn>であると旗付けされていなければ、 <dfn
|
| 36 |
|
|
id=xml-documents>XML 文書</dfn>であると見なします。
|
| 37 |
|
|
文書が <a href="#html-" title="HTML documents">HTML 文書</a>であるか <a
|
| 38 |
|
|
href="#xml-documents" title="XML documents">XML 文書</a>であるかは、
|
| 39 |
|
|
いくつかの API の動作や CSS のレンダリング規則の一部に影響します。 <a
|
| 40 |
apache |
1.26 |
href="#refsCSS21">[CSS21]</a>
|
| 41 |
|
|
|
| 42 |
|
|
#en
|
| 43 |
apache |
1.8 |
A <code>Document</code> object created by the <code
|
| 44 |
|
|
title="">createDocument()</code> API on the <code>DOMImplementation</code>
|
| 45 |
|
|
object is initially an <a href="#xml-documents" title="XML documents">XML
|
| 46 |
|
|
document</a>, but can be made into an <a href="#html-" title="HTML
|
| 47 |
|
|
documents">HTML document</a> by calling <code title=dom-document-open><a
|
| 48 |
apache |
1.26 |
href="#open">document.open()</a></code> on it.
|
| 49 |
|
|
#ja
|
| 50 |
apache |
1.8 |
<code>DOMImplementation</code> 上の <code
|
| 51 |
|
|
title="">createDocument()</code> API により作成された <code>Document</code>
|
| 52 |
|
|
オブジェクトははじめ <a href="#xml-documents" title="XML documents">XML
|
| 53 |
|
|
文書</a>ですが、 <code title=dom-document-open><a
|
| 54 |
|
|
href="#open">document.open()</a></code>
|
| 55 |
|
|
を呼び出すことにより <a href="#html-" title="HTML
|
| 56 |
apache |
1.26 |
documents">HTML 文書</a>にすることができます。
|
| 57 |
|
|
|
| 58 |
|
|
#en
|
| 59 |
apache |
1.9 |
All <code>Document</code> objects (in user agents implementing this
|
| 60 |
|
|
specification) must also implement the <code><a
|
| 61 |
|
|
href="#htmldocument">HTMLDocument</a></code> interface, available using
|
| 62 |
|
|
binding-specific methods. (This is the case whether or not the document in
|
| 63 |
|
|
question is an <a href="#html-" title="HTML documents">HTML document</a>
|
| 64 |
|
|
or indeed whether it contains any <a href="#html-elements">HTML
|
| 65 |
|
|
elements</a> at all.) <code>Document</code> objects must also implement
|
| 66 |
|
|
the document-level interface of any other namespaces found in the document
|
| 67 |
|
|
that the UA supports. For example, if an HTML implementation also supports
|
| 68 |
|
|
SVG, then the <code>Document</code> object must implement <code><a
|
| 69 |
apache |
1.26 |
href="#htmldocument">HTMLDocument</a></code> and <code>SVGDocument</code>.
|
| 70 |
|
|
#ja
|
| 71 |
apache |
1.9 |
(この仕様書を実装する利用書エージェントにおける) すべての
|
| 72 |
|
|
<code>Document</code>
|
| 73 |
|
|
オブジェクトは、 <code><a
|
| 74 |
|
|
href="#htmldocument">HTMLDocument</a></code> 界面をも実装し、
|
| 75 |
|
|
束縛規定の方式により利用可能としなければ[[MUST:なりません]]。
|
| 76 |
|
|
(これは当該文書が <a href="#html-" title="HTML documents">HTML 文書</a>であるか否かや、
|
| 77 |
|
|
そもそも <a href="#html-elements">HTML
|
| 78 |
|
|
要素</a>を含んでいるか否かによらずのことです。)
|
| 79 |
|
|
<code>Document</code> オブジェクトは、文書中に現れ、利用者エージェントが対応している、
|
| 80 |
|
|
他の名前空間の文書水準の界面をも実装しなければ[[MUST:なりません]]。
|
| 81 |
|
|
例えば、 HTML 実装が SVG にも対応している場合、 <code>Document</code>
|
| 82 |
|
|
オブジェクトは <code><a
|
| 83 |
|
|
href="#htmldocument">HTMLDocument</a></code> と
|
| 84 |
apache |
1.26 |
<code>SVGDocument</code> を実装しなければなりません<!-- 例示なので MUST でなく must -->。
|
| 85 |
|
|
|
| 86 |
|
|
#en
|
| 87 |
apache |
1.10 |
Because the <code><a
|
| 88 |
|
|
href="#htmldocument">HTMLDocument</a></code> interface is now obtained
|
| 89 |
|
|
using binding-specific casting methods instead of simply being the primary
|
| 90 |
|
|
interface of the document object, it is no longer defined as inheriting
|
| 91 |
apache |
1.26 |
from <code>Document</code>.
|
| 92 |
|
|
#ja
|
| 93 |
apache |
1.10 |
<code><a
|
| 94 |
|
|
href="#htmldocument">HTMLDocument</a></code>
|
| 95 |
|
|
界面は現在では単純に文書オブジェクトの主たる界面であるとするのではなく、
|
| 96 |
|
|
束縛規定の型変換方式を使って得るものとしているので、
|
| 97 |
apache |
1.26 |
最早 <code>Document</code> から継承するとは定義していません。
|
| 98 |
|
|
|
| 99 |
|
|
#en
|
| 100 |
apache |
1.11 |
Since the <code><a href="#htmldocument">HTMLDocument</a></code>
|
| 101 |
|
|
interface holds methods and attributes related to a number of disparate
|
| 102 |
|
|
features, the members of this interface are described in various different
|
| 103 |
apache |
1.26 |
sections.
|
| 104 |
|
|
#ja
|
| 105 |
apache |
1.11 |
<code><a href="#htmldocument">HTMLDocument</a></code>
|
| 106 |
|
|
界面は色々な機能に関係するメソッドや属性を持っていますので、
|
| 107 |
apache |
1.26 |
この界面の構成員はそれぞれの節で説明します。
|
| 108 |
|
|
|
| 109 |
|
|
#en
|
| 110 |
apache |
1.12 |
User agents must raise a <a href="#security10">security exception</a>
|
| 111 |
|
|
whenever any of the members of an <code><a
|
| 112 |
|
|
href="#htmldocument">HTMLDocument</a></code> object are accessed by
|
| 113 |
|
|
scripts whose <a href="#effective3">effective script origin</a> is not the
|
| 114 |
|
|
<a href="#same-origin" title="same origin">same</a> as the
|
| 115 |
apache |
1.26 |
<code>Document</code>'s <a href="#effective3">effective script origin</a>.
|
| 116 |
|
|
#ja
|
| 117 |
apache |
1.12 |
利用者エージェントは、 <code><a
|
| 118 |
|
|
href="#htmldocument">HTMLDocument</a></code>
|
| 119 |
|
|
オブジェクトの構成員のいずれかが、
|
| 120 |
|
|
<a href="#effective3">実効スクリプト起源</a>が <code>Document</code>
|
| 121 |
|
|
の<a href="#effective3">実効スクリプト起源</a>と<a href="#same-origin" title="same origin">同じ</a>ではないスクリプトからアクセスされる場合に、
|
| 122 |
|
|
常に、
|
| 123 |
apache |
1.26 |
<a href="#security10">保安性例外</a>を発生させなければ[[MUST:なりません]]。
|
| 124 |
|
|
|
| 125 |
|
|
#pattern
|
| 126 |
apache |
1.13 |
<span class=secno>* </span><dfn id=resource0>Resource
|
| 127 |
apache |
1.26 |
metadata management</dfn>
|
| 128 |
|
|
#ja
|
| 129 |
|
|
<span class=secno>$1 </span><dfn id=resource0>資源メタデータ管理</dfn>
|
| 130 |
|
|
|
| 131 |
|
|
#en
|
| 132 |
apache |
1.14 |
The <dfn id=url0 title=dom-document-URL><code>URL</code></dfn> attribute
|
| 133 |
|
|
must return <span>the document's address</span><!--
|
| 134 |
apache |
1.26 |
XXXDOCURL xref -->.
|
| 135 |
|
|
#ja
|
| 136 |
apache |
1.14 |
<dfn id=url0 title=dom-document-URL><code>URL</code></dfn>
|
| 137 |
|
|
属性は<span>文書の番地</span><!--
|
| 138 |
apache |
1.26 |
XXXDOCURL xref -->を返さなければ[[MUST:なりません]]。
|
| 139 |
|
|
|
| 140 |
|
|
#en
|
| 141 |
apache |
1.15 |
The <dfn id=referrer
|
| 142 |
|
|
title=dom-document-referrer><code>referrer</code></dfn> attribute must
|
| 143 |
|
|
return either the <span title="the document's
|
| 144 |
|
|
address">address</span><!-- XXXDOXURL xref --> of the <a
|
| 145 |
|
|
href="#active">active document</a> of the <a href="#source0">source
|
| 146 |
|
|
browsing context</a> at the time the navigation was started (that is, the
|
| 147 |
|
|
page which <a href="#navigate" title=navigate>navigated</a> the <a
|
| 148 |
|
|
href="#browsing1">browsing context</a> to the current document), or the
|
| 149 |
|
|
empty string if there is no such originating page, or if the UA has been
|
| 150 |
|
|
configured not to report referrers in this case, or if the navigation was
|
| 151 |
|
|
initiated for a <a href="#hyperlinks">hyperlink</a> with a <code
|
| 152 |
apache |
1.26 |
title=rel-noreferrer><a href="#noreferrer">noreferrer</a></code> keyword.
|
| 153 |
|
|
#ja
|
| 154 |
apache |
1.15 |
<dfn id=referrer
|
| 155 |
|
|
title=dom-document-referrer><code>referrer</code></dfn>
|
| 156 |
|
|
属性は、操縦が開始された時点での<a href="#source0">原始閲覧文脈</a>の<a
|
| 157 |
|
|
href="#active">活性文書</a>
|
| 158 |
|
|
(<a
|
| 159 |
|
|
href="#browsing1">閲覧文脈</a>を現在の文書に<a href="#navigate" title=navigate>操縦</a>した頁)
|
| 160 |
|
|
の<span title="the document's
|
| 161 |
|
|
address">番地</span><!-- XXXDOXURL xref -->か、
|
| 162 |
|
|
または、そのような元々の頁がない場合、利用者エージェントがこの場合に参照子を報告しないように設定されている場合、
|
| 163 |
|
|
操縦が <code
|
| 164 |
|
|
title=rel-noreferrer><a href="#noreferrer">noreferrer</a></code>
|
| 165 |
|
|
キーワードのある<a href="#hyperlinks">ハイパーリンク</a>について初期化された場合には空文字列、
|
| 166 |
|
|
このいずれかを返さなければ[[MUST:なりません]]。
|
| 167 |
apache |
1.26 |
|
| 168 |
|
|
|
| 169 |
|
|
#en
|
| 170 |
apache |
1.16 |
In the case of HTTP, the <code title=dom-document-referrer><a
|
| 171 |
|
|
href="#referrer">referrer</a></code> DOM attribute will match the <code
|
| 172 |
|
|
title="">Referer</code> (sic) header that was sent when <a href="#fetch"
|
| 173 |
apache |
1.26 |
title=fetch>fetching</a> the current page.
|
| 174 |
|
|
#ja
|
| 175 |
apache |
1.16 |
HTTP の場合、 <code title=dom-document-referrer><a
|
| 176 |
|
|
href="#referrer">referrer</a></code> DOM 属性は現在の頁を<a href="#fetch"
|
| 177 |
|
|
title=fetch>取ってくる</a>時に送られた <code
|
| 178 |
apache |
1.26 |
title="">Referer</code> (ママ) 頭部と一致します。
|
| 179 |
|
|
|
| 180 |
|
|
#en
|
| 181 |
apache |
1.17 |
Typically user agents are configured to not report referrers
|
| 182 |
|
|
in the case where the referrer uses an encrypted protocol and the current
|
| 183 |
|
|
page does not (e.g. when navigating from an <code title="">https:</code>
|
| 184 |
apache |
1.26 |
page to an <code title="">http:</code> page).
|
| 185 |
|
|
#ja
|
| 186 |
apache |
1.17 |
通常、利用者エージェントは、参照子が暗号化プロトコルを使っており、
|
| 187 |
|
|
現在の頁がそうではない場合 (例えば <code title="">https:</code>
|
| 188 |
|
|
頁から <code title="">http:</code> 頁へと操縦した時)
|
| 189 |
apache |
1.26 |
には参照子を報告しないように設定されています。
|
| 190 |
|
|
|
| 191 |
|
|
#en
|
| 192 |
apache |
1.18 |
The <dfn id=cookie0 title=dom-document-cookie><code>cookie</code></dfn>
|
| 193 |
apache |
1.26 |
attribute represents the cookies of the resource.
|
| 194 |
|
|
#ja
|
| 195 |
apache |
1.18 |
<dfn id=cookie0 title=dom-document-cookie><code>cookie</code></dfn>
|
| 196 |
apache |
1.26 |
属性は、資源のクッキーを表します。
|
| 197 |
|
|
|
| 198 |
|
|
#en
|
| 199 |
apache |
1.19 |
On getting, if the <a href="#sandboxed2">sandboxed
|
| 200 |
|
|
origin browsing context flag</a> is set on the <a
|
| 201 |
|
|
href="#browsing1">browsing context</a> of the document, the user agent
|
| 202 |
|
|
must raise a <a href="#security10">security exception</a>. Otherwise, it
|
| 203 |
|
|
must return the same string as the value of the <code
|
| 204 |
|
|
title="">Cookie</code> HTTP header it would include if <a href="#fetch"
|
| 205 |
|
|
title=fetch>fetching</a> the resource indicated by <span>the document's
|
| 206 |
|
|
address</span><!-- XXXDOCURL --> over HTTP, as per RFC 2109 section 4.3.4
|
| 207 |
|
|
or later specifications. <a href="#refsRFC2109">[RFC2109]</a> <a
|
| 208 |
apache |
1.26 |
href="#refsRFC2965">[RFC2965]</a>
|
| 209 |
|
|
#ja
|
| 210 |
apache |
1.19 |
取得時、<a href="#sandboxed2">砂箱起源閲覧文脈旗</a>が文書の<a
|
| 211 |
|
|
href="#browsing1">閲覧文脈</a>に設定されている場合には、
|
| 212 |
|
|
利用者エージェントは<a href="#security10">保安性例外</a>を発生させなければ[[MUST:なりません]]。
|
| 213 |
|
|
そうでない場合、<span>文書の番地</span><!-- XXXDOCURL -->で示される資源を HTTP
|
| 214 |
|
|
によって<a href="#fetch"
|
| 215 |
|
|
title=fetch>取ってくる</a>場合に RFC 2109
|
| 216 |
|
|
4.3.4 節やより新しい仕様書に従って含まれるであろう <code
|
| 217 |
|
|
title="">Cookie</code> HTTP 頭部の値と同じ文字列を返さなければ[[MUST:なりません]]。 <a href="#refsRFC2109">[RFC2109]</a> <a
|
| 218 |
apache |
1.26 |
href="#refsRFC2965">[RFC2965]</a>
|
| 219 |
|
|
|
| 220 |
|
|
#en
|
| 221 |
apache |
1.20 |
On setting, if the <a href="#sandboxed2">sandboxed origin browsing
|
| 222 |
|
|
context flag</a> is set on the <a href="#browsing1">browsing context</a>
|
| 223 |
|
|
of the document, the user agent must raise a <a
|
| 224 |
|
|
href="#security10">security exception</a>. Otherwise, the user agent must
|
| 225 |
|
|
act as it would when processing cookies if it had just attempted to <a
|
| 226 |
|
|
href="#fetch">fetch</a> <span>the document's address</span><!-- XXXDOCURL
|
| 227 |
|
|
-->
|
| 228 |
|
|
over HTTP, and had received a response with a <code>Set-Cookie</code>
|
| 229 |
|
|
header whose value was the specified value, as per RFC 2109 sections
|
| 230 |
|
|
4.3.1, 4.3.2, and 4.3.3 or later specifications. <a
|
| 231 |
apache |
1.26 |
href="#refsRFC2109">[RFC2109]</a> <a href="#refsRFC2965">[RFC2965]</a>
|
| 232 |
|
|
#ja
|
| 233 |
apache |
1.20 |
設定時、<a href="#sandboxed2">砂箱起源閲覧文脈旗</a>が文書の<a
|
| 234 |
|
|
href="#browsing1">閲覧文脈</a>に設定されている場合には、
|
| 235 |
|
|
利用者エージェントは<a href="#security10">保安性例外</a>を発生させなければ[[MUST:なりません]]。
|
| 236 |
|
|
そうでない場合、利用者エージェントは、
|
| 237 |
|
|
<span>文書の番地</span><!-- XXXDOCURL -->で示される資源を HTTP
|
| 238 |
|
|
によって<a href="#fetch"
|
| 239 |
|
|
title=fetch>取ってこよう</a>とし、
|
| 240 |
|
|
値が指定された値である <code>Set-Cookie</code>
|
| 241 |
|
|
頭部がある応答を受信した場合にクッキーを処理する時と同じように、
|
| 242 |
|
|
RFC 2109 4.3.1 節、4.3.2 節、4.3.3. 節やより新しい仕様書に従い作用しなければ[[MUST:なりません]]。 <a href="#refsRFC2109">[RFC2109]</a> <a
|
| 243 |
apache |
1.26 |
href="#refsRFC2965">[RFC2965]</a>
|
| 244 |
|
|
|
| 245 |
|
|
#en
|
| 246 |
apache |
1.21 |
Since the <code title=dom-document-cookie><a
|
| 247 |
|
|
href="#cookie0">cookie</a></code> attribute is accessible across frames,
|
| 248 |
|
|
the path restrictions on cookies are only a tool to help manage which
|
| 249 |
|
|
cookies are sent to which parts of the site, and are not in any way a
|
| 250 |
apache |
1.26 |
security feature.
|
| 251 |
|
|
#ja
|
| 252 |
apache |
1.21 |
<code title=dom-document-cookie><a
|
| 253 |
|
|
href="#cookie0">cookie</a></code> 属性はフレームをまたいでアクセス可能ですので、
|
| 254 |
|
|
クッキーの経路制限はクッキーがサイト上のどの部分に送られるかを管理することを助けるための道具に過ぎず、
|
| 255 |
apache |
1.26 |
保安性のための機能では決してありません。
|
| 256 |
|
|
|
| 257 |
|
|
#en
|
| 258 |
apache |
1.22 |
The <dfn id=lastmodified
|
| 259 |
|
|
title=dom-document-lastModified><code>lastModified</code></dfn> attribute,
|
| 260 |
|
|
on getting, must return the date and time of the <code>Document</code>'s
|
| 261 |
|
|
source file's last modification, in the user's local timezone, in the
|
| 262 |
apache |
1.26 |
following format:
|
| 263 |
|
|
#ja
|
| 264 |
apache |
1.22 |
<dfn id=lastmodified
|
| 265 |
|
|
title=dom-document-lastModified><code>lastModified</code></dfn>
|
| 266 |
|
|
属性は、取得時、 <code>Document</code> の原始ファイルの最終修正の日時を、
|
| 267 |
apache |
1.26 |
利用者の地方時において、次の書式で返さなければ[[MUST:なりません]]。
|
| 268 |
|
|
|
| 269 |
|
|
#en
|
| 270 |
|
|
The month component of the date.
|
| 271 |
|
|
#ja
|
| 272 |
|
|
日付の月の部品。
|
| 273 |
|
|
|
| 274 |
|
|
#en
|
| 275 |
|
|
A U+002F SOLIDUS character ('/').
|
| 276 |
|
|
#ja
|
| 277 |
|
|
U+002F SOLIDUS 文字 ('/')。
|
| 278 |
|
|
|
| 279 |
|
|
#en
|
| 280 |
|
|
The day component of the date.
|
| 281 |
|
|
#ja
|
| 282 |
apache |
1.27 |
日付の日の部品。 |
| 283 |
|
|
|
| 284 |
|
|
#en |
| 285 |
|
|
The year component of the date. |
| 286 |
|
|
#ja |
| 287 |
apache |
1.28 |
日付の年の部品。 |
| 288 |
|
|
|
| 289 |
|
|
#en |
| 290 |
|
|
A U+0020 SPACE character. |
| 291 |
|
|
#ja |
| 292 |
apache |
1.29 |
U+0020 SPACE 文字。 |
| 293 |
|
|
|
| 294 |
|
|
#en |
| 295 |
|
|
The hours component of the time. |
| 296 |
|
|
#ja |
| 297 |
apache |
1.30 |
時刻の時の部品。 |
| 298 |
|
|
|
| 299 |
|
|
#en |
| 300 |
|
|
A U+003A COLON character (':'). |
| 301 |
|
|
#ja |
| 302 |
|
|
U+003A COLON 文字 (':')。 |