Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Align StorageEvent.initStorageEvent() with the HTML specification
https://bugs.webkit.org/show_bug.cgi?id=242809

Reviewed by Geoffrey Garen.

Align StorageEvent.initStorageEvent() with the HTML specification and Blink:
- https://html.spec.whatwg.org/multipage/webstorage.html#the-storageevent-interface

* LayoutTests/imported/w3c/web-platform-tests/webstorage/event_initstorageevent.window-expected.txt:
* Source/WebCore/storage/StorageEvent.idl:

Canonical link: https://commits.webkit.org/252521@main
  • Loading branch information
cdumez committed Jul 15, 2022
1 parent d8327a3 commit 72a64cd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion LayoutTests/fast/events/init-events-expected.txt
Expand Up @@ -116,7 +116,7 @@ PASS testInitEvent('Storage', '"a", true, false, "b", "c", "d", "e"').bubbles is
PASS testInitEvent('Storage', '"a", false, false, "b", "c", "d", "e"').cancelable is false
PASS testInitEvent('Storage', '"a", false, true, "b", "c", "d", "e"').cancelable is true
PASS testInitEvent('Storage', '"a", false, false, "b", "c", "d", "e"').key is 'b'
PASS testInitEvent('Storage', '"a", false, false, null, "c", "d", "e"').key is 'null'
PASS testInitEvent('Storage', '"a", false, false, null, "c", "d", "e"').key is null
PASS testInitEvent('Storage', '"a", false, false, "b", "c", "d", "e"').oldValue is 'c'
PASS testInitEvent('Storage', '"a", false, false, "b", null, "d", "e"').oldValue is null
PASS testInitEvent('Storage', '"a", false, false, "b", "c", "d", "e"').newValue is 'd'
Expand Down
2 changes: 1 addition & 1 deletion LayoutTests/fast/events/init-events.html
Expand Up @@ -145,7 +145,7 @@
shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", \"c\", \"d\", \"e\"').cancelable", "false");
shouldBe("testInitEvent('Storage', '\"a\", false, true, \"b\", \"c\", \"d\", \"e\"').cancelable", "true");
shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", \"c\", \"d\", \"e\"').key", "'b'");
shouldBe("testInitEvent('Storage', '\"a\", false, false, null, \"c\", \"d\", \"e\"').key", "'null'");
shouldBe("testInitEvent('Storage', '\"a\", false, false, null, \"c\", \"d\", \"e\"').key", "null");
shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", \"c\", \"d\", \"e\"').oldValue", "'c'");
shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", null, \"d\", \"e\"').oldValue", "null");
shouldBe("testInitEvent('Storage', '\"a\", false, false, \"b\", \"c\", \"d\", \"e\"').newValue", "'d'");
Expand Down
@@ -1,7 +1,7 @@

PASS initStorageEvent with 0 arguments
FAIL initStorageEvent with 1 argument assert_equals: event.key expected (object) null but got (string) "undefined"
PASS initStorageEvent with 1 argument
PASS initStorageEvent with 8 sensible arguments
FAIL initStorageEvent with 8 null arguments assert_equals: event.key expected (object) null but got (string) "null"
FAIL initStorageEvent with 8 undefined arguments assert_equals: event.key expected (object) null but got (string) "undefined"
PASS initStorageEvent with 8 null arguments
PASS initStorageEvent with 8 undefined arguments

16 changes: 8 additions & 8 deletions Source/WebCore/storage/StorageEvent.idl
Expand Up @@ -34,14 +34,14 @@
readonly attribute USVString url;
readonly attribute Storage? storageArea;

undefined initStorageEvent([AtomString] DOMString typeArg,
optional boolean canBubbleArg = false,
optional boolean cancelableArg = false,
optional DOMString keyArg = "undefined",
optional DOMString? oldValueArg = null,
optional DOMString? newValueArg = null,
optional USVString urlArg = "undefined",
optional Storage? storageAreaArg = null);
undefined initStorageEvent([AtomString] DOMString type,
optional boolean bubbles = false,
optional boolean cancelable = false,
optional DOMString? key = null,
optional DOMString? oldValue = null,
optional DOMString? newValue = null,
optional USVString url = "",
optional Storage? storageArea = null);

// Needed once we support init<blank>EventNS
// undefined initStorageEventNS(DOMString namespaceURI, DOMString typeArg, boolean canBubbleArg, boolean cancelableArg, DOMString keyArg, DOMString oldValueArg, DOMString newValueArg, USVString urlArg, Storage? storageAreaArg);
Expand Down

0 comments on commit 72a64cd

Please sign in to comment.