[whatwg] HTML5 Offline Web Applications

Another way to address this would be to redefine the semantics of .length
and .item(indx) such that the underlying collection was not required to
appear immutable till scripts ran to completion. Embrace the fact that
the collection is shared across many pages and that it can change at any
time. A .lastModifiedDate property could be exposed which would allow
pages to detect when a change had occurred.

On Wed, Oct 8, 2008 at 11:51 AM, Michael Nordman <michaeln at google.com> wrote:
>> Here's the thing i'm trying to avoid in section 5.7.6 where it
>> discusses the add(url) method.
>> ...
>> 8. "Wait for there to be no running scripts, or at least no running
>> scripts that can reach an ApplicationCache object associated with the
>> application cache with which this ApplicationCache object is
>> associated."
>> ...
>> The same system-wide synchronization has to be applied for the
>> remove(url) method.
>>
>> The utility of the .length and .item(indx) method could be provided in
>> such a way that this awkwardness could be avoided.
>>
>> Some ideas...
>> bool contains(url);
>> string[] getItems();
>
> Another idea, getItems() wouldn't work well with very large collections
>
> void forEachItem(callback);  // iteration terminates if the callback
> returns false or throws
>

Received on Tuesday, 14 October 2008 11:07:06 UTC