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

Add tests for Event.srcElement and Event.returnValue #10258

Merged
merged 2 commits into from Apr 9, 2018

Conversation

Projects
None yet
5 participants
@miketaylr
Copy link
Contributor

miketaylr commented Mar 30, 2018

(these tests were already r+'d in #4790, but splitting them out from the window.event stuff so they can land independent of that).

r? @annevk

@w3c-bots

This comment has been minimized.

Copy link

w3c-bots commented Mar 30, 2018

Build PASSED

Started: 2018-03-30 21:40:02
Finished: 2018-03-30 22:09:31

View more information about this build on:

@annevk

annevk approved these changes Apr 3, 2018

Copy link
Member

annevk left a comment

Seems there is some duplication, but generally seems fine.

@@ -8,6 +8,7 @@

<h1>DOM IDL tests</h1>
<div id=log></div>

This comment has been minimized.

@annevk

annevk Apr 3, 2018

Member

Maybe not touch this?

miketaylr added a commit to miketaylr/dom that referenced this pull request Apr 5, 2018

miketaylr added a commit to miketaylr/dom that referenced this pull request Apr 5, 2018

miketaylr added a commit to miketaylr/dom that referenced this pull request Apr 6, 2018

@annevk annevk force-pushed the miketaylr/dom/625 branch from 795381e to 17ca4be Apr 9, 2018

@annevk

This comment has been minimized.

Copy link
Member

annevk commented Apr 9, 2018

Addressed my own nit.

annevk added a commit to miketaylr/dom that referenced this pull request Apr 9, 2018

Define Event's srcElement and returnValue
Unfortunately the web depends on these. They are intentionally
defined in such a way to not offer capabilities beyond the
non-historical API for events.

Tests: web-platform-tests/wpt#10258.

Fixes whatwg#625.

annevk added a commit to miketaylr/dom that referenced this pull request Apr 9, 2018

Define Event's srcElement and returnValue
Unfortunately the web depends on these. They are intentionally
defined in such a way to not offer capabilities beyond the
non-historical API for events.

Tests: web-platform-tests/wpt#10258.

Fixes whatwg#625 and fixes whatwg#627.
@annevk

This comment has been minimized.

Copy link
Member

annevk commented Apr 9, 2018

Hmm, these tests cause harness failures due to not wrapping the listeners appropriately.

@annevk annevk force-pushed the miketaylr/dom/625 branch from 17ca4be to 22ee639 Apr 9, 2018

@annevk

This comment has been minimized.

Copy link
Member

annevk commented Apr 9, 2018

Fixed that.

@annevk annevk removed the do not merge yet label Apr 9, 2018

@annevk annevk merged commit 24f49ff into master Apr 9, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@annevk annevk deleted the miketaylr/dom/625 branch Apr 9, 2018

annevk added a commit to whatwg/dom that referenced this pull request Apr 9, 2018

Define Event's srcElement and returnValue
Unfortunately the web depends on these. They are intentionally
defined in such a way to not offer capabilities beyond the
non-historical API for events.

Tests: web-platform-tests/wpt#10258.

Fixes #625 and fixes #627.

hubot pushed a commit to WebKit/webkit that referenced this pull request Apr 16, 2018

cdumez@apple.com
Change Event's returnValue so it doesn't expose a new primitive
https://bugs.webkit.org/show_bug.cgi?id=184415

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Import test coverage from web-platform-tests/wpt#10258.

* web-platform-tests/dom/events/AddEventListenerOptions-passive-expected.txt:
* web-platform-tests/dom/events/AddEventListenerOptions-passive.html:
* web-platform-tests/dom/events/Event-constructors.html:
* web-platform-tests/dom/events/Event-defaultPrevented-after-dispatch-expected.txt:
* web-platform-tests/dom/events/Event-defaultPrevented-after-dispatch.html:
* web-platform-tests/dom/events/Event-defaultPrevented-expected.txt:
* web-platform-tests/dom/events/Event-defaultPrevented.html:
* web-platform-tests/dom/events/Event-dispatch-click.html:
* web-platform-tests/dom/events/Event-dispatch-detached-click.html:
* web-platform-tests/dom/events/Event-dispatch-other-document.html:
* web-platform-tests/dom/events/Event-initEvent.html:
* web-platform-tests/dom/events/Event-returnValue-expected.txt: Added.
* web-platform-tests/dom/events/Event-returnValue.html: Added.
* web-platform-tests/dom/events/EventListener-handleEvent.html:
* web-platform-tests/dom/events/EventTarget-dispatchEvent-returnvalue-expected.txt:
* web-platform-tests/dom/events/EventTarget-dispatchEvent-returnvalue.html:
* web-platform-tests/dom/events/w3c-import.log:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/interfaces/dom.idl:

Source/WebCore:

Update Event.returnValue setter to match the latest DOM specification after:
- whatwg/dom#626

In particular, the returnValue setter is now a no-op if the new flag value
is true. If the input flag value is false, it only sets the 'canceled' flag
if the event is cancelable and the event’s in passive listener flag is unset.

Test: imported/w3c/web-platform-tests/dom/events/Event-returnValue.html

* dom/Event.cpp:
(WebCore::Event::setLegacyReturnValue):
(WebCore::Event::setCanceledFlagIfPossible):
(WebCore::Event::preventDefault):
* dom/Event.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@230664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.