Skip to content

Check for null data when constructing a PushEvent - #439

Merged
marcoscaceres merged 1 commit into
w3c:gh-pagesfrom
JinDX:fix/push-api-push-event-constructor-test-null-data
Nov 16, 2026
Merged

marcoscaceres merged 1 commit into
w3c:gh-pagesfrom
JinDX:fix/push-api-push-event-constructor-test-null-data

Conversation

@JinDX

@JinDX JinDX commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

After Web IDL conversion, the nullable data member is present with a default of null. Test for null to distinguish omitted data from a supplied empty string or buffer.


Preview | Diff

@w3cbot

w3cbot commented Nov 16, 2026

Copy link
Copy Markdown

marcoscaceres marked as non substantive for IPR from ash-nazg.

@marcoscaceres
marcoscaceres merged commit 6947efd into w3c:gh-pages Nov 16, 2026
2 checks passed
@marcoscaceres

Copy link
Copy Markdown
Member

@saschanaz, a question about Gecko after this change. The spec's PushEventInit declares PushMessageDataInit? data = null (IDL), so {data: null} means no data. Gecko declares PushMessageDataInit data; (PushEvent.webidl), and the constructor tests aOptions.mData.WasPassed() (ServiceWorkerEvents.cpp). By my reading of Web IDL, an explicit null there converts to the string "null". I have not run it in Firefox. Could you confirm that reading? If it holds, would Gecko change the member to nullable with a null default, as in the spec?

@saschanaz

Copy link
Copy Markdown
Member

That changed in #385 then we missed it because we didn't bother to implement mutable... But it's a right change as generally we want to make new FooEvent(fooEvent) work.

@saschanaz

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants