<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000099">
Ian Hickson wrote:
<blockquote
cite="mid:Pine.LNX.4.62.0910270848150.9145@hixie.dreamhostps.com"
type="cite">
<pre wrap="">On Tue, 27 Oct 2009, Honza Bambas wrote:
</pre>
<blockquote type="cite">
<pre wrap="">The spec says:
"When the |setItem()
<a class="moz-txt-link-rfc2396E" href="http://dev.w3.org/html5/webstorage/#dom-storage-setitem"><http://dev.w3.org/html5/webstorage/#dom-storage-setitem></a>|, |removeItem()
<a class="moz-txt-link-rfc2396E" href="http://dev.w3.org/html5/webstorage/#dom-storage-removeitem"><http://dev.w3.org/html5/webstorage/#dom-storage-removeitem></a>|, and |clear()
<a class="moz-txt-link-rfc2396E" href="http://dev.w3.org/html5/webstorage/#dom-storage-clear"><http://dev.w3.org/html5/webstorage/#dom-storage-clear></a>| methods are called on
a |Storage <a class="moz-txt-link-rfc2396E" href="http://dev.w3.org/html5/webstorage/#storage-0"><http://dev.w3.org/html5/webstorage/#storage-0></a>| object x that is
associated with a session storage area, if the methods did something, then in
every |HTMLDocument| object whose |Window| object's |sessionStorage
<a class="moz-txt-link-rfc2396E" href="http://dev.w3.org/html5/webstorage/#dom-sessionstorage"><http://dev.w3.org/html5/webstorage/#dom-sessionstorage></a>| attribute's |Storage
<a class="moz-txt-link-rfc2396E" href="http://dev.w3.org/html5/webstorage/#storage-0"><http://dev.w3.org/html5/webstorage/#storage-0></a>| object is associated with the
same storage area, other than x, a |storage
<a class="moz-txt-link-rfc2396E" href="http://dev.w3.org/html5/webstorage/#event-storage"><http://dev.w3.org/html5/webstorage/#event-storage></a>| event must be fired, as
described below <a class="moz-txt-link-rfc2396E" href="http://dev.w3.org/html5/webstorage/#event-storage"><http://dev.w3.org/html5/webstorage/#event-storage></a>."
[<a class="moz-txt-link-freetext" href="http://dev.w3.org/html5/webstorage/#dom-sessionstorage">http://dev.w3.org/html5/webstorage/#dom-sessionstorage</a>]
The same applies to localStorage.
Maybe I read something wrong, but as a sessionStorage object is always
unique to its document (it is cloned when a new document with the same
origin is created and then independent from the original document's
object) it, in my opinion, doesn't make sense to send the event to any
other document then the one its storage has been changed. On the other
hand, it makes sense to me to not fire the event in the same document
where the storage has been changed (as for localStorage), then, I'd say
there should be no event for sessionStorage at all. I simply don't a
case when two or more documents would share a single sessionStorage
object.
Thanks for clearing this.
</pre>
</blockquote>
<pre wrap=""><!---->
You can have multiple (active) documents sharing the same sessionHistory
using nested browsing contexts, for example in <iframe>, <object>, and
<frameset>/<frame>.
</pre>
</blockquote>
s/sessionHistory/sessionStorage/ ? <br>
<br>
Ah, true. sessionStorage object is shared within the toplevel browsing
context for all nested documents with the same origin. Then it makes
sense to send the message to all those documents.<br>
<br>
Thanks for clarifying.<br>
-hb-<br>
<br>
</body>
</html>