(2)
Each XUL file that is loaded will have its own document displayed in a window or
frame. Although there is only ever one document associated with a window at a time,
you may load additional documents using various methods.
読み込まれた XUL ファイルはそれぞれ、ウィンドウやフレーム内に表示された■表示される自分の文書を持ちます(読み込まれた直後、表示される直前と考えるべきでしょう)。ウィンドウには一度に一つの文書のみが関連しますが、色々なメソッドを使ってさらに文書を読み込むことができます。
(3)
In Mozilla, the DOM may be accessed and manipulated using JavaScript. The various
DOM objects have functions which may be accessed in script, however, it is important
to note that the DOM is an API that is accessible by JavaScript. JavaScript itself
is just a scripting language that can access these objects because Mozilla provides
these objects for use.
Mozilla では JavaScript を使って DOM にアクセスしたり操作したりできます。色々な DOM オブジェクトがスクリプトで■スクリプトからアクセスできる関数を持ちますが、DOM は JavaScript からアクセス可能な API である、と記しておくのは重要です。 JavaScript 自身は単に、Mozilla がこれらのオブジェクトを使えるように提供しているためアクセスできるスクリプト言語にすぎません。■ JavaScript 自身は単に、Mozilla が提供しているこれらのオブジェクトを使えるようにするために、これらにアクセスできるスクリプト言語にすぎません。(どうしても「使えるように、提供しているためアクセスできる」と読めてしまって、なんだかわかりにくい。)
(6)
In this example, we retrieve the opener window and call the getText function declared
in a script used there.
この例では opener ■開いた元のウィンドウを取得して(この opener は opener プロパティそのものではないので、訳すべきと思う)、そのウィンドウで使用されているスクリプトで宣言された getText 関数を呼び出しています。
(7)
The window's open method also returns a reference to the new window so you can call
functions of the new window from the opener. It is important to note, however, that
the open method returns before the window has fully loaded, so functions will not
typically be available yet.
window の open メソッドは新規ウィンドウの参照を返すので、 opener ■開いた元のウインドウから新しい window ■ウィンドウの関数を呼び出すことができます。しかし open メソッドはウィンドウが完全にロードされる前に返すため■返るため、関数は一般的にはまだ利用できないであろう■、ということに注意するのは大事です。(必然的帰結を述べているので、「利用できない」で止める方がスッキリすると思います: will は蓋然性を表す、断定に近いものと解釈)
(8)
window オブジェクトは DOM 仕様では定義されていませんが、 Mozilla ではときに DOM Level 0 の一部と考えられています。仕様に追加される前に DOM 的な関数を参照するために、■一部の開発者達に使われた名前のことです■だったのです(過去への言及)。ウィンドウに表示される実際のドキュメントは window の document プロパティを使って取得できます。 window の最もよく参照されるプロパティの一つなので、 document プロパティは通常 'window' 修飾子なしで参照します。
(12)
It doesn't make sense to have the progress bar and the dummy tree data
displayed when the find files dialog is first displayed. These were added so
that we could see them. Let's take them out now and have them displayed
when the Find button is pressed. First, we need to make them initially
invisible. The <SPAN CLASS="attrib">hidden</SPAN> attribute is used to
control whether an element is visible or not.
ファイル検索ダイアログが最初に表示されたときにプログレスバーやダミーのツリーデータが表示されても意味はありません。■これらは目で確認できるようにするために加えられたものです。(訳抜け)取り除いておき、検索ボタンが押されておきに■押されたときに表示するようにしましょう。まず、初めは不可視にする必要があります。要素を表示するかどうかの制御には <SPAN CLASS="attrib">hidden</SPAN> ■属性が使用されます。
(14)
This function first gets a reference to the progress meter using its id,
<SPAN CLASS="aval">progmeter</SPAN>. The second line of the function body
changes the hidden state so that the element is visible again.
この関数はまず <SPAN CLASS="aval">progmeter</SPAN> ID を用いてプログレスメータの■、プログレスメータの ID( <SPAN CLASS="aval">progmeter</SPAN> )を用いてその参照を取得します。関数本体の 2 行目では hidden 属性の状態を変えたため、再び要素は表示されます■変え、再び要素が表示されるようにします。
(15)
Finally, let's have an alert box pop up that displays what will be searched for.
Of course, we wouldn't want this in the final version but we'll add it to reassure
us that something would happen.
最後に、アラートボックスがポップアップして検索対象を表示するようにします。勿論これは最終的に求めるものではありませんが、何か起きるのだと安心■何かが起きるのだと確認出来るように追加しておきます。( reassure:「安心」はいまいち違うか? 辞書では「安心」等が一般的ですが、語源的には reassure (再確認)→ assure (確信/保証)→ sure(確か)の意味を持ちます。)
(16)
<H3>XUL Element■要素の DOM</H3>
(17)
Every XUL element has a set of attributes, a set of properties and a set of children.
The attributes are declared in the source, for example, flex="1", is a
<SPAN CLASS="attrib">flex</SPAN> attribute set to the value
<SPAN CLASS="aval">1</SPAN>. Properties are available in JavaScript using the dot
syntax. For example, element.hidden refers to the hidden property of an element.
XUL 要素は全て一組の属性、一組のプロパティ、一組の子要素を持っています。属性はソースで宣言されており、■されるものです。例えば flex="1" は
<SPAN CLASS="aval">1</SPAN> という値に設定された
<SPAN CLASS="attrib">flex</SPAN> 属性のことです。プロパティは dot 構文を使って JavaScript で用いられます。■プロパティは JavaScript からドット構文を使って利用できるものです。例えば element.hidden は要素 element の hidden プロパティを指します(この部分は属性とプロパティの対比もしているので、それをふまえた表現にすべきようだ)。
(18)
In this case, the underlying code just returns the value of the
attribute.
この場合には、■裏で動作するコードは単にこの属性の値を返すだけです。(underlying :ちょっと訳し難い語ですが、表に現れない、ベースの、支えになっている、底流の、といった感じでしょうか。)
(19)
次の例は、代わりに flex プロパティを使って上例■上の例と同じことを行います。
(20)
As with each document, there is a different element object for XUL elements as for
HTML and XML elements.
ドキュメントごとと同様、HTML 要素や XML 要素でのように XUL 要素にはまた別の要素オブジェクトがあります。■ドキュメント型のときと同様、 XUL 要素に対してもまた、 HTML 要素や XML 要素に対するものと同じく、別の要素オブジェクトがあります。(あまり自信はないが、多少はこなれたかな?)
…
XULElement インターフェイスは XUL 要素に特有なたくさんのプロパティやメソッドを持っています。その多くは■より総称的な DOM Element インターフェイスから継承しています。(単に「総称的」だと、継承の親→総称的の関連が見えにくいので「より」を入れた)
(21)
これにより、 XHTML ボタンがこのケースでは■(日本語的には不要かと)作られることになります。 4 番目のボタンは少し紛らわしいものですが、重要なのは URI であって接頭辞ではないことを明確にしています。 4 番目の例は XUL ボタンであって、 HTML ボタンではありません。接頭辞ではそういっているのですが。これは大きな特徴です。■この<わけ隔て/区別>は重要です。(distinction :ここでは「区別」だと思う)
(22)
The DOM provides a number of namespace related functions similar to the non-namespace
ones. For example, the getAttributeNS function is similar to the the getAttribute
function except an additional argument may be supplied to specify an attribute in
a specific namespace.
DOM は、名前空間のものではない関数に似ている、名前空間に関係した関数をたくさん提供します。■DOM には、名前空間とは関わらない関数に対して相似的な、名前空間に関わる関数がいくつもあります。例えば getAttributeNS 関数は、特定の名前空間の属性を指定する補助的な引数も与られる■与えられる以外は、 getAttribute 関数と似ています■同様です。(「〜以外は」に対して「似ています」は不十分な感じ。むしろ「同じです」でも良さそう)
<H3>DOM を歩く</H3>
(23)
Since the DOM is a tree structure, you can navigate through the tree using a variety of properties.
DOM はツリー構造なので、色々なプロパティを使ってツリーを歩くことができます。
( navigate - 「歩く」:「たどる」という訳も考えられそう:ノード間を枝をつたって、というイメージ)
(12)
It doesn't make sense to have the progress bar and the dummy tree data
displayed when the find files dialog is first displayed. These were added so
that we could see them. Let's take them out now and have them displayed
when the Find button is pressed. First, we need to make them initially
invisible. The <SPAN CLASS="attrib">hidden</SPAN> attribute is used to
control whether an element is visible or not.
ファイル検索ダイアログが最初に表示されたときにプログレスバーやダミーのツリーデータが表示されても意味はありません。■これらは目で確認できるようにするために加えられたものです。(訳抜け)取り除いておき、検索ボタンが押されておきに■押されたときに表示するようにしましょう。まず、初めは不可視にする必要があります。要素を表示するかどうかの制御には <SPAN CLASS="attrib">hidden</SPAN> ■属性が使用されます。
訳抜けの補完ありがとうございます。
yh wrote:
<H3>DOM を歩く</H3>
(23)
Since the DOM is a tree structure, you can navigate through the tree using a variety of properties.
DOM はツリー構造なので、色々なプロパティを使ってツリーを歩くことができます。
( navigate - 「歩く」:「たどる」という訳も考えられそう:ノード間を枝をつたって、というイメージ)