Browse files

[giow] (2) Setting document.domain has to make localStorage unusable …

…because otherwise you can cause deadlocks with per-origin localStorage locks

git-svn-id: http://svn.whatwg.org/webapps@3878 340c8d12-0b0e-0410-8428-c7bf67bfef74
1 parent 79f3cf2 commit f5733d1d79c32eeecb4e98e4bd00839b87d4a7bf @Hixie Hixie committed Sep 16, 2009
Showing with 21 additions and 11 deletions.
  1. +21 −11 source
View
32 source
@@ -62483,17 +62483,27 @@ interface <span>WindowLocalStorage</span> {
access that data is running.</p>
<p>When the <code title="dom-localStorage">localStorage</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>Storage</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">localStorage</code> attribute.</p>
+ attribute is accessed, the user agent must run the following steps:</p>
+
+ <ol>
+
+ <li><p>If the <code>Document</code>'s <span>effective script
+ origin</span> is not the <span>same origin</span> as the
+ <code>Document</code>'s <span>origin</span>, then throw a
+ <code>SECURITY_ERR</code> exception and abort these steps.</p></li>
+
+ <li><p>Check to see if the user agent 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, create a new storage area for that
+ <span>origin</span>.</p></li>
+
+ <li><p>Return the <code>Storage</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">localStorage</code> attribute.</p>
+
+ </ol>
<p id="localStorageEvent">When the <code
title="dom-Storage-setItem">setItem()</code>, <code

0 comments on commit f5733d1

Please sign in to comment.