storage: update comment about dispatch event

This commit is contained in:
Pierre Tachoire
2024-05-02 15:21:21 +02:00
parent 3c5d601622
commit 61357ee7e0

View File

@@ -147,27 +147,45 @@ pub const Bottle = struct {
return DOMError.QuotaExceeded; return DOMError.QuotaExceeded;
}; };
// TODO dispatch event
// > Broadcast this with key, oldValue, and value. // > Broadcast this with key, oldValue, and value.
// https://html.spec.whatwg.org/multipage/webstorage.html#the-storageevent-interface // https://html.spec.whatwg.org/multipage/webstorage.html#the-storageevent-interface
//
// > The storage event of the Window interface fires when a storage
// > area (localStorage or sessionStorage) has been modified in the
// > context of another document.
// https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event
//
// So for now, we won't impement the feature.
} }
pub fn _removeItem(self: *Bottle, k: []const u8) !void { pub fn _removeItem(self: *Bottle, k: []const u8) !void {
const old = self.map.fetchRemove(k); const old = self.map.fetchRemove(k);
if (old == null) return; if (old == null) return;
// TODO dispatch event
// > Broadcast this with key, oldValue, and null. // > Broadcast this with key, oldValue, and null.
// https://html.spec.whatwg.org/multipage/webstorage.html#the-storageevent-interface // https://html.spec.whatwg.org/multipage/webstorage.html#the-storageevent-interface
//
// > The storage event of the Window interface fires when a storage
// > area (localStorage or sessionStorage) has been modified in the
// > context of another document.
// https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event
//
// So for now, we won't impement the feature.
} }
pub fn _clear(self: *Bottle) void { pub fn _clear(self: *Bottle) void {
self.free(); self.free();
self.map.clearRetainingCapacity(); self.map.clearRetainingCapacity();
// TODO dispatch event
// > Broadcast this with null, null, and null. // > Broadcast this with null, null, and null.
// https://html.spec.whatwg.org/multipage/webstorage.html#the-storageevent-interface // https://html.spec.whatwg.org/multipage/webstorage.html#the-storageevent-interface
//
// > The storage event of the Window interface fires when a storage
// > area (localStorage or sessionStorage) has been modified in the
// > context of another document.
// https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event
//
// So for now, we won't impement the feature.
} }
}; };