#pattern
* The * event
#ja
$1 $2 事象
#en
The storage
event is fired in an HTMLDocument
when a storage area changes, as described in the previous two sections (for session storage, for local storage).
#ja
storage
事象は、 HTMLDocument
において、ストレージ領域が変化した時に。前の2つの節
(セッション・ストレージ対象、局所ストレージ対象)
で説明したように発火されます。
#en
When this happens, the user agent must dispatch an event with the name
storage, with no namespace, which
does not bubble but is cancelable, and which uses the StorageEvent, at the
body element of each active HTMLDocument
object affected.
#ja
利用者エージェントは、これが起こる時、名前
storage、
名前空間なし、
泡立たず取消し可能で StorageEvent
を使った事象を、関係する活性 HTMLDocument
オブジェクトそれぞれの文書
body 要素に対して発送しなければ[[MUST:なりません]]。
#pattern
* Event definition
#ja
$1 事象定義
#en
The key
attribute represents the key being changed.
#ja
key
属性は、変化する鍵を表します。
#en
The oldValue attribute
represents the old value of the key being changed.
#ja
oldValue
属性は、変化する鍵の古い値を表します。
#en
The newValue attribute
represents the new value of the key being changed.
#ja
newValue
属性は、変化する鍵の新しい値を表します。
#en
The url
attribute represents the address of the document that changed the key.
#ja
url
属性は、鍵を変更した文書の番地を表します。
#en
The source attribute
represents the Window that changed the
key.
#ja
source 属性は、
鍵を変更した Window
を表します。
#en
Multiple browsing contexts must be able to access the local storage
areas simultaneously in a predictable manner. Scripts must not be able to
detect any concurrent script execution.
#ja
複数の閲覧文脈は、局所ストレージ領域に同時に予測可能な方法でアクセスできなければ[[MUST:なりません]]。
スクリプトが並行スクリプト実行を検知可能であっては[[MUST:なりません]]。
#en
This is required to guarantee that the length attribute of a Storage object never changes while a script is
executing, other than in a way that is predictable by the script itself.
#ja
これは Storage
オブジェクトの length
属性があるスクリプトの実行中にスクリプト自体が予期可能な形以外で決して代わらないことを保証するために[[REQUIRED:要求]]されます。
#en
There are various ways of implementing this requirement. One is that if
a script running in one browsing context accesses a local storage area,
the UA blocks scripts in other browsing contexts when they try to access
the local storage area for the same origin
until the first script has executed to completion. (Similarly, when a
script in one browsing context accesses its session storage area, any
scripts that have the same top level browsing context and the same origin would block when accessing their
session storage area until the first script has executed to completion.)
Another (potentially more efficient but probably more complex)
implementation strategy is to use optimistic transactional script
execution. This specification does not require any particular
implementation strategy, so long as the requirement above is met.
#ja
この要件を実装する方法は色々あります。
1つは、ある閲覧文脈で走っているスクリプトが局所ストレージ領域にアクセスする場合、
そのスクリプトが実行完了するまでの間、
他の閲覧文脈中のスクリプトが同一起源の局所ストレージ領域にアクセスしようとしたら利用者エージェントがブロックする、
というものです。
(同様に、ある閲覧文脈中のスクリプトがセッション・ストレージ領域にアクセスする時に、
そのスクリプトが実行完了するまでの間、
同じ最上位閲覧文脈と同一起源を持つスクリプトがセッション・ストレージ領域にアクセスする時にはブロックされることとなります。)
他の (より効率がよいかもしれないがより複雑であろう) 実装戦略は、
楽観的取引的スクリプト実行を使うというものです。
この仕様書は、前記の要件が満たされる限りにおいて、
いかなる実装戦略をも要求しません。
#pattern
* Database storage
#ja
$1 データベース・ストレージ
#pattern
* Databases
#ja
$1 データベース
#en
Each origin has an associated set of
databases. Each database has a name and a current version. There is no way
to enumerate or delete the databases available for a domain from this API.
#ja
各起源は、それに関連付けられたデータベースの集合を持ちます。
各データベースは、名前と現在の版を持ちます。
この API を使ってあるドメインに利用可能なデータベースを列挙したり、
削除したりする方法はありません。
#en
Each database has one version at a time, a database can't
exist in multiple versions at once. Versions are intended to allow authors
to manage schema changes incrementally and non-destructively, and without
running the risk of old code (e.g. in another browser window) trying to
write to a database with incorrect assumptions.
#ja
各データベースはある時点で1つの版を持ち、
1つのデータベースの複数の版が同時に存在することはできません。
版は著者がスキーマの変更を随時、非破壊的に、
かつ古い符号 (例えば他のブラウザ窓中のもの)
が誤った仮定の下でデータベースに書き込もうとする危険なしで行えるようにすることを意図したものです。
#en
The openDatabase() method returns a
Database object. The method takes
four arguments: a database name, a database version, a display name, and
an estimated size, in bytes, of the data that will be stored in the
database.
#ja
openDatabase()
メソッドは
Database
オブジェクトを返します。
このメソッドは、データベース名、データベース版、
表示名、データベース中に蓄積されるデータの大きさの見積もり (バイト単位)
の4つの引数を取ります。
#en
The openDatabase() method must use and create
databases from the origin of the active document of the browsing
context of the Window object on
which the method was invoked.
#ja
openDatabase()
メソッドは、それが呼び出された Window
オブジェクトの閲覧文脈の活性文書の起源からのデータベースを使用・作成しなければ[[MUST:なりません]]。
#en
If the database version provided is not the empty string, and the
database already exists but has a different version, then the method must
raise an INVALID_STATE_ERR exception.
#ja
指定されたデータベースの版が空文字列でない場合で、
データベースが既に存在し、
異なる版を持つ場合、
メソッドは
INVALID_STATE_ERR
例外を発生させなければ[[MUST:なりません]]。
#en
The user agent may also raise a security
exception in case the request violates a policy decision (e.g. if the
user agent is configured to not allow the page to open databases).
#ja
利用者エージェントは、要求が方針決定に反する場合
(例えば、頁がデータベースを開くことを認めないように利用者エージェントが設定されている場合)
、
保安性例外を発生させても[[MAY:構いません]]。
#en
Otherwise, if the database version provided is the empty string, or if
the database doesn't yet exist, or if the database exists and the version
provided to the openDatabase() method is the same as the
current version associated with the database, then the method must return
a Database object representing the
database that has the name that was given. If no such database exists, it
must be created first.
#ja
そうでない場合、指定されたデータベースの版が空文字列の場合、
またはデータベースがまだ存在しない場合、
またはデータベースが存在し、 openDatabase()
メソッドに指定されて版がデータベースに関連付けられている現在の版と同じである場合には、
メソッドは、指定された名前を持つデータベースを表す
Database
オブジェクトを返さなければ[[MUST:なりません]]。
そのようなデータベースが存在しない場合、
まずそれを作らなければ[[MUST:なりません]]。
#en
All strings including the empty string are valid database names.
Database names must be compared in a case-sensitive manner.
#ja
空文字列を含むすべての文字列は妥当なデータベース名です。
データベース名は大文字・小文字を区別した形で比較しなければ[[MUST:なりません]]。
#en
Implementations can support this even in environments that
only support a subset of all strings as database names by mapping database
names (e.g. using a hashing algorithm) to the supported set of names.
#ja
実装は、すべての文字列の部分集合をデータベース名として扱う環境であっても、
データベース名を対応している名前の集合に写像する
(例えばハッシュ算法を使う) ことにより、これに対応することができます。
#en
User agents are expected to use the display name and the estimated
database size to optimize the user experience. For example, a user agent
could use the estimated size to suggest an initial quota to the user. This
allows a site that is aware that it will try to use hundreds of megabytes
to declare this upfront, instead of the user agent prompting the user for
permission to increase the quota every five megabytes.
#ja
利用者エージェントに対しては、表示名とデータベースの大きさの見積もりを、
利用者の体験の最適化のために使うことを期待しています。
例えば、利用者エージェントは、利用者に対して最初の割当量を提示するために大きさの見積もりを使うことができます。
それによって、はじめから数百メガバイトを使うであろうことがわかっているサイトがそれを予め宣言しておけば、
利用者エージェントは5メガバイト毎に割当量を増やすかどうかを利用者に問わなくてもよくなります。
#en
The transaction() method
takes one or two arguments. When called, the method must immediately
return and then asynchronously run the transaction
steps with the transaction callback being the first argument,
the error callback being the second argument, if any, the
success callback being the third argument, if any, and with no
preflight operation or postflight operation.
#ja
transaction()
メソッドは1つか2つの引数を取ります。
このメソッドは、呼び出された時、
すぐに返り、それから非同期に、
取引呼び戻しを最初の引数とし、
誤り呼び戻しを2つ目の引数があればそれとし、
成功呼び戻しを3つ目の引数があればそれとし、
飛行前操作と飛行後操作はなしとして、
取引段階を走らせなければ[[MUST:なりません]]。