From 5dc34f5efd4c93b7f195c4de1ee616535c190276 Mon Sep 17 00:00:00 2001
From: "Michael[tm] Smith" The second storage mechanism is designed for storage that spans multiple windows, and lasts
- beyond the current session. In particular, Web applications may wish to store megabytes of user
+ beyond the current session. In particular, Web applications might wish to store megabytes of user
data, such as entire user-authored documents or a user's mailbox, on the client side for
performance reasons.Storage
interface can all be associated with the same list of
key/value pairs simultaneously.
length
length
Returns the number of key/value pairs currently present in the list associated with the + object.
+key
( n )key
( n )Returns the name of the nth key in the list, or null if n is greater + than or equal to the number of key/value pairs in the object
+getItem
( key )getItem
( key )Returns the current value associated with the given key, or null if the given + key does not exist in the list associated with the object.
+setItem
( key, value )setItem
( key, value )Checks if a key/value pair with the given key already exists in the list associated + with the object.
+ +If the given key does not exist, then adds a new key/value pair to the list, with + the given key and with its value set to value.
+ +If the given key does exist in the list, and its value is not + equal to value, then updates its value to value.
+ +Throws a "QuotaExceededError
" DOMException
exception
+ if the new value couldn't be set. (Setting could fail if, e.g., the user has disabled storage
+ for the site, or if the quota has been exceeded.)
removeItem
( key )removeItem
( key )Removes the key/value pair with the given key from the list associated with the + object, if a key/value pair with the given key exists.
+clear
()clear
()Empties the list associated with the object of all key/value pairs, if there are any.
+The length
attribute must return the number
of key/value pairs currently present in the list associated with the object.
If it couldn't set the new value, the method must throw a
- "QuotaExceededError
" DOMException
exception. (Setting could
- fail if, e.g., the user has disabled storage for the site, or if the quota has been exceeded.)
QuotaExceededError
" DOMException
exception.
The removeItem(key)
method must cause the key/value pair with the given key to be removed from the
@@ -98245,6 +98300,8 @@ interface Storage {
list associated with the object to be emptied of all key/value pairs, if there are any. If there
are none, then the method must do nothing.
When the setItem()
, removeItem()
, and clear()
methods are invoked, events are fired on the
@@ -98274,6 +98331,8 @@ interface WindowSessionStorage {
Each top-level browsing context has a unique set of session storage areas, one for each origin.
+User agents should not expire data from a browsing context's session storage areas, but may do
so when the user requests that such data be deleted, or when the UA detects that it has limited
storage space, or for security reasons. User agents should always avoid deleting data while a
@@ -98312,6 +98371,8 @@ interface WindowSessionStorage {
Window
object's sessionStorage
attribute's
Storage
object is associated with the same storage area, other than x, send a storage notification.
localStorage
attributeUser agents must have a set of local storage areas, one for each origin.
User agents should expire data from the local storage areas only for security reasons or when
@@ -98368,6 +98431,8 @@ interface WindowLocalStorage {
Window
object's localStorage
attribute's
Storage
object is associated with the same storage area, other than x, send a storage notification.
+
The localStorage
attribute provides
access to shared state. This specification does not define the interaction with other browsing
contexts in a multiprocess user agent, and authors are encouraged to assume that there is no
@@ -98380,9 +98445,11 @@ interface WindowLocalStorage {
storage
eventThe storage
event is fired on a Document
's
- Window
object when a storage area changes, as described in the previous two sections
- (for session storage, for local
- storage).
Window
object when a storage area changes, as described in the previous
+ two sections (for session storage, for local storage).
+
+ When a user agent is to send a storage notification for a Document
, the
user agent must queue a task to fire an
@@ -98418,6 +98485,8 @@ interface WindowLocalStorage {
Document
that represents the same kind of Storage
area as was affected
(i.e. session or local).
StorageEvent
interfacekey
Returns the key being changed.
+oldValue
Returns the old value of the key being changed.
+newValue
Returns the new value of the key being changed.
+url
Returns the URL of the document whose key changed.
+storageArea
Returns the Storage
object that was affected.
The key
attribute must return the value
it was initialized to. It represents the key being changed.
To this end, user agents should ensure that when deleting data, it is promptly deleted from the underlying storage.
+The two primary risks when implementing these persistent storage features are letting hostile @@ -98640,6 +98749,8 @@ dictionary StorageEventInit : EventInit { important for user security.
+Storage
instead of s
---
source | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/source b/source
index 0001a1009fc..5c67b769020 100755
--- a/source
+++ b/source
@@ -98199,29 +98199,25 @@ interface Storage {
length
length
Storage
. length
Returns the number of key/value pairs currently present in the list associated with the object.
key
( n )key
( n )Storage
. key
( n )Returns the name of the nth key in the list, or null if n is greater than or equal to the number of key/value pairs in the object
getItem
( key )getItem
( key )Storage
. getItem
( key )Returns the current value associated with the given key, or null if the given key does not exist in the list associated with the object.
setItem
( key, value )setItem
( key, value )Storage
. setItem
( key, value )Checks if a key/value pair with the given key already exists in the list associated with the object.
@@ -98236,15 +98232,13 @@ interface Storage { if the new value couldn't be set. (Setting could fail if, e.g., the user has disabled storage for the site, or if the quota has been exceeded.) -removeItem
( key )removeItem
( key )Storage
. removeItem
( key )Removes the key/value pair with the given key from the list associated with the object, if a key/value pair with the given key exists.
clear
()clear
()Storage
. clear
()Empties the list associated with the object of all key/value pairs, if there are any.
Storage
. key
( n )Returns the name of the nth key in the list, or null if n is greater - than or equal to the number of key/value pairs in the object
+ than or equal to the number of key/value pairs in the object.Storage
. getItem
( key )Storage
. setItem
( key, value )Checks if a key/value pair with the given key already exists in the list associated - with the object.
- -If the given key does not exist, then adds a new key/value pair to the list, with - the given key and with its value set to value.
- -If the given key does exist in the list, and its value is not - equal to value, then updates its value to value.
+Sets the value of the pair identified by key to value, creating a new + key/value pair if none existed for key previously.
Throws a " While creating a new browsing context, the session storage area is sometimes copied over. When the Each top-level browsing context has a unique set of session storage areas, one for
each origin. User agents should not expire data from a browsing context's session storage areas, but may do
so when the user requests that such data be deleted, or when the UA detects that it has limited
storage space, or for security reasons. User agents should always avoid deleting data while a
@@ -98329,6 +98327,8 @@ interface WindowSessionStorage {
be discarded with it, as the API described in this specification provides no way for that data to
ever be subsequently retrieved. The lifetime of a browsing context can be unrelated to the lifetime of the actual
user agent process itself, as the user agent can support resuming sessions after a restart. Returns the Throws a " User agents must have a set of local storage areas, one for each origin. The user agent may throw a " If the request violates a policy decision (e.g. if the user agent is configured to not
+ allow the page to persist data), the user agent may throw a
+ " If the Returns the key being changed. Returns the key of the storage item being changed. Returns the old value of the key being changed. Returns the old value of the key of the storage item whose value is being changed. Returns the new value of the key being changed. Returns the new value of the key of the storage item whose value is being changed. Returns the URL of the document whose key changed. Returns the URL of the document whose storage item changed. The The The The The The When the The The The Returns the number of key/value pairs currently present in the list associated with the
object. Returns the name of the nth key in the list, or null if n is greater
than or equal to the number of key/value pairs in the object. Returns the current value associated with the given key, or null if the given
key does not exist in the list associated with the object. Sets the value of the pair identified by key to value, creating a new
key/value pair if none existed for key previously. Removes the key/value pair with the given key from the list associated with the
object, if a key/value pair with the given key exists. Empties the list associated with the object of all key/value pairs, if there are any. Returns the current value associated with the given key, or null if the given
key does not exist in the list associated with the object. Removes the key/value pair with the given key from the list associated with the
object, if a key/value pair with the given key exists. The Returns the Each top-level browsing context has a unique set of session storage areas, one for
each origin. The While creating a new browsing context, the session storage area is sometimes copied over.QuotaExceededError
" DOMException
exception
if the new value couldn't be set. (Setting could fail if, e.g., the user has disabled storage
From 3d64cce611840e17b7f8afee491dd4fd046a2ea3 Mon Sep 17 00:00:00 2001
From: "Michael[tm] Smith" setItem()
, removeItem()
, and clear()
methods are called on a Storage
object x that is associated with a session storage area, if the methods did not throw an
@@ -98359,8 +98361,6 @@ interface WindowSessionStorage {
Window
object's sessionStorage
attribute's
Storage
object is associated with the same storage area, other than x, send a storage notification.The
From 7c36915c111c80556b7349d4a284ba6bfe313550 Mon Sep 17 00:00:00 2001
From: "Michael[tm] Smith" localStorage
attributeStorage
object that was
affected.
+ Disk space
@@ -98678,6 +98680,7 @@ dictionary StorageEventInit : EventInit {
user-specific data (e.g. user-agent headers and configuration settings) to combine separate
sessions into coherent user profiles.
+ Sensitivity of data
From ecd5178dd2b9389334f30337cf8f31ec1b061267 Mon Sep 17 00:00:00 2001
From: "Michael[tm] Smith"
+
+
localStorage
Storage
object associated with that origin's local storage
+ area.SecurityError
" DOMException
if the
+ Document
's origin is an opaque
+ origin or if the request violates a policy decision (e.g. if the user agent is
+ configured to not allow the page to persist data).
-
+ SecurityError
"
- DOMException
instead of returning a Storage
- object if the request violates a policy decisions (e.g. if the user agent is configured to not
- allow the page to persist data).SecurityError
" DOMException
instead of returning a
+ Storage
objectDocument
's origin is an opaque origin, then throw a
From 269ac43c78b909cebd4d57bff4432fdb6b33cb84 Mon Sep 17 00:00:00 2001
From: "Michael[tm] Smith" key
oldValue
newValue
url
storageArea
key
attribute must return the value
- it was initialized to. It represents the key being changed.oldValue
attribute must return
- the value it was initialized to. It represents the old value of the key being changed.newValue
attribute must return
- the value it was initialized to. It represents the new value of the key being changed.url
attribute must return the value
- it was initialized to. It represents the URL of the document whose key changed.storageArea
attribute must
- return the value it was initialized to. It represents the Storage
object that was
- affected.key
, oldValue
, newValue
, url
, and storageArea
attributes must return the values
+ they were initialized to.Storage
object x that is associated with a session storage area, if the methods did not throw an
exception or "do nothing" as defined above, then for every Document
object whose
Window
object's sessionStorage
attribute's
- Storage
object is associated with the same storage area, other than x, send a storage notification.Storage
object is associated with the same storage area, other than x,
+ user agents send a storage notification.
The
@@ -98424,14 +98425,15 @@ interface WindowLocalStorage {
localStorage
attributesetItem()
, removeItem()
, and clear()
methods are called on a Storage
object x that is associated with a local storage area, if the methods did not throw an
exception or "do nothing" as defined above, then for every Document
object whose
Window
object's localStorage
attribute's
- Storage
object is associated with the same storage area, other than x, send a storage notification.
-
- Storage
object is associated with the same storage area, other than x,
+ user agents send a storage notification.
localStorage
attribute provides
access to shared state. This specification does not define the interaction with other browsing
@@ -98444,10 +98446,11 @@ interface WindowLocalStorage {
The
- storage
eventstorage
event is fired on a Document
's
- Window
object when a storage area changes, as described in the previous
- two sections (for session storage, for local storage).storage
event is fired on a Document
's
+ Window
object when a storage area changes, as described in the previous two
+ sections (for session storage, for
+ local storage).eval()
functiontypeof
operatordelete
operator
-
Storage
. length
length
Storage
. key
( n )key
( n )Storage
. getItem
( key )getItem
( key )Storage
. setItem
( key, value )setItem
( key, value )Storage
. removeItem
( key )removeItem
( key )delete
storage[key]Storage
. clear
()clear
()getItem
( key )getItem
( key )removeItem
( key )delete
storage[key]delete
storage[key]sessionStorage
attribute represents the
set of storage areas specific to the current top-level browsing context.
+
+
sessionStorage
Storage
object associated with that origin's session storage
+ area.sessionStorage
attribute must return a
Storage
object associated with the Document
's assigned session storage
- area, if any, or null if there isn't one. Each Document
object must have a separate
- object for its Window
's sessionStorage
- attribute.Document
object must have a separate object for its Window
's
+ sessionStorage
attribute.