#pattern * Semantics and structure of HTML documents #ja $1 HTML 文書の意味と構造 #pattern * Documents #ja $1 文書 #en Every XML and HTML document in an HTML UA is represented by a Document object. [DOM3CORE] #ja HTML 利用者エージェントにおけるすべての XML や HTML の文書は Document オブジェクトにより表現されます。 [DOM3CORE] #pattern * Documents in the DOM #ja $1 DOM 中の文書 #en Document objects are assumed to be XML documents unless they are flagged as being HTML documents when they are created. Whether a document is an HTML document or an XML document affects the behavior of certain APIs, as well as a few CSS rendering rules. [CSS21] #ja Document オブジェクトは、作成された時に HTML 文書であると旗付けされていなければ、 XML 文書であると見なします。 文書が HTML 文書であるか XML 文書であるかは、 いくつかの API の動作や CSS のレンダリング規則の一部に影響します。 [CSS21] #en A Document object created by the createDocument() API on the DOMImplementation object is initially an XML document, but can be made into an HTML document by calling document.open() on it. #ja DOMImplementation 上の createDocument() API により作成された Document オブジェクトははじめ XML 文書ですが、 document.open() を呼び出すことにより HTML 文書にすることができます。 #en All Document objects (in user agents implementing this specification) must also implement the HTMLDocument interface, available using binding-specific methods. (This is the case whether or not the document in question is an HTML document or indeed whether it contains any HTML elements at all.) Document objects must also implement the document-level interface of any other namespaces found in the document that the UA supports. For example, if an HTML implementation also supports SVG, then the Document object must implement HTMLDocument and SVGDocument. #ja (この仕様書を実装する利用書エージェントにおける) すべての Document オブジェクトは、 HTMLDocument 界面をも実装し、 束縛規定の方式により利用可能としなければ[[MUST:なりません]]。 (これは当該文書が HTML 文書であるか否かや、 そもそも HTML 要素を含んでいるか否かによらずのことです。) Document オブジェクトは、文書中に現れ、利用者エージェントが対応している、 他の名前空間の文書水準の界面をも実装しなければ[[MUST:なりません]]。 例えば、 HTML 実装が SVG にも対応している場合、 Document オブジェクトは HTMLDocumentSVGDocument を実装しなければなりません。 #en Because the HTMLDocument interface is now obtained using binding-specific casting methods instead of simply being the primary interface of the document object, it is no longer defined as inheriting from Document. #ja HTMLDocument 界面は現在では単純に文書オブジェクトの主たる界面であるとするのではなく、 束縛規定の型変換方式を使って得るものとしているので、 最早 Document から継承するとは定義していません。 #en Since the HTMLDocument interface holds methods and attributes related to a number of disparate features, the members of this interface are described in various different sections. #ja HTMLDocument 界面は色々な機能に関係するメソッドや属性を持っていますので、 この界面の構成員はそれぞれの節で説明します。 #en User agents must raise a security exception whenever any of the members of an HTMLDocument object are accessed by scripts whose effective script origin is not the same as the Document's effective script origin. #ja 利用者エージェントは、 HTMLDocument オブジェクトの構成員のいずれかが、 実効スクリプト起源Document実効スクリプト起源同じではないスクリプトからアクセスされる場合に、 常に、 保安性例外を発生させなければ[[MUST:なりません]]。 #pattern * Resource metadata management #ja $1 資源メタデータ管理 #en The URL attribute must return the document's address. #ja URL 属性は文書の番地を返さなければ[[MUST:なりません]]。 #en The referrer attribute must return either the address of the active document of the source browsing context at the time the navigation was started (that is, the page which navigated the browsing context to the current document), or the empty string if there is no such originating page, or if the UA has been configured not to report referrers in this case, or if the navigation was initiated for a hyperlink with a noreferrer keyword. #ja referrer 属性は、操縦が開始された時点での原始閲覧文脈活性文書 (閲覧文脈を現在の文書に操縦した頁) の番地か、 または、そのような元々の頁がない場合、利用者エージェントがこの場合に参照子を報告しないように設定されている場合、 操縦が noreferrer キーワードのあるハイパーリンクについて初期化された場合には空文字列、 このいずれかを返さなければ[[MUST:なりません]]。 #en In the case of HTTP, the referrer DOM attribute will match the Referer (sic) header that was sent when fetching the current page. #ja HTTP の場合、 referrer DOM 属性は現在の頁を取ってくる時に送られた Referer (ママ) 頭部と一致します。 #en Typically user agents are configured to not report referrers in the case where the referrer uses an encrypted protocol and the current page does not (e.g. when navigating from an https: page to an http: page). #ja 通常、利用者エージェントは、参照子が暗号化プロトコルを使っており、 現在の頁がそうではない場合 (例えば https: 頁から http: 頁へと操縦した時) には参照子を報告しないように設定されています。 #en The cookie attribute represents the cookies of the resource. #ja cookie 属性は、資源のクッキーを表します。 #en On getting, if the sandboxed origin browsing context flag is set on the browsing context of the document, the user agent must raise a security exception. Otherwise, it must return the same string as the value of the Cookie HTTP header it would include if fetching the resource indicated by the document's address over HTTP, as per RFC 2109 section 4.3.4 or later specifications. [RFC2109] [RFC2965] #ja 取得時、砂箱起源閲覧文脈旗が文書の閲覧文脈に設定されている場合には、 利用者エージェントは保安性例外を発生させなければ[[MUST:なりません]]。 そうでない場合、文書の番地で示される資源を HTTP によって取ってくる場合に RFC 2109 4.3.4 節やより新しい仕様書に従って含まれるであろう Cookie HTTP 頭部の値と同じ文字列を返さなければ[[MUST:なりません]]。 [RFC2109] [RFC2965] #en On setting, if the sandboxed origin browsing context flag is set on the browsing context of the document, the user agent must raise a security exception. Otherwise, the user agent must act as it would when processing cookies if it had just attempted to fetch the document's address over HTTP, and had received a response with a Set-Cookie header whose value was the specified value, as per RFC 2109 sections 4.3.1, 4.3.2, and 4.3.3 or later specifications. [RFC2109] [RFC2965] #ja 設定時、砂箱起源閲覧文脈旗が文書の閲覧文脈に設定されている場合には、 利用者エージェントは保安性例外を発生させなければ[[MUST:なりません]]。 そうでない場合、利用者エージェントは、 文書の番地で示される資源を HTTP によって取ってこようとし、 値が指定された値である Set-Cookie 頭部がある応答を受信した場合にクッキーを処理する時と同じように、 RFC 2109 4.3.1 節、4.3.2 節、4.3.3. 節やより新しい仕様書に従い作用しなければ[[MUST:なりません]]。 [RFC2109] [RFC2965] #en Since the cookie attribute is accessible across frames, the path restrictions on cookies are only a tool to help manage which cookies are sent to which parts of the site, and are not in any way a security feature. #ja cookie 属性はフレームをまたいでアクセス可能ですので、 クッキーの経路制限はクッキーがサイト上のどの部分に送られるかを管理することを助けるための道具に過ぎず、 保安性のための機能では決してありません。 #en The lastModified attribute, on getting, must return the date and time of the Document's source file's last modification, in the user's local timezone, in the following format: #ja lastModified 属性は、取得時、 Document の原始ファイルの最終修正の日時を、 利用者の地方時において、次の書式で返さなければ[[MUST:なりません]]。 #en The month component of the date. #ja 日付の月の部品。 #en A U+002F SOLIDUS character ('/'). #ja U+002F SOLIDUS 文字 ('/')。 #en The day component of the date. #ja 日付の日の部品。 #en The year component of the date. #ja 日付の年の部品。 #en A U+0020 SPACE character. #ja U+0020 SPACE 文字。 #en The hours component of the time. #ja 時刻の時の部品。 #en A U+003A COLON character (':'). #ja U+003A COLON 文字 (':')。 #en The minutes component of the time. #ja 時刻の分の部品。 #en The seconds component of the time. #ja 時刻の秒の部品。 #en All the numeric components above, other than the year, must be given as two digits in the range U+0030 DIGIT ZERO to U+0039 DIGIT NINE representing the number in base ten, zero-padded if necessary. #ja 前述の数値の部品のうち年以外のすべては、範囲 U+0030 DIGIT ZERO ~ U+0039 DIGIT NINE の2つの数字によって十進数を表す、 必要なら零埋めしたものとして与えなければ[[MUST:なりません]]。 #en The Document's source file's last modification date and time must be derived from relevant features of the networking protocols used, e.g. from the value of the HTTP Last-Modified header of the document, or from metadata in the file system for local files. If the last modification date and time are not known, the attribute must return the string 01/01/1970 00:00:00. #ja Document の原始ファイルの最終修正日時は、 使用されているネットワークのプロトコルの関係する機能、例えば文書の HTTP Last-Modified 頭部から、または局所ファイルのファイル・システムのメタデータから得たものでなければ[[MUST:なりません]]。 最終修正日時がわからない場合は、この属性は文字列 01/01/1970 00:00:00 を返さなければ[[MUST:なりません]]。 #en The Document's source file's last modification date and time must be derived from relevant features of the networking protocols used, e.g. from the value of the HTTP Last-Modified header of the document, or from metadata in the file system for local files. If the last modification date and time are not known, the attribute must return the string 01/01/1970 00:00:00. #ja Document の原始ファイルの最終修正日時は、 使用されているネットワークのプロトコルの関係する機能、例えば文書の HTTP Last-Modified 頭部から、または局所ファイルのファイル・システムのメタデータから得たものでなければ[[MUST:なりません]]。 最終修正日時がわからない場合は、この属性は文字列 01/01/1970 00:00:00 を返さなければ[[MUST:なりません]]。 #en A Document is always set to one of three modes: no quirks mode, the default; quirks mode, used typically for legacy documents; and limited quirks mode, also known as "almost standards" mode. The mode is only ever changed from the default by the HTML parser, based on the presence, absence, or value of the DOCTYPE string. #ja Document は常に3つのモードのいずれかに設定されています。無奇癖モードは既定値です。奇癖モードは、 普通、遺物文書に使われます。制限奇癖モードは、「ほぼ標準」モードとも呼ばれます。 このモードは HTML 構文解析器によってのみ、 DOCTYPE 文字列が存在するか存在しないかやその値に基づいて既定値から変更されます。 #en The compatMode DOM attribute must return the literal string "CSS1Compat" unless the document has been set to quirks mode by the HTML parser, in which case it must instead return the literal string "BackCompat". #ja compatMode DOM 属性は、生の文字列「CSS1Compat」を返さなければ[[MUST:なりません]]。 ただし、文書が HTML 構文解析器により奇癖モードに設定されている場合には、 代わりに名前の文字列「BackCompat」を返さなければ[[MUST:なりません]]。 #en Documents have an associated character encoding. When a Document object is created, the document's character encoding must be initialized to UTF-16. Various algorithms during page loading affect this value, as does the charset setter. [IANACHARSET] #ja 文書は文字符号化と関連付けられています。 Document オブジェクトが作成された時、文書の文字符号化は UTF-16 に初期化されなければ[[MUST:なりません]]。 頁の読み込みの間の色々な算法や charset 設定子がこの値を変化させます。 [IANACHARSET] #en The charset DOM attribute must, on getting, return the preferred MIME name of the document's character encoding. On setting, if the new value is an IANA-registered alias for a character encoding, the document's character encoding must be set to that character encoding. (Otherwise, nothing happens.) #ja charset DOM 属性は、取得時、文書の文字符号化の優先 MIME 名を返さなければ[[MUST:なりません]]。設定時、 新しい値がある文字符号化の IANA に登録された別名である場合、文書の文字符号化をその文字符号化に設定しなければ[[MUST:なりません]]。 (それ以外の場合、何も起きません。) #en The characterSet DOM attribute must, on getting, return the preferred MIME name of the document's character encoding. #ja characterSet DOM 属性は、取得時、文書の文字符号化の優先 MIME 名を返さなければ[[MUST:なりません]]。 #en The defaultCharset DOM attribute must, on getting, return the preferred MIME name of a character encoding, possibly the user's default encoding, or an encoding associated with the user's current geographical location, or any arbitrary encoding name. #ja defaultCharset DOM 属性は、取得時、文字符号化の優先 MIME 名を返さなければ[[MUST:なりません]]。 この文字符号化は利用者の既定の符号化でもいいですし、 利用者の現在の地理的位置に関連付けられた符号化でもいいですし、 その他任意の符号化名でもあり得ます。 #pattern * DOM tree accessors #ja $1 DOM 木アクセス器 #en The html element of a document is the document's root element, if there is one and it's an html element, or null otherwise. #ja 文書の文書 html 要素は、 その文書の根要素があり、それが html 要素である場合はその要素、それ以外の場合には null です。 #en The head element of a document is the first head element that is a child of the html element, if there is one, or null otherwise. #ja 文書の文書 head 要素は、 文書 html 要素の子供である最初の head 要素がある場合はその要素、 そうでない場合は null です。 #en The title element of a document is the first title element in the document (in tree order), if there is one, or null otherwise. #ja 文書の文書 title 要素は文書の (木順で) 最初の title 要素がある場合はその要素、 そうでない場合は null です。 #en The title attribute must, on getting, run the following algorithm: #ja title 属性は、 取得時、次の算法を走らせなければ[[MUST:なりません]]。 #en If the root element is an svg element in the "http://www.w3.org/2000/svg" namespace, and the user agent supports SVG, then the getter must return the value that would have been returned by the DOM attribute of the same name on the SVGDocument interface. #ja 根要素が 「http://www.w3.org/2000/svg」名前空間の svg 要素であり、利用者エージェントが SVG に対応している場合、取得器は SVGDocument 界面の同名の DOM 属性が返す値を返さなければ[[MUST:なりません]]。 #en Otherwise, it must return a concatenation of the data of all the child text nodes of the title element, in tree order, or the empty string if the title element is null. #ja そうでない場合、文書 title 要素のすべての子供テキスト節点のデータを木順に連結したものを返すか、 文書 title 要素が null の場合には殻文字列を返さなければ[[MUST:なりません]]。 #en On setting, the following algorithm must be run: #ja 設定時、次の算法を走らせなければ[[MUST:なりません]]。 #en If the root element is an svg element in the "http://www.w3.org/2000/svg" namespace, and the user agent supports SVG, then the setter must defer to the setter for the DOM attribute of the same name on the SVGDocument interface (if it is readonly, then this will raise an exception). Stop the algorithm here. #ja 根要素が 「http://www.w3.org/2000/svg」名前空間の svg 要素で利用者エージェントが SVG に対応している場合、 設定器は SVGDocument 界面の同名の DOM 属性の設定器に委ねなければ[[MUST:なりません]] (それが読み取り専用である場合、例外を発生させることとなります)。算法をここで停止します。 #en If the title element is null and the head element is null, then the attribute must do nothing. Stop the algorithm here. #ja 文書 title 要素が null で文書 head 要素が null の場合、属性は何もしては[[MUST:なりません]]。算法をここで停止します。 #en If the title element is null, then a new title element must be created and appended to the head element. #ja 文書 title 要素が null の場合、新しい title 要素を作成し、 文書 head 要素の最後に追加しなければ[[MUST:なりません]]。 #en The children of the title element (if any) must all be removed. #ja 文書 title 要素の子供を (あれば) すべて削除しなければ[[MUST:なりません]]。 #en A single Text node whose data is the new value being assigned must be appended to the title element. #ja データが指定された新しい値である1つの Text 節点を 文書 title 要素の最後に追加しなければ[[MUST:なりません]]。 #en The title attribute on the HTMLDocument interface should shadow the attribute of the same name on the SVGDocument interface when the user agent supports both HTML and SVG. #ja 利用者エージェントが HTML と SVG の両方に対応する時には、 HTMLDocument 界面の title 属性が SVGDocument 界面の同名の属性を隠す[[SHOULD:べきです]]。 #en Documents have an associated character encoding. When a Document object is created, the document's character encoding must be initialized to UTF-16. Various algorithms during page loading affect this value, as does the charset setter. [IANACHARSET] #ja 文書には、それに関連付けられた文字符号化があります。 Document オブジェクトが作られた時、 文書の文字符号化は UTF-16 に初期化されなければ[[MUST:なりません]]。 頁の読み込みの過程の色々な算法や charset 設定器がこの値に影響します。 [IANACHARSET] #en The charset DOM attribute must, on getting, return the preferred MIME name of the document's character encoding. On setting, if the new value is an IANA-registered alias for a character encoding, the document's character encoding must be set to that character encoding. (Otherwise, nothing happens.) #ja charset DOM 属性は、取得時、文書の文字符号化の優先 MIME 名を返さなければ[[MUST:なりません]]。 設定時、新しい値が文字符号化の IANA に登録された別名である場合、 文書の文字符号化をその文字符号化に設定しなければ[[MUST:なりません]]。 (そうでない場合、何も起こりません。) #en The characterSet DOM attribute must, on getting, return the preferred MIME name of the document's character encoding. #ja characterSet DOM 属性は、取得時、文書の文字符号化の優先 MIME 名を返さなければ[[MUST:なりません]]。 #en The body element of a document is the first child of the html element that is either a body element or a frameset element. If there is no such element, it is null. If the body element is null, then when the specification requires that events be fired at "the body element", they must instead be fired at the Document object. #ja 文書の文書 body 要素は、 文書 html 要素の最初の子供であって、 body 要素か frameset 要素のいずれかであるものです。そのような要素がない場合、 null です。 文書 body 要素が null の場合、仕様書により事象が「文書 body 要素」において発火されることが要求される時、 その事象は代わりに Document オブジェクトにおいて発火されなければ[[MUST:なりません]]。 #en The body attribute, on getting, must return the body element of the document (either a body element, a frameset element, or null). On setting, the following algorithm must be run: #ja body 属性は、取得時、文書の文書 body 要素 (body 要素か、 frameset 要素か、 null のいずれか) を返さなければ[[MUST:なりません]]。 設定時、次の算法を走らせなければ[[MUST:なりません]]。 #en If the new value is not a body or frameset element, then raise a HIERARCHY_REQUEST_ERR exception and abort these steps. #ja 新しい値が body 要素か frameset 要素でない場合、 HIERARCHY_REQUEST_ERR 例外を発生させ、 これらの段階を停止します。 #en Otherwise, if the new value is the same as the body element, do nothing. Abort these steps. #ja そうでない場合、新しい値が文書 body 要素と同じであれば、なにもしません。これらの段階を停止します。 #en Otherwise, if the body element is not null, then replace that element with the new value in the DOM, as if the root element's replaceChild() method had been called with the new value and the incumbent body element as its two arguments respectively, then abort these steps. #ja そうでない場合、文書 body 要素が null でなければ、根要素の replaceChild() メソッドに新しい値と現行の文書 body 要素をそれぞれ2つの引数として呼び出した場合と同様にして、 DOM 中のその要素を新しい値により置き換え、 これらの段階を停止します。 #en Otherwise, the the body element is null. Append the new value to the root element. #ja そうでない場合、文書 body 要素は null です。新しい値を根要素の末尾に追加します。 #en The images attribute must return an HTMLCollection rooted at the Document node, whose filter matches only img elements. #ja images 属性は、 Document 節点を根とする、 濾過器が img 要素にのみ一致するような HTMLCollection を返さなければ[[MUST:なりません]]。 #en The embeds attribute must return an HTMLCollection rooted at the Document node, whose filter matches only embed elements. #ja embeds 属性は、 Document 節点を根とする、 濾過器が embed 要素にのみ一致するような HTMLCollection を返さなければ[[MUST:なりません]]。 #en The plugins attribute must return the same object as that returned by the embeds attribute. #ja plugins 属性は、 embeds 属性が返すのと同じオブジェクトを返さなければ[[MUST:なりません]]。 #en The links attribute must return an HTMLCollection rooted at the Document node, whose filter matches only a elements with href attributes and area elements with href attributes. #ja links 属性は、Document 節点を根とする、 濾過器が href 属性を持つ a 要素と href 属性を持つ area 要素にのみ一致するような HTMLCollection を返さなければ[[MUST:なりません]]。