Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all parameters to initEvent() / initCustomEvent() optional excep… #417

Merged
merged 1 commit into from
Mar 7, 2017

Conversation

cdumez
Copy link

@cdumez cdumez commented Mar 4, 2017

…t the first

Make all parameters to initEvent() / initCustomEvent() optional except the first.
This aligns the specification with WebKit and gets it closer to Blink.

This closes issue #387.

…t the first

Make all parameters to initEvent() / initCustomEvent() optional except the first.
This aligns the specification with WebKit and gets it closer to Blink.

This closes issue whatwg#387.
@cdumez cdumez force-pushed the initEvent-Params branch from aa78ae8 to 544a66c Compare March 4, 2017 23:15
cdumez added a commit to cdumez/html that referenced this pull request Mar 4, 2017
Make all parameters to initMessageEvent() optional except the first one.

See corresponding DOM change at:
whatwg/dom#417

and discussion at:
whatwg/dom#387
cdumez added a commit to cdumez/web-platform-tests that referenced this pull request Mar 4, 2017
…t the first one

Make all parameters to initEvent() / initCustomEvent() optional except the first one.
to match:
- whatwg/dom#417
- whatwg/dom#387
@cdumez
Copy link
Author

cdumez commented Mar 4, 2017

@cdumez
Copy link
Author

cdumez commented Mar 5, 2017

@annevk @domenic @foolip r?

@annevk
Copy link
Member

annevk commented Mar 6, 2017

LGTM. Landing blocked on speced/bikeshed#941 and landing the tests.

cdumez added a commit to cdumez/html that referenced this pull request Mar 6, 2017
Make all parameters to initMessageEvent() optional except the first one.

See corresponding DOM change at:
whatwg/dom#417

and discussion at:
whatwg/dom#387
cdumez added a commit to cdumez/web-platform-tests that referenced this pull request Mar 6, 2017
…t the first one

Make all parameters to initEvent() / initCustomEvent() optional except the first one.
to match:
- whatwg/dom#417
- whatwg/dom#387
annevk pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 7, 2017
@annevk annevk merged commit 2358735 into whatwg:master Mar 7, 2017
annevk pushed a commit to whatwg/html that referenced this pull request Mar 7, 2017
hubot pushed a commit to WebKit/WebKit-http that referenced this pull request Mar 7, 2017
…specification

https://bugs.webkit.org/show_bug.cgi?id=169176

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Re-sync web-platform tests from upstream after:
- web-platform-tests/wpt#5043
- web-platform-tests/wpt#5044

* web-platform-tests/dom/events/CustomEvent-expected.txt:
* web-platform-tests/dom/events/CustomEvent.html:
* web-platform-tests/dom/events/Event-initEvent-expected.txt:
* web-platform-tests/dom/events/Event-initEvent.html:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/interfaces.html:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/dom/interfaces.html:
* web-platform-tests/html/dom/resources/interfaces.idl: Copied from LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces.html.
* web-platform-tests/html/dom/resources/untested-interfaces.idl: Added.
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor-expected.txt: Removed.
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.html: Removed.
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https-expected.txt:
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https.html:

Source/WebCore:

Align initEvent / initCustomEvent / initMessageEvent with the latest specification
after:
- whatwg/dom#417
- whatwg/html#2410

In particular, the following changes were made:
- initEvent: The length property now properly returns 1 instead of 3 as only the
  first parameter is mandatory. We were already behaving correcting the the length
  property value was wrong because we forgot to drop a hack from the bindings
  generator.
- initCustomEvent: Make all parameters except the first optional. Previously, all
  parameters were mandatory so this is safe.
- initMessageEvent: Drop the custom code and mark the first parameter as mandatory.
  A side effect of dropping the custom code is that null is no longer considered as
  valid input for the last parameter. The parameter is of type sequence<> and the
  new behavior is consistent with the specification and Firefox. If it turns out to
  break existing content, I'll make the parameter nullable in a follow-up.

No new tests, updated existing tests.

* bindings/js/JSMessageEventCustom.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePropertiesHashTable):
* dom/CustomEvent.idl:
* dom/MessageEvent.idl:

LayoutTests:

Updated existing tests to reflect behavior change.

* fast/events/init-events-expected.txt:
* fast/events/script-tests/init-events.js:
* fast/eventsource/eventsource-attribute-listeners.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@213517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
bertogg pushed a commit to Igalia/webkit that referenced this pull request Mar 14, 2017
…with the latest specification

https://bugs.webkit.org/show_bug.cgi?id=169176

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Re-sync web-platform tests from upstream after:
- web-platform-tests/wpt#5043
- web-platform-tests/wpt#5044

* web-platform-tests/dom/events/CustomEvent-expected.txt:
* web-platform-tests/dom/events/CustomEvent.html:
* web-platform-tests/dom/events/Event-initEvent-expected.txt:
* web-platform-tests/dom/events/Event-initEvent.html:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/interfaces.html:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/dom/interfaces.html:
* web-platform-tests/html/dom/resources/interfaces.idl: Copied from LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces.html.
* web-platform-tests/html/dom/resources/untested-interfaces.idl: Added.
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor-expected.txt: Removed.
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.html: Removed.
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https-expected.txt:
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https.html:

Source/WebCore:

Align initEvent / initCustomEvent / initMessageEvent with the latest specification
after:
- whatwg/dom#417
- whatwg/html#2410

In particular, the following changes were made:
- initEvent: The length property now properly returns 1 instead of 3 as only the
  first parameter is mandatory. We were already behaving correcting the the length
  property value was wrong because we forgot to drop a hack from the bindings
  generator.
- initCustomEvent: Make all parameters except the first optional. Previously, all
  parameters were mandatory so this is safe.
- initMessageEvent: Drop the custom code and mark the first parameter as mandatory.
  A side effect of dropping the custom code is that null is no longer considered as
  valid input for the last parameter. The parameter is of type sequence<> and the
  new behavior is consistent with the specification and Firefox. If it turns out to
  break existing content, I'll make the parameter nullable in a follow-up.

No new tests, updated existing tests.

* bindings/js/JSMessageEventCustom.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePropertiesHashTable):
* dom/CustomEvent.idl:
* dom/MessageEvent.idl:

LayoutTests:

Updated existing tests to reflect behavior change.

* fast/events/init-events-expected.txt:
* fast/events/script-tests/init-events.js:
* fast/eventsource/eventsource-attribute-listeners.html:

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.16@213825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
alice pushed a commit to alice/html that referenced this pull request Jan 8, 2019
longsonr added a commit to longsonr/svgwg that referenced this pull request Aug 31, 2021
JonWBedard pushed a commit to WebKit/WebKit that referenced this pull request Nov 29, 2022
…with the latest specification

https://bugs.webkit.org/show_bug.cgi?id=169176

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Re-sync web-platform tests from upstream after:
- web-platform-tests/wpt#5043
- web-platform-tests/wpt#5044

* web-platform-tests/dom/events/CustomEvent-expected.txt:
* web-platform-tests/dom/events/CustomEvent.html:
* web-platform-tests/dom/events/Event-initEvent-expected.txt:
* web-platform-tests/dom/events/Event-initEvent.html:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/interfaces.html:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/dom/interfaces.html:
* web-platform-tests/html/dom/resources/interfaces.idl: Copied from LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces.html.
* web-platform-tests/html/dom/resources/untested-interfaces.idl: Added.
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor-expected.txt: Removed.
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.html: Removed.
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https-expected.txt:
* web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https.html:

Source/WebCore:

Align initEvent / initCustomEvent / initMessageEvent with the latest specification
after:
- whatwg/dom#417
- whatwg/html#2410

In particular, the following changes were made:
- initEvent: The length property now properly returns 1 instead of 3 as only the
  first parameter is mandatory. We were already behaving correcting the the length
  property value was wrong because we forgot to drop a hack from the bindings
  generator.
- initCustomEvent: Make all parameters except the first optional. Previously, all
  parameters were mandatory so this is safe.
- initMessageEvent: Drop the custom code and mark the first parameter as mandatory.
  A side effect of dropping the custom code is that null is no longer considered as
  valid input for the last parameter. The parameter is of type sequence<> and the
  new behavior is consistent with the specification and Firefox. If it turns out to
  break existing content, I'll make the parameter nullable in a follow-up.

No new tests, updated existing tests.

* bindings/js/JSMessageEventCustom.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePropertiesHashTable):
* dom/CustomEvent.idl:
* dom/MessageEvent.idl:

LayoutTests:

Updated existing tests to reflect behavior change.

* fast/events/init-events-expected.txt:
* fast/events/script-tests/init-events.js:
* fast/eventsource/eventsource-attribute-listeners.html:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants