- From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 14 Aug 2009 23:08:18 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/webstorage In directory hutz:/tmp/cvs-serv29642 Modified Files: Overview.html Log Message: flush various formatting changes (whatwg r3624) Index: Overview.html =================================================================== RCS file: /sources/public/html5/webstorage/Overview.html,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- Overview.html 11 Aug 2009 07:25:54 -0000 1.62 +++ Overview.html 14 Aug 2009 23:08:16 -0000 1.63 @@ -1,6 +1,4 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- when publishing, change bits marked ZZZ --><html lang="en-US-x-Hixie"> - <title>Web Storage</title> - <style type="text/css"> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- when publishing, change bits marked ZZZ --><html lang="en-US-x-Hixie"><title>Web Storage</title><style type="text/css"> pre { margin-left: 2em; white-space: pre-wrap; } h2 { margin: 3em 0 1em 0; } h3 { margin: 2.5em 0 1em 0; } @@ -171,23 +169,17 @@ ul.domTree .t7 code, .domTree .t8 code { color: green; } ul.domTree .t10 code { color: teal; } - </style> - <link href="http://www.w3.org/StyleSheets/TR/W3C-ED" rel="stylesheet" type="text/css"> <!-- ZZZ ED vs WD --> - </head> - <body> - <div class="head"> + </style><link href="http://www.w3.org/StyleSheets/TR/W3C-ED" rel="stylesheet" type="text/css"><!-- ZZZ ED vs WD --><div class="head"> <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>Web Storage</h1> <!--ZZZ:--> <!--<h2 class="no-num no-toc">W3C Working Draft 23 April 2009</h2>--> - <h2 class="no-num no-toc" id="editor-s-draft-date-1-january-1970">Editor's Draft 11 August 2009</h2> + <h2 class="no-num no-toc" id="editor-s-draft-date-1-january-1970">Editor's Draft 14 August 2009</h2> <!--:ZZZ--> - <dl> -<!-- ZZZ: update the month/day (twice), (un)comment out + <dl><!-- ZZZ: update the month/day (twice), (un)comment out <dt>This Version:</dt> <dd><a href="http://www.w3.org/TR/2009/WD-webstorage-20090423/">http://www.w3.org/TR/2009/WD-webstorage-20090423/</a></dd> - :ZZZ --> - <dt>Latest Published Version:</dt> + :ZZZ --><dt>Latest Published Version:</dt> <dd><a href="http://www.w3.org/TR/webstorage/">http://www.w3.org/TR/webstorage/</a></dd> <dt>Latest Editor's Draft:</dt> <dd><a href="http://dev.w3.org/html5/webstorage/">http://dev.w3.org/html5/webstorage/</a></dd> @@ -197,39 +189,22 @@ <!-- :ZZZ --> <dt>Editors:</dt> <dd><a href="mailto:ian@hixie.ch">Ian Hickson</a>, Google, Inc.</dd> - </dl> - <p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> - © 2009 <a href="http://www.w3.org/"><abbr title="World Wide - Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts + </dl><p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> + © 2009 <a href="http://www.w3.org/"><abbr title="World Wide + Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.org/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p> - </div> - - <hr class="top"> - - <h2 class="no-num no-toc" id="abstract">Abstract</h2> - - <p>This specification defines an API for persistent data storage of - key-value pair data in Web clients.</p> - - - <h2 class="no-num no-toc" id="status-of-this-document">Status of this document</h2> - - <!-- intro boilerplate (required) --> - <p><em>This section describes the status of this document at the + </div><hr class="top"><h2 class="no-num no-toc" id="abstract">Abstract</h2><p>This specification defines an API for persistent data storage of + key-value pair data in Web clients.<h2 class="no-num no-toc" id="status-of-this-document">Status of this document</h2><!-- intro boilerplate (required) --><p><em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the most recently formally published revision of this technical report can be found in the <a href="http://www.w3.org/TR/">W3C technical reports index</a> - at http://www.w3.org/TR/.</em></p> - - - <!-- where to send feedback (required) --> - <p>If you wish to make comments regarding this document, please send + at http://www.w3.org/TR/.</em></p><!-- where to send feedback (required) --><p>If you wish to make comments regarding this document, please send them to <a href="mailto:public-webapps@w3.org">public-webapps@w3.org</a> (<a href="mailto:public-webapps-request@w3.org?subject=subscribe">subscribe</a>, <a href="http://lists.w3.org/Archives/Public/public-webapps/">archives</a>) @@ -242,73 +217,40 @@ or submit them using <a href="http://www.w3.org/Bugs/Public/enter_bug.cgi?product=WebAppsWG&component=Web%20Storage">our public bug database</a>. - All feedback is welcome.</p> - - - <!-- stability (required) --> - <p>Implementors should be aware that this specification is not + All feedback is welcome.</p><!-- stability (required) --><p>Implementors should be aware that this specification is not stable. <strong>Implementors who are not taking part in the discussions are likely to find the specification changing out from under them in incompatible ways.</strong> Vendors interested in implementing this specification before it eventually reaches the Candidate Recommendation stage should join the aforementioned - mailing lists and take part in the discussions.</p> - - - <!-- version history or list of changes (required) --> - - <p>The latest stable version of the editor's draft of this + mailing lists and take part in the discussions.</p><!-- version history or list of changes (required) --><p>The latest stable version of the editor's draft of this specification is always available on <a href="http://dev.w3.org/html5/webstorage/Overview.html">the W3C CVS server</a>. Change tracking for this document is available at the - following location:</p> - - <ul> - <li>CVS log: <a href="http://dev.w3.org/cvsweb/html5/webstorage/Overview.html">http://dev.w3.org/cvsweb/html5/webstorage/Overview.html</a></li> - </ul> - - <!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --> - <!-- relationship to other work (required) --> - <p>This specification is automatically generated from the + following location:<ul><li>CVS log: <a href="http://dev.w3.org/cvsweb/html5/webstorage/Overview.html">http://dev.w3.org/cvsweb/html5/webstorage/Overview.html</a></li> + </ul><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- relationship to other work (required) --><p>This specification is automatically generated from the corresponding section in the HTML5 specification's source document, as hosted in the <a href="http://svn.whatwg.org/webapps/">WHATWG Subversion repository</a>. Detailed change history for all of HTML5, including the parts that form this specification, can be found at - the following locations:</p> - <!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --> - - <!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING LIST TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --> - <ul> - <li>Twitter messages (non-editorial changes only): <a href="http://twitter.com/WHATWG">http://twitter.com/WHATWG</a></li> + the following locations:</p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING LIST TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><ul><li>Twitter messages (non-editorial changes only): <a href="http://twitter.com/WHATWG">http://twitter.com/WHATWG</a></li> <li>Interactive Web interface: <a href="http://html5.org/tools/web-apps-tracker">http://html5.org/tools/web-apps-tracker</a></li> <li>Commit-Watchers mailing list: <a href="http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org">http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org</a></li> <li>Subversion interface: <a href="http://svn.whatwg.org/webapps/">http://svn.whatwg.org/webapps/</a></li> - </ul> - <!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING LIST TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --> - - - <!-- status of document, group responsible (required) --> - <p>The W3C <a href="http://www.w3.org/2008/webapps/">Web Apps + </ul><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING LIST TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- status of document, group responsible (required) --><p>The W3C <a href="http://www.w3.org/2008/webapps/">Web Apps Working Group</a> is the W3C working group responsible for this specification's progress along the W3C Recommendation track. <!--ZZZ:--> <!--This specification is the 23 April 2009 Working Draft.--> - This specification is the 11 August 2009 Editor's Draft. + This specification is the 14 August 2009 Editor's Draft. <!--:ZZZ--> - </p> - - - <!-- required patent boilerplate --> - <p>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 + </p><!-- required patent boilerplate --><p>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>. W3C maintains a <a href="http://www.w3.org/2004/01/pp-impl/42538/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section - 6 of the W3C Patent Policy</a>.</p> - - <h2 class="no-num no-toc" id="contents">Table of contents</h2> - + 6 of the W3C Patent Policy</a>.<h2 class="no-num no-toc" id="contents">Table of contents</h2> <!--begin-toc--> <ol class="toc"> <li><a href="#introduction"><span class="secno">1 </span>Introduction</a></li> @@ -336,34 +278,20 @@ <li><a href="#cross-directory-attacks"><span class="secno">7.2 </span>Cross-directory attacks</a></li> <li><a href="#implementation-risks"><span class="secno">7.3 </span>Implementation risks</a></ol></li> <li><a class="no-num" href="#references">References</a></ol> -<!--end-toc--> - <hr> - <h2 id="introduction"><span class="secno">1 </span>Introduction</h2> - - <p><i>This section is non-normative.</i></p> - - <p>This specification introduces two related mechanisms, similar to +<!--end-toc--><hr><h2 id="introduction"><span class="secno">1 </span>Introduction</h2><p><i>This section is non-normative.</i><p>This specification introduces two related mechanisms, similar to HTTP session cookies, for storing structured data on the client - side. <a href="#refsRFC2109">[RFC2109]</a> <a href="#refsCOOKIES">[COOKIES]</a></p> - - <p>The first is designed for scenarios where the user is carrying + side. <a href="#refsRFC2109">[RFC2109]</a> <a href="#refsCOOKIES">[COOKIES]</a><p>The first is designed for scenarios where the user is carrying out a single transaction, but could be carrying out multiple - transactions in different windows at the same time.</p> - - <p>Cookies don't really handle this case well. For example, a user + transactions in different windows at the same time.<p>Cookies don't really handle this case well. For example, a user could be buying plane tickets in two different windows, using the same site. If the site used cookies to keep track of which ticket the user was buying, then as the user clicked from page to page in both windows, the ticket currently being purchased would "leak" from one window to the other, potentially causing the user to buy two - tickets for the same flight without really noticing.</p> - - <p>To address this, this specification introduces the <code title="dom-sessionStorage"><a href="#dom-sessionstorage">sessionStorage</a></code> DOM attribute. + tickets for the same flight without really noticing.<p>To address this, this specification introduces the <code title="dom-sessionStorage"><a href="#dom-sessionstorage">sessionStorage</a></code> DOM attribute. Sites can add data to the session storage, and it will be accessible - to any page from the same site opened in that window.</p> <!-- we're - not using xrefs here because this is just an intro --> - - <div class="example"> + to any page from the same site opened in that window.</p><!-- we're + not using xrefs here because this is just an intro --><div class="example"> <p>For example, a page could have a checkbox that the user ticks to indicate that he wants insurance:</p> @@ -381,9 +309,7 @@ <p>If the user had multiple windows opened on the site, each one would have its own individual copy of the session storage object.</p> - </div> - - <!-- + </div><!-- sessionStorage.flightDeparture = 'OSL'; sessionStorage.flightArrival = 'NYC'; @@ -395,21 +321,13 @@ sessionStorage[documents] = {}; sessionStorage[documents][filename] = <document/>; - --> - - <p>The second storage mechanism is designed for storage that spans + --><p>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 data, such as entire user-authored documents or a user's mailbox, on - the client side for performance reasons.</p> - - <p>Again, cookies do not handle this case well, because they are - transmitted with every request.</p> - - <p>The <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> DOM - attribute is used to access a page's local storage area.</p> - - <div class="example"> + the client side for performance reasons.<p>Again, cookies do not handle this case well, because they are + transmitted with every request.<p>The <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> DOM + attribute is used to access a page's local storage area.<div class="example"> <p>The site at example.com can display a count of how many times the user has loaded its page by putting the following at the bottom @@ -431,63 +349,30 @@ dealing with numbers (integers in this case) because the storage APIs are all string-based.</p> - </div> - - <p>Each site has its own separate storage area.</p> - - <p>Storage areas (both session storage and local storage) store + </div><p>Each site has its own separate storage area.<p>Storage areas (both session storage and local storage) store strings. To store structured data in a storage area, you must first - convert it to a string.</p> - - - - - - <h2 id="conformance-requirements"><span class="secno">2 </span>Conformance requirements</h2> - - <p>All diagrams, examples, and notes in this specification are + convert it to a string.<h2 id="conformance-requirements"><span class="secno">2 </span>Conformance requirements</h2><p>All diagrams, examples, and notes in this specification are non-normative, as are all sections explicitly marked non-normative. - Everything else in this specification is normative.</p> - - <p>The key words "MUST", "MUST NOT", "REQUIRED", <!--"SHALL", "SHALL + Everything else in this specification is normative.<p>The key words "MUST", "MUST NOT", "REQUIRED", <!--"SHALL", "SHALL NOT",--> "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this document are to be interpreted as described in RFC2119. For readability, these words do - not appear in all uppercase letters in this specification. <a href="#refsRFC2119">[RFC2119]</a></p> - - <p>Requirements phrased in the imperative as part of algorithms + not appear in all uppercase letters in this specification. <a href="#refsRFC2119">[RFC2119]</a><p>Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or "return false and abort these steps") are to be interpreted with the meaning of the key word ("must", "should", "may", etc) used in introducing the - algorithm.</p> - - <p>Some conformance requirements are phrased as requirements on + algorithm.<p>Some conformance requirements are phrased as requirements on attributes, methods or objects. Such requirements are to be - interpreted as requirements on user agents.</p> - - <p>Conformance requirements phrased as algorithms or specific steps + interpreted as requirements on user agents.<p>Conformance requirements phrased as algorithms or specific steps may be implemented in any manner, so long as the end result is equivalent. (In particular, the algorithms defined in this specification are intended to be easy to follow, and not intended to - be performant.)</p> - - <p>The only conformance class defined by this specification is user - agents.</p> - - <p>User agents may impose implementation-specific limits on + be performant.)<p>The only conformance class defined by this specification is user + agents.<p>User agents may impose implementation-specific limits on otherwise unconstrained inputs, e.g. to prevent denial of service attacks, to guard against running out of memory, or to work around - platform-specific limitations.</p> - - - <h3 id="dependencies"><span class="secno">2.1 </span>Dependencies</h3> - - <p>This specification relies on several other underlying - specifications.</p> - - <dl> - - <dt>HTML5</dt> + platform-specific limitations.<h3 id="dependencies"><span class="secno">2.1 </span>Dependencies</h3><p>This specification relies on several other underlying + specifications.<dl><dt>HTML5</dt> <dd> @@ -505,76 +390,46 @@ </dd> - </dl> - - - <h2 id="terminology"><span class="secno">3 </span>Terminology</h2> - - <p>The construction "a <code title="">Foo</code> object", where + </dl><h2 id="terminology"><span class="secno">3 </span>Terminology</h2><p>The construction "a <code title="">Foo</code> object", where <code title="">Foo</code> is actually an interface, is sometimes used instead of the more accurate "an object implementing the - interface <code title="">Foo</code>".</p> - - <p>The term DOM is used to refer to the API set made available to + interface <code title="">Foo</code>".<p>The term DOM is used to refer to the API set made available to scripts in Web applications, and does not necessarily imply the existence of an actual <code>Document</code> object or of any other <code>Node</code> objects as defined in the DOM Core - specifications. <a href="#refsDOMCORE">[DOMCORE]</a></p> - - <p>A DOM attribute is said to be <em>getting</em> when its value is + specifications. <a href="#refsDOMCORE">[DOMCORE]</a><p>A DOM attribute is said to be <em>getting</em> when its value is being retrieved (e.g. by author script), and is said to be - <em>setting</em> when a new value is assigned to it.</p> - - <p>The term "JavaScript" is used to refer to ECMA262, rather than + <em>setting</em> when a new value is assigned to it.<p>The term "JavaScript" is used to refer to ECMA262, rather than the official term ECMAScript, since the term JavaScript is more - widely known. <a href="#refsECMA262">[ECMA262]</a></p> - - - <h2 id="storage"><span class="secno">4 </span>The API</h2> - - <h3 id="the-storage-interface"><span class="secno">4.1 </span>The <code><a href="#storage-0">Storage</a></code> interface</h3> - - <pre class="idl">interface <dfn id="storage-0">Storage</dfn> { + widely known. <a href="#refsECMA262">[ECMA262]</a><h2 id="storage"><span class="secno">4 </span>The API</h2><h3 id="the-storage-interface"><span class="secno">4.1 </span>The <code><a href="#storage-0">Storage</a></code> interface</h3><pre class="idl">interface <dfn id="storage-0">Storage</dfn> { readonly attribute unsigned long <a href="#dom-storage-length" title="dom-Storage-length">length</a>; getter any <a href="#dom-storage-key" title="dom-Storage-key">key</a>(in unsigned long index); getter any <a href="#dom-storage-getitem" title="dom-Storage-getItem">getItem</a>(in DOMString key); setter creator void <a href="#dom-storage-setitem" title="dom-Storage-setItem">setItem</a>(in DOMString key, in any data); deleter void <a href="#dom-storage-removeitem" title="dom-Storage-removeItem">removeItem</a>(in DOMString key); void <a href="#dom-storage-clear" title="dom-Storage-clear">clear</a>(); -};</pre> - - <!-- v2 ideas: +};</pre><!-- v2 ideas: a getInfo() method that returns an object that tells you: - when the key was added - when the key was last modified - which page was the last to modify the key [-Mihai Sucan] - --> - - <p>Each <code><a href="#storage-0">Storage</a></code> object provides access to a list of + --><p>Each <code><a href="#storage-0">Storage</a></code> object provides access to a list of key/value pairs, which are sometimes called items. Keys are strings. Any string (including the empty string) is a valid key. Values can be any data type supported by the <span>structured - clone</span> algorithm.</p> - - <p>Each <code><a href="#storage-0">Storage</a></code> object is associated with a list of + clone</span> algorithm.<p>Each <code><a href="#storage-0">Storage</a></code> object is associated with a list of key/value pairs when it is created, as defined in the sections on the <code title="dom-sessionStorage"><a href="#dom-sessionstorage">sessionStorage</a></code> and <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> attributes. Multiple separate objects implementing the <code><a href="#storage-0">Storage</a></code> interface can all be associated with the same list of key/value pairs - simultaneously.</p> - - <p>The object's <span>indices of the supported indexed + simultaneously.<p>The object's <span>indices of the supported indexed properties</span> are the numbers in the range zero to one less than the number of key/value pairs currently present in the list associated with the object. If the list is empty, then there are no - <span>supported indexed properties</span>.</p> - - <p>The <dfn id="dom-storage-length" title="dom-Storage-length"><code>length</code></dfn> + <span>supported indexed properties</span>.<p>The <dfn id="dom-storage-length" title="dom-Storage-length"><code>length</code></dfn> attribute must return the number of key/value pairs currently - present in the list associated with the object.</p> - - <p>The <dfn id="dom-storage-key" title="dom-Storage-key"><code>key(<var title="">n</var>)</code></dfn> method must return the name of the + present in the list associated with the object.<p>The <dfn id="dom-storage-key" title="dom-Storage-key"><code>key(<var title="">n</var>)</code></dfn> method must return the name of the <var title="">n</var>th key in the list. The order of keys is user-agent defined, but must be consistent within an object so long as the number of keys doesn't change. (Thus, <a href="#dom-storage-setitem" title="dom-Storage-setItem">adding</a> or <a href="#dom-storage-removeitem" title="dom-Storage-removeItem">removing</a> a key may change the @@ -584,92 +439,55 @@ now for clarity, but if people ask, put it back. this is part of the spec.]--> If <var title="">n</var> is <!--less than zero or [can't, unsigned]--> greater than or equal to the number of key/value pairs - in the object, then this method must return null.</p> - - <p>The <span>names of the supported named properties</span> on a + in the object, then this method must return null.<p>The <span>names of the supported named properties</span> on a <code><a href="#storage-0">Storage</a></code> object are the keys of each key/value pair - currently present in the list associated with the object.</p> - - <p>The <dfn id="dom-storage-getitem" title="dom-Storage-getItem"><code>getItem(<var title="">key</var>)</code></dfn> method must return a + currently present in the list associated with the object.<p>The <dfn id="dom-storage-getitem" title="dom-Storage-getItem"><code>getItem(<var title="">key</var>)</code></dfn> method must return a <span>structured clone</span> of the current value associated with the given <var title="">key</var>. If the given <var title="">key</var> does not exist in the list associated with the - object then this method must return null.</p> - - <p>The <dfn id="dom-storage-setitem" title="dom-Storage-setItem"><code>setItem(<var title="">key</var>, <var title="">value</var>)</code></dfn> method + object then this method must return null.<p>The <dfn id="dom-storage-setitem" title="dom-Storage-setItem"><code>setItem(<var title="">key</var>, <var title="">value</var>)</code></dfn> method must first create a <span>structured clone</span> of the given <var title="">value</var>. If this raises an exception, then the exception must be thrown and the list associated with the object is left unchanged. If constructing the stuctured clone would involve constructing a new <code>ImageData</code> object, then throw a - <code>NOT_SUPPORTED_ERR</code> exception instead.</p> - - <!-- ImageData isn't supported because reading such objects is + <code>NOT_SUPPORTED_ERR</code> exception instead.</p><!-- ImageData isn't supported because reading such objects is synchronous, and getData() is synchronous, and therefore if the stored data is in deep storage, it would be very painful to have a script grab the value and immediately try to read the image - data. --> - - <p>Otherwise, the user agent must then check if a key/value pair + data. --><p>Otherwise, the user agent must then check if a key/value pair with the given <var title="">key</var> already exists in the list - associated with the object.</p> - - <p>If it does not, then a new key/value pair must be added to the + associated with the object.<p>If it does not, then a new key/value pair must be added to the list, with the given <var title="">key</var> and with its value set - to the newly obtained clone of <var title="">value</var>.</p> - - <p>If the given <var title="">key</var> <em>does</em> exist in the + to the newly obtained clone of <var title="">value</var>.<p>If the given <var title="">key</var> <em>does</em> exist in the list, then it must have its value updated to the newly obtained - clone of <var title="">value</var>.</p> - - <p>If it couldn't set the new value, the method must raise an + clone of <var title="">value</var>.<p>If it couldn't set the new value, the method must raise an <code>QUOTA_EXCEEDED_ERR</code> exception. (Setting could fail if, e.g., the user has disabled storage for the site, or if the quota - has been exceeded.)</p> - - <p>The <dfn id="dom-storage-removeitem" title="dom-Storage-removeItem"><code>removeItem(<var title="">key</var>)</code></dfn> method must cause the key/value + has been exceeded.)<p>The <dfn id="dom-storage-removeitem" title="dom-Storage-removeItem"><code>removeItem(<var title="">key</var>)</code></dfn> method must cause the key/value pair with the given <var title="">key</var> to be removed from the list associated with the object, if it exists. If no item with that - key exists, the method must do nothing.</p> - - <p>The <code title="dom-Storage-setItem"><a href="#dom-storage-setitem">setItem()</a></code> and <code title="dom-Storage-removeItem"><a href="#dom-storage-removeitem">removeItem()</a></code> methods must be + key exists, the method must do nothing.<p>The <code title="dom-Storage-setItem"><a href="#dom-storage-setitem">setItem()</a></code> and <code title="dom-Storage-removeItem"><a href="#dom-storage-removeitem">removeItem()</a></code> methods must be atomic with respect to failure. In the case of failure, the method does nothing. That is, changes to the data storage area must either be successful, or the data storage area must not be changed at - all.</p> - - <p>The <dfn id="dom-storage-clear" title="dom-Storage-clear"><code>clear()</code></dfn> + all.<p>The <dfn id="dom-storage-clear" title="dom-Storage-clear"><code>clear()</code></dfn> method must atomically cause the 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.</p> - - <p class="note">When the <code title="dom-Storage-setItem"><a href="#dom-storage-setitem">setItem()</a></code>, <code title="dom-Storage-removeItem"><a href="#dom-storage-removeitem">removeItem()</a></code>, and <code title="dom-Storage-clear"><a href="#dom-storage-clear">clear()</a></code> methods are invoked, events + none, then the method must do nothing.<p class="note">When the <code title="dom-Storage-setItem"><a href="#dom-storage-setitem">setItem()</a></code>, <code title="dom-Storage-removeItem"><a href="#dom-storage-removeitem">removeItem()</a></code>, and <code title="dom-Storage-clear"><a href="#dom-storage-clear">clear()</a></code> methods are invoked, events are fired on other <code>HTMLDocument</code> objects that can access the newly stored or removed data, as defined in the sections on the - <code title="dom-sessionStorage"><a href="#dom-sessionstorage">sessionStorage</a></code> and <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> attributes.</p> <!-- + <code title="dom-sessionStorage"><a href="#dom-sessionstorage">sessionStorage</a></code> and <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> attributes.</p><!-- not normative, see the sections below for the normative statement - --> - - <p class="note">This specification does not require that the above + --><p class="note">This specification does not require that the above methods wait until the data has been physically written to disk. Only consistency in what different scripts accessing the same - underlying list of key/value pairs see is required.</p> - - - <h3 id="the-sessionstorage-attribute"><span class="secno">4.2 </span>The <code title="dom-sessionStorage"><a href="#dom-sessionstorage">sessionStorage</a></code> attribute</h3> - - <pre class="idl">[Supplemental, NoInterfaceObject] + underlying list of key/value pairs see is required.<h3 id="the-sessionstorage-attribute"><span class="secno">4.2 </span>The <code title="dom-sessionStorage"><a href="#dom-sessionstorage">sessionStorage</a></code> attribute</h3><pre class="idl">[Supplemental, NoInterfaceObject] interface <span>WindowSessionStorage</span> { readonly attribute <a href="#storage-0">Storage</a> <a href="#dom-sessionstorage" title="dom-sessionStorage">sessionStorage</a>; }; -<span>Window</span> implements <span>WindowSessionStorage</span>;</pre> - - <p>The <dfn id="dom-sessionstorage" title="dom-sessionStorage"><code>sessionStorage</code></dfn> +<span>Window</span> implements <span>WindowSessionStorage</span>;</pre><p>The <dfn id="dom-sessionstorage" title="dom-sessionStorage"><code>sessionStorage</code></dfn> attribute represents the set of storage areas specific to the - current <span>top-level browsing context</span>.</p> - - <p>Each <span>top-level browsing context</span> has a unique set of - session storage areas, one for each <span>origin</span>.</p> - - <p>User agents should not expire data from a browsing context's + current <span>top-level browsing context</span>.<p>Each <span>top-level browsing context</span> has a unique set of + session storage areas, one for each <span>origin</span>.<p>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 @@ -678,30 +496,20 @@ therefore permanently inaccessible to the user) the data stored in its session storage areas can be discarded with it, as the API described in this specification provides no way for that data to - ever be subsequently retrieved.</p> - - <p class="note">The lifetime of a browsing context can be unrelated + ever be subsequently retrieved.<p class="note">The lifetime of a browsing context can be unrelated to the lifetime of the actual user agent process itself, as the user - agent may support resuming sessions after a restart.</p> - - <p>When a new <code>HTMLDocument</code> is created, the user agent + agent may support resuming sessions after a restart.<p>When a new <code>HTMLDocument</code> is created, the user agent must check to see if the document's <span>top-level browsing context</span> has allocated a session storage area for that document's <span>origin</span>. If it has not, a new storage area - for that document's <span>origin</span> must be created.</p> - - <p>The <code title="dom-sessionStorage"><a href="#dom-sessionstorage">sessionStorage</a></code> + for that document's <span>origin</span> must be created.<p>The <code title="dom-sessionStorage"><a href="#dom-sessionstorage">sessionStorage</a></code> attribute must return the <code><a href="#storage-0">Storage</a></code> object associated with that session storage area. Each <code>Document</code> object - must have a separate object for its <code>Window</code>'s <code title="dom-sessionStorage"><a href="#dom-sessionstorage">sessionStorage</a></code> attribute.</p> - - <p>When a new <span>top-level browsing context</span> is created by + must have a separate object for its <code>Window</code>'s <code title="dom-sessionStorage"><a href="#dom-sessionstorage">sessionStorage</a></code> attribute.<p>When a new <span>top-level browsing context</span> is created by cloning an existing <span>browsing context</span>, the new browsing context must start with the same session storage areas as the original, but the two sets must from that point on be considered - separate, not affecting each other in any way.</p> - - <p>When a new <span>top-level browsing context</span> is created by + separate, not affecting each other in any way.<p>When a new <span>top-level browsing context</span> is created by a <span title="concept-script">script</span> in an existing <span>browsing context</span>, or by the user following a link in an existing browsing context, or in some other way related to a @@ -709,108 +517,69 @@ the <span>origin</span> of that <code>HTMLDocument</code> must be copied into the new browsing context when it is created. From that point on, however, the two session storage areas must be considered - separate, not affecting each other in any way.</p> - - <p id="sessionStorageEvent">When the <code title="dom-Storage-setItem"><a href="#dom-storage-setitem">setItem()</a></code>, <code title="dom-Storage-removeItem"><a href="#dom-storage-removeitem">removeItem()</a></code>, and <code title="dom-Storage-clear"><a href="#dom-storage-clear">clear()</a></code> methods are called on a + separate, not affecting each other in any way.<p id="sessionStorageEvent">When the <code title="dom-Storage-setItem"><a href="#dom-storage-setitem">setItem()</a></code>, <code title="dom-Storage-removeItem"><a href="#dom-storage-removeitem">removeItem()</a></code>, and <code title="dom-Storage-clear"><a href="#dom-storage-clear">clear()</a></code> methods are called on a <code><a href="#storage-0">Storage</a></code> object <var title="">x</var> that is associated with a session storage area, if the methods did something, then in every <code>HTMLDocument</code> object whose <code>Window</code> object's <code title="dom-sessionStorage"><a href="#dom-sessionstorage">sessionStorage</a></code> attribute's <code><a href="#storage-0">Storage</a></code> object is associated with the same - storage area, other than <var title="">x</var>, a <code title="event-storage"><a href="#event-storage">storage</a></code> event must be fired, as <a href="#event-storage" title="event-storage">described below</a>.</p> - - - <h3 id="the-localstorage-attribute"><span class="secno">4.3 </span>The <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> attribute</h3> - - <pre class="idl">[Supplemental, NoInterfaceObject] + storage area, other than <var title="">x</var>, a <code title="event-storage"><a href="#event-storage">storage</a></code> event must be fired, as <a href="#event-storage" title="event-storage">described below</a>.<h3 id="the-localstorage-attribute"><span class="secno">4.3 </span>The <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> attribute</h3><pre class="idl">[Supplemental, NoInterfaceObject] interface <span>WindowLocalStorage</span> { readonly attribute <a href="#storage-0">Storage</a> <a href="#dom-localstorage" title="dom-localStorage">localStorage</a>; }; -<span>Window</span> implements <span>WindowLocalStorage</span>;</pre> - - <p>The <dfn id="dom-localstorage" title="dom-localStorage"><code>localStorage</code></dfn> +<span>Window</span> implements <span>WindowLocalStorage</span>;</pre><p>The <dfn id="dom-localstorage" title="dom-localStorage"><code>localStorage</code></dfn> object provides a <code><a href="#storage-0">Storage</a></code> object for an - <span>origin</span>.</p> - - <p>User agents must have a set of local storage areas, one for each - <span>origin</span>.</p> - - <p>User agents should expire data from the local storage areas only + <span>origin</span>.<p>User agents must have a set of local storage areas, one for each + <span>origin</span>.<p>User agents should expire data from the local storage areas only for security reasons or when requested to do so by the user. User agents should always avoid deleting data while a script that could access that data is running. Data stored in local storage areas should be considered potentially user-critical. It is expected that Web applications will use the local storage areas for storing - user-written documents.</p> - - <p>When the <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> + user-written documents.<p>When the <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> attribute is accessed, the user agent must check to see if it has allocated a local storage area for the <span>origin</span> of the <code>Document</code> of the <code>Window</code> object on which the method was invoked. If it has not, a new storage area for that - <span>origin</span> must be created.</p> - - <p>The user agent must then return the <code><a href="#storage-0">Storage</a></code> object + <span>origin</span> must be created.<p>The user agent must then return the <code><a href="#storage-0">Storage</a></code> object associated with that origin's local storage area. Each <code>Document</code> object must have a separate object for its - <code>Window</code>'s <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> attribute.</p> - - <p id="localStorageEvent">When the <code title="dom-Storage-setItem"><a href="#dom-storage-setitem">setItem()</a></code>, <code title="dom-Storage-removeItem"><a href="#dom-storage-removeitem">removeItem()</a></code>, and <code title="dom-Storage-clear"><a href="#dom-storage-clear">clear()</a></code> methods are called on a + <code>Window</code>'s <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> attribute.<p id="localStorageEvent">When the <code title="dom-Storage-setItem"><a href="#dom-storage-setitem">setItem()</a></code>, <code title="dom-Storage-removeItem"><a href="#dom-storage-removeitem">removeItem()</a></code>, and <code title="dom-Storage-clear"><a href="#dom-storage-clear">clear()</a></code> methods are called on a <code><a href="#storage-0">Storage</a></code> object <var title="">x</var> that is associated with a local storage area, if the methods did something, then in every <code>HTMLDocument</code> object whose <code>Window</code> object's <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> attribute's <code><a href="#storage-0">Storage</a></code> object is associated with the same - storage area, other than <var title="">x</var>, a <code title="event-storage"><a href="#event-storage">storage</a></code> event must be fired, as <a href="#event-storage" title="event-storage">described below</a>.</p> - - <p id="localStorageMutex">Whenever the properties of a <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> attribute's + storage area, other than <var title="">x</var>, a <code title="event-storage"><a href="#event-storage">storage</a></code> event must be fired, as <a href="#event-storage" title="event-storage">described below</a>.<p id="localStorageMutex">Whenever the properties of a <code title="dom-localStorage"><a href="#dom-localstorage">localStorage</a></code> attribute's <code><a href="#storage-0">Storage</a></code> object are to be examined, returned, set, or deleted, whether as part of a direct property access, when checking for the presence of a property, during property enumeration, when determining the number of properties present, or as part of the execution of any of the methods or attributes defined on the <code><a href="#storage-0">Storage</a></code> interface. the user agent must first - <span>obtain the storage mutex</span>.</p> - - - - <h3 id="the-storage-event"><span class="secno">4.4 </span>The <code title="event-storage"><a href="#event-storage">storage</a></code> event</h3> - - <p>The <dfn id="event-storage" title="event-storage"><code>storage</code></dfn> event + <span>obtain the storage mutex</span>.<h3 id="the-storage-event"><span class="secno">4.4 </span>The <code title="event-storage"><a href="#event-storage">storage</a></code> event</h3><p>The <dfn id="event-storage" title="event-storage"><code>storage</code></dfn> event is fired when a storage area changes, as described in the previous two sections (<a href="#sessionStorageEvent">for session storage</a>, <a href="#localStorageEvent">for local - storage</a>).</p> - - <p>When this happens, the user agent must <span>queue a task</span> + storage</a>).<p>When this happens, the user agent must <span>queue a task</span> to fire an event with the name <code><a href="#storage-0">storage</a></code>, with no namespace, which does not bubble and is not cancelable, and which uses the <code><a href="#storageevent">StorageEvent</a></code> interface, at each <code>Window</code> object whose <code>Document</code> object has a - <code><a href="#storage-0">Storage</a></code> object that is affected.</p> - - <p class="note">This includes <code>Document</code> objects that are + <code><a href="#storage-0">Storage</a></code> object that is affected.<p class="note">This includes <code>Document</code> objects that are not <span>fully active</span>, but events fired on those are ignored by the <span>event loop</span> until the <code>Document</code> - becomes <span>fully active</span> again.</p> - - <p>The <span>task source</span> for this task is the <span>DOM - manipulation task source</span>.</p> - - <p>If the event is being fired due to an invocation of the <code title="dom-Storage-setItem"><a href="#dom-storage-setitem">setItem()</a></code> or <code title="dom-Storage-removeItem"><a href="#dom-storage-removeitem">removeItem()</a></code> methods, the + becomes <span>fully active</span> again.<p>The <span>task source</span> for this task is the <span>DOM + manipulation task source</span>.<p>If the event is being fired due to an invocation of the <code title="dom-Storage-setItem"><a href="#dom-storage-setitem">setItem()</a></code> or <code title="dom-Storage-removeItem"><a href="#dom-storage-removeitem">removeItem()</a></code> methods, the event must have its <code title="dom-StorageEvent-key"><a href="#dom-storageevent-key">key</a></code> attribute set to the name of the key in question, its <code title="dom-StorageEvent-oldValue"><a href="#dom-storageevent-oldvalue">oldValue</a></code> attribute set to a <span>structured clone</span> of the old value of the key in question, or null if the key is newly added, and its <code title="dom-StorageEvent-newValue"><a href="#dom-storageevent-newvalue">newValue</a></code> attribute set to a <span>structured clone</span> of the new value of the key in - question, or null if the key was removed.</p> - - <p>Otherwise, if the event is being fired due to an invocation of + question, or null if the key was removed.<p>Otherwise, if the event is being fired due to an invocation of the <code title="dom-Storage-clear"><a href="#dom-storage-clear">clear()</a></code> method, the event must have its <code title="dom-StorageEvent-key"><a href="#dom-storageevent-key">key</a></code>, <code title="dom-StorageEvent-oldValue"><a href="#dom-storageevent-oldvalue">oldValue</a></code>, and <code title="dom-StorageEvent-newValue"><a href="#dom-storageevent-newvalue">newValue</a></code> attributes set to - null.</p> - - <p>In addition, the event must have its <code title="dom-StorageEvent-url"><a href="#dom-storageevent-url">url</a></code> attribute set to <span title="the document's address">the address of the document</span> + null.<p>In addition, the event must have its <code title="dom-StorageEvent-url"><a href="#dom-storageevent-url">url</a></code> attribute set to <span title="the document's address">the address of the document</span> whose <code><a href="#storage-0">Storage</a></code> object was affected; its <code title="dom-StorageEvent-source"><a href="#dom-storageevent-source">source</a></code> attribute set to the that document's <span>browsing context</span>'s <code>WindowProxy</code> object, if the two documents are in the @@ -819,12 +588,7 @@ set to the <code><a href="#storage-0">Storage</a></code> object from the <code>Window</code> object of the target <code>Document</code> that represents the same kind of <code><a href="#storage-0">Storage</a></code> area as was affected (i.e. session or - local).</p> - - - <h4 id="event-definition"><span class="secno">4.4.1 </span>Event definition</h4> - - <pre class="idl">interface <dfn id="storageevent">StorageEvent</dfn> : Event { + local).<h4 id="event-definition"><span class="secno">4.4.1 </span>Event definition</h4><pre class="idl">interface <dfn id="storageevent">StorageEvent</dfn> : Event { readonly attribute DOMString <a href="#dom-storageevent-key" title="dom-StorageEvent-key">key</a>; readonly attribute any <a href="#dom-storageevent-oldvalue" title="dom-StorageEvent-oldValue">oldValue</a>; readonly attribute any <a href="#dom-storageevent-newvalue" title="dom-StorageEvent-newValue">newValue</a>; @@ -833,87 +597,41 @@ readonly attribute <a href="#storage-0">Storage</a> <a href="#dom-storageevent-storagearea" title="dom-StorageEvent-storageArea">storageArea</a>; void <a href="#dom-storageevent-initstorageevent" title="dom-StorageEvent-initStorageEvent">initStorageEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString keyArg, in any oldValueArg, in any newValueArg, in DOMString urlArg, in <span>WindowProxy</span> sourceArg, in <a href="#storage-0">Storage</a> storageAreaArg); void <a href="#dom-storageevent-initstorageeventns" title="dom-StorageEvent-initStorageEventNS">initStorageEventNS</a>(in DOMString namespaceURI, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString keyArg, in any oldValueArg, in any newValueArg, in DOMString urlArg, in <span>WindowProxy</span> sourceArg, in <a href="#storage-0">Storage</a> storageAreaArg); -};</pre> - - <p>The <dfn id="dom-storageevent-initstorageevent" title="dom-StorageEvent-initStorageEvent"><code>initStorageEvent()</code></dfn> +};</pre><p>The <dfn id="dom-storageevent-initstorageevent" title="dom-StorageEvent-initStorageEvent"><code>initStorageEvent()</code></dfn> and <dfn id="dom-storageevent-initstorageeventns" title="dom-StorageEvent-initStorageEventNS"><code>initStorageEventNS()</code></dfn> methods must initialize the event in a manner analogous to the - similarly-named methods in the DOM Events interfaces. <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p> - - <p>The <dfn id="dom-storageevent-key" title="dom-StorageEvent-key"><code>key</code></dfn> - attribute represents the key being changed.</p> - - <p>The <dfn id="dom-storageevent-oldvalue" title="dom-StorageEvent-oldValue"><code>oldValue</code></dfn> - attribute represents the old value of the key being changed.</p> - - <p>The <dfn id="dom-storageevent-newvalue" title="dom-StorageEvent-newValue"><code>newValue</code></dfn> - attribute represents the new value of the key being changed.</p> - - <p>The <dfn id="dom-storageevent-url" title="dom-StorageEvent-url"><code>url</code></dfn> + similarly-named methods in the DOM Events interfaces. <a href="#refsDOMEVENTS">[DOMEVENTS]</a><p>The <dfn id="dom-storageevent-key" title="dom-StorageEvent-key"><code>key</code></dfn> + attribute represents the key being changed.<p>The <dfn id="dom-storageevent-oldvalue" title="dom-StorageEvent-oldValue"><code>oldValue</code></dfn> + attribute represents the old value of the key being changed.<p>The <dfn id="dom-storageevent-newvalue" title="dom-StorageEvent-newValue"><code>newValue</code></dfn> + attribute represents the new value of the key being changed.<p>The <dfn id="dom-storageevent-url" title="dom-StorageEvent-url"><code>url</code></dfn> attribute represents the address of the document whose key - changed.</p> - - <p>The <dfn id="dom-storageevent-source" title="dom-StorageEvent-source"><code>source</code></dfn> attribute + changed.<p>The <dfn id="dom-storageevent-source" title="dom-StorageEvent-source"><code>source</code></dfn> attribute represents the <code>WindowProxy</code> object of the <span>browsing - context</span> of the document whose key changed.</p> - - <p>The <dfn id="dom-storageevent-storagearea" title="dom-StorageEvent-storageArea"><code>storageArea</code></dfn> + context</span> of the document whose key changed.<p>The <dfn id="dom-storageevent-storagearea" title="dom-StorageEvent-storageArea"><code>storageArea</code></dfn> attribute represents the <code><a href="#storage-0">Storage</a></code> object that was - affected.</p> - - - - <h3 id="threads"><span class="secno">4.5 </span>Threads</h3> - - <p>Because of <a href="#localStorageMutex">the use</a> of the + affected.<h3 id="threads"><span class="secno">4.5 </span>Threads</h3><p>Because of <a href="#localStorageMutex">the use</a> of the <span>storage mutex</span>, multiple browsing contexts will be able to access the local storage areas simultaneously in such a manner - that scripts cannot detect any concurrent script execution.</p> - - <p>Thus, the <code title="dom-Storage-length"><a href="#dom-storage-length">length</a></code> + that scripts cannot detect any concurrent script execution.<p>Thus, the <code title="dom-Storage-length"><a href="#dom-storage-length">length</a></code> attribute of a <code><a href="#storage-0">Storage</a></code> object, and the value of the various properties of that object, cannot change while a script is executing, other than in a way that is predictable by the script - itself.</p> - - - <h2 id="disk-space"><span class="secno">5 </span>Disk space</h2> - - <p>User agents should limit the total amount of space allowed for + itself.<h2 id="disk-space"><span class="secno">5 </span>Disk space</h2><p>User agents should limit the total amount of space allowed for storage areas. - </p> - <p>User agents should guard against sites storing data under the origins other affiliated sites, e.g. storing up to the limit in a1.example.com, a2.example.com, a3.example.com, etc, circumventing - the main example.com storage limit.</p> - - <p>User agents may prompt the user when quotas are reached, allowing + the main example.com storage limit.<p>User agents may prompt the user when quotas are reached, allowing the user to grant a site more space. This enables sites to store many user-created documents on the user's computer, for - instance.</p> - - <p>User agents should allow users to see how much space each domain - is using.</p> - - - <!--<p>If the storage area space limit is reached during a <code + instance.<p>User agents should allow users to see how much space each domain + is using.</p><!--<p>If the storage area space limit is reached during a <code title="dom-Storage-setItem">setItem()</code> call, the method will - raise an exception.</p>--> - - - <p>A mostly arbitrary limit of five megabytes per + raise an exception.</p>--><p>A mostly arbitrary limit of five megabytes per <span>origin</span> is recommended. Implementation feedback is welcome and will be used to update this suggestion in the - future.</p> - - - <h2 id="privacy"><span class="secno">6 </span>Privacy</h2> - - <h3 id="user-tracking"><span class="secno">6.1 </span>User tracking</h3> - - <p>A third-party advertiser (or any entity capable of getting + future.<h2 id="privacy"><span class="secno">6 </span>Privacy</h2><h3 id="user-tracking"><span class="secno">6.1 </span>User tracking</h3><p>A third-party advertiser (or any entity capable of getting content distributed to multiple sites) could use a unique identifier stored in its @@ -924,14 +642,8 @@ (for example an e-commerce site that requires authenticated credentials), this could allow oppressive groups to target individuals with greater accuracy than in a world with purely - anonymous Web usage.</p> - - <p>There are a number of techniques that can be used to mitigate the - risk of user tracking:</p> - - <dl> - - <dt>Blocking third-party storage</dt> + anonymous Web usage.<p>There are a number of techniques that can be used to mitigate the + risk of user tracking:<dl><dt>Blocking third-party storage</dt> <dd> <p>User agents may restrict access to @@ -1024,101 +736,57 @@ </dd> - </dl> - - <p>While these suggestions prevent trivial use of this API for user + </dl><p>While these suggestions prevent trivial use of this API for user tracking, they do not block it altogether. Within a single domain, a site can continue to track the user during a session, and can then pass all this information to the third party along with any identifying information (names, credit card numbers, addresses) obtained by the site. If a third party cooperates with multiple sites to obtain such information, a profile can still be - created.</p> - - <p>However, user tracking is to some extent possible even with no + created.<p>However, user tracking is to some extent possible even with no cooperation from the user agent whatsoever, for instance by using session identifiers in URLs, a technique already commonly used for innocuous purposes but easily repurposed for user tracking (even retroactively). This information can then be shared with other sites, using using visitors' IP addresses and other user-specific data (e.g. user-agent headers and configuration settings) to combine - separate sessions into coherent user profiles.</p> - - - <h3 id="cookie-resurrection"><span class="secno">6.2 </span>Cookie resurrection</h3> - - <p>If the user interface for persistent storage presents data in the + separate sessions into coherent user profiles.<h3 id="cookie-resurrection"><span class="secno">6.2 </span>Cookie resurrection</h3><p>If the user interface for persistent storage presents data in the persistent storage features described in this specification separately from data in HTTP session cookies, then users are likely to delete data in one and not the other. This would allow sites to use the two features as redundant backup for each other, defeating a - user's attempts to protect his privacy.</p> - - - <h2 id="security"><span class="secno">7 </span>Security</h2> - - <h3 id="dns-spoofing-attacks"><span class="secno">7.1 </span>DNS spoofing attacks</h3> - - <p>Because of the potential for DNS spoofing attacks, one cannot + user's attempts to protect his privacy.<h2 id="security"><span class="secno">7 </span>Security</h2><h3 id="dns-spoofing-attacks"><span class="secno">7.1 </span>DNS spoofing attacks</h3><p>Because of the potential for DNS spoofing attacks, one cannot guarantee that a host claiming to be in a certain domain really is from that domain. To mitigate this, pages can use SSL. Pages using SSL can be sure that only pages using SSL that have certificates identifying them as being from the same domain can access their storage areas. - </p> - - - <h3 id="cross-directory-attacks"><span class="secno">7.2 </span>Cross-directory attacks</h3> - - <p>Different authors sharing one host name, for example users + <h3 id="cross-directory-attacks"><span class="secno">7.2 </span>Cross-directory attacks</h3><p>Different authors sharing one host name, for example users hosting content on <code>geocities.com</code>, all share one persistent storage object. There is no feature to restrict the access by pathname. Authors on shared hosts are therefore recommended to avoid using these features, as it would be trivial for other authors to read the data - and overwrite it.</p> - - <p class="note">Even if a path-restriction feature was made + and overwrite it.<p class="note">Even if a path-restriction feature was made available, the usual DOM scripting security model would make it trivial to bypass this protection and access the data from any - path.</p> - - - <h3 id="implementation-risks"><span class="secno">7.3 </span>Implementation risks</h3> - - <p>The two primary risks when implementing these persistent storage + path.<h3 id="implementation-risks"><span class="secno">7.3 </span>Implementation risks</h3><p>The two primary risks when implementing these persistent storage features are letting hostile sites read information from other domains, and letting hostile sites write information that is then - read from other domains.</p> - - <p>Letting third-party sites read data that is not supposed to be + read from other domains.<p>Letting third-party sites read data that is not supposed to be read from their domain causes <em>information leakage</em>, For example, a user's shopping wishlist on one domain could be used by another domain for targeted advertising; or a user's work-in-progress confidential documents stored by a word-processing - site could be examined by the site of a competing company.</p> - - <p>Letting third-party sites write data to the persistent storage of + site could be examined by the site of a competing company.<p>Letting third-party sites write data to the persistent storage of other domains can result in <em>information spoofing</em>, which is equally dangerous. For example, a hostile site could add items to a user's wishlist; or a hostile site could set a user's session identifier to a known ID that the hostile site can then use to track - the user's actions on the victim site.</p> - - <p>Thus, strictly following the <span>origin</span> model described - in this specification is important for user security.</p> - - - - <h2 class="no-num" id="references">References</h2> - - <p>All references are normative unless marked "Non-normative".</p> - - <dl> - - <dt id="refsCOOKIES">[COOKIES]</dt> + the user's actions on the victim site.<p>Thus, strictly following the <span>origin</span> model described + in this specification is important for user security.<h2 class="no-num" id="references">References</h2><p>All references are normative unless marked "Non-normative".<dl><dt id="refsCOOKIES">[COOKIES]</dt> <!-- <dd><cite><a href="http://www.ietf.org/rfc/rfc2965.txt">HTTP State Management Mechanism</a></cite>, D. Kristol, L. Montulli. IETF, October 2000.</dd> @@ -1180,7 +848,3 @@ IDL</a></cite>, C. McCormack. W3C, July 2009.</dd> </dl> - - - -
Received on Friday, 14 August 2009 23:08:29 UTC