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
Merged

Conversation

miketaylr
Copy link
Member

@miketaylr 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

@ghost
Copy link

ghost 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:

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems there is some duplication, but generally seems fine.

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

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not touch this?

miketaylr pushed a commit to miketaylr/dom that referenced this pull request Apr 5, 2018
miketaylr pushed a commit to miketaylr/dom that referenced this pull request Apr 5, 2018
miketaylr pushed a commit to miketaylr/dom that referenced this pull request Apr 6, 2018
@annevk
Copy link
Member

annevk commented Apr 9, 2018

Addressed my own nit.

annevk pushed a commit to miketaylr/dom that referenced this pull request Apr 9, 2018
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 pushed a commit to miketaylr/dom that referenced this pull request Apr 9, 2018
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
Copy link
Member

annevk commented Apr 9, 2018

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

@annevk
Copy link
Member

annevk commented Apr 9, 2018

Fixed that.

@annevk annevk merged commit 24f49ff into master Apr 9, 2018
@annevk annevk deleted the miketaylr/dom/625 branch April 9, 2018 10:46
annevk pushed a commit to whatwg/dom that referenced this pull request Apr 9, 2018
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-http that referenced this pull request Apr 16, 2018
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
pull bot pushed a commit to Yannic/chromium that referenced this pull request Jan 6, 2021
srcElement and returnValue were specified in [1] and have WPTs in [2].

cancelBubble is documented in [3] and has a WPT which passes in all
browsers in [4].

[1] whatwg/dom#407
[2] web-platform-tests/wpt#10258
[3] https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelBubble
[4] https://wpt.fyi/results/dom/events/Event-cancelBubble.html

Fixed: 692695
Change-Id: Ia7113a9996a0e272829a3e81bf751412444e9ba8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2610947
Reviewed-by: Mason Freed <masonfreed@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840397}
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this pull request Oct 14, 2022
srcElement and returnValue were specified in [1] and have WPTs in [2].

cancelBubble is documented in [3] and has a WPT which passes in all
browsers in [4].

[1] whatwg/dom#407
[2] web-platform-tests/wpt#10258
[3] https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelBubble
[4] https://wpt.fyi/results/dom/events/Event-cancelBubble.html

Fixed: 692695
Change-Id: Ia7113a9996a0e272829a3e81bf751412444e9ba8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2610947
Reviewed-by: Mason Freed <masonfreed@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840397}
GitOrigin-RevId: 3de46b6619a24531b2277b243ac39484a8ca5505
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants