Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Issue 329223004: [DeprecateAs] if call addEventListener or removeEventListener without enough arguments

Created:
6 years, 6 months ago by Nils Barth (inactive)
Modified:
6 years, 6 months ago
Reviewers:
haraken, tkent, Tab Atkins
CC:
blink-reviews, watchdog-blink-watchlist_google.com, blink-reviews-bindings_chromium.org, arv+blink, Inactive, abarth-chromium, tkent
Visibility:
Public.

Description

[DeprecateAs] if call addEventListener or removeEventListener without enough arguments No changes to behavior, other than adding a deprecation message. Also, must run: update_use_counter_feature_enum.py in: chromium/src/tools/metrics/histograms/ to update the UMA mapping. This adds [DeprecateAs] to deprecated behavior, per suggestion of Tab: https://codereview.chromium.org/329053002/#msg5 Also updates IDL (EventListener args are nullable). For background, see: Throw TypeError when addEventListener or removeEventListener are called without enough arguments https://codereview.chromium.org/329053002/ Current behavior (not throwing a TypeError) was for compatibility in 2012. WebKit bug specifically special-casing this in JavaScriptCore bindings is: [JSC] Regression: addEventListener() and removeEventListener() raise an exception on missing args https://bugs.webkit.org/show_bug.cgi?id=85928 WebKit/Safari also has legacy behavior (matches current Blink/Chrome): "For compatibility with legacy content, the EventListener calls are generated without GenerateArgumentsCountCheck." http://trac.webkit.org/browser/trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm#L2823 However, IE and Firefox *do* throw (correctly), and this discrepancy is causing compatibility problems: removeEventListener with only one passed parameter... http://lists.w3.org/Archives/Public/public-script-coord/2014AprJun/0166.html Thus we'd like to align with other browsers and spec, but not break legacy content, hence a [DeprecateAs] to measure first. R=haraken BUG=353484 TEST=fast/dom/event-target-arguments.html TEST=fast/dom/node-legacy-event-listener.html TEST=fast/dom/Window/window-legacy-event-listener.html TEST=fast/dom/XMLHttpRequest-legacy-event-listener.html

Patch Set 1 #

Patch Set 2 : Move ext attr to interface #

Total comments: 2

Patch Set 3 : Revised, remove cleanup #

Patch Set 4 : Fix typo #

Patch Set 5 : Comment fix #

Patch Set 6 : Test update/simplification #

Total comments: 4

Patch Set 7 : Fix counter #

Patch Set 8 : Rebased #

Patch Set 9 : Update use counter #

Patch Set 10 : Fix template condition #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -38 lines) Patch
M LayoutTests/fast/dom/Window/window-legacy-event-listener-expected.txt View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/fast/dom/XMLHttpRequest-legacy-event-listener-expected.txt View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/fast/dom/event-target-arguments.html View 1 2 3 4 5 2 chunks +0 lines, -14 lines 0 comments Download
M LayoutTests/fast/dom/event-target-arguments-expected.txt View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/fast/dom/node-legacy-event-listener-expected.txt View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/scripts/v8_interface.py View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -4 lines 0 comments Download
M Source/bindings/scripts/v8_methods.py View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -4 lines 0 comments Download
M Source/bindings/scripts/v8_types.py View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M Source/bindings/templates/interface.cpp View 1 2 3 4 5 6 7 8 3 chunks +3 lines, -3 lines 0 comments Download
M Source/bindings/templates/methods.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -6 lines 0 comments Download
M Source/core/events/EventTarget.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/events/EventTarget.idl View 1 2 1 chunk +17 lines, -5 lines 0 comments Download
M Source/core/frame/UseCounter.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/frame/UseCounter.cpp View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
Nils Barth (inactive)
[DeprecateAs] instead of removing, to avoid breaking content.
6 years, 6 months ago (2014-06-12 02:08:36 UTC) #1
haraken
https://codereview.chromium.org/329223004/diff/20001/Source/bindings/templates/methods.cpp File Source/bindings/templates/methods.cpp (right): https://codereview.chromium.org/329223004/diff/20001/Source/bindings/templates/methods.cpp#newcode24 Source/bindings/templates/methods.cpp:24: {% if is_check_security_for_window %} It doesn't make sense to ...
6 years, 6 months ago (2014-06-12 02:15:45 UTC) #2
Nils Barth (inactive)
Revised to remove the cleanup, which is distracting; instead opened bug and added FIXMEs. https://codereview.chromium.org/329223004/diff/20001/Source/bindings/templates/methods.cpp ...
6 years, 6 months ago (2014-06-12 02:51:52 UTC) #3
haraken
https://codereview.chromium.org/329223004/diff/100001/Source/bindings/scripts/v8_methods.py File Source/bindings/scripts/v8_methods.py (right): https://codereview.chromium.org/329223004/diff/100001/Source/bindings/scripts/v8_methods.py#newcode94 Source/bindings/scripts/v8_methods.py:94: if argument.idl_type.name == 'EventListenerOrNull') Shouldn't this be: if argument.idl_type.name ...
6 years, 6 months ago (2014-06-12 04:23:23 UTC) #4
Nils Barth (inactive)
https://codereview.chromium.org/329223004/diff/100001/Source/bindings/scripts/v8_methods.py File Source/bindings/scripts/v8_methods.py (right): https://codereview.chromium.org/329223004/diff/100001/Source/bindings/scripts/v8_methods.py#newcode94 Source/bindings/scripts/v8_methods.py:94: if argument.idl_type.name == 'EventListenerOrNull') On 2014/06/12 04:23:23, haraken wrote: ...
6 years, 6 months ago (2014-06-12 04:55:40 UTC) #5
haraken
Thanks for the clarification. LGTM.
6 years, 6 months ago (2014-06-12 06:00:17 UTC) #6
haraken
On 2014/06/12 06:00:17, haraken wrote: > Thanks for the clarification. LGTM. I want to have ...
6 years, 6 months ago (2014-06-12 06:00:41 UTC) #7
Nils Barth (inactive)
On 2014/06/12 06:00:41, haraken wrote: > On 2014/06/12 06:00:17, haraken wrote: > > Thanks for ...
6 years, 6 months ago (2014-06-12 06:01:32 UTC) #8
Tab Atkins
On 2014/06/12 06:01:32, Nils Barth wrote: > On 2014/06/12 06:00:41, haraken wrote: > > On ...
6 years, 6 months ago (2014-06-12 18:30:29 UTC) #9
Nils Barth (inactive)
On 2014/06/12 18:30:29, Tab Atkins wrote: > LGTM, though I'm also fine with just removing ...
6 years, 6 months ago (2014-06-23 10:09:46 UTC) #10
Nils Barth (inactive)
On 2014/06/23 10:09:46, Nils Barth wrote: > On 2014/06/12 18:30:29, Tab Atkins wrote: > > ...
6 years, 6 months ago (2014-06-24 04:50:54 UTC) #11
tkent
lgtm
6 years, 6 months ago (2014-06-24 05:12:22 UTC) #12
Nils Barth (inactive)
The CQ bit was checked by nbarth@chromium.org
6 years, 6 months ago (2014-06-25 04:11:57 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nbarth@chromium.org/329223004/150001
6 years, 6 months ago (2014-06-25 04:13:01 UTC) #14
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_blink_compile_dbg on tryserver.blink ...
6 years, 6 months ago (2014-06-25 05:32:07 UTC) #15
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-25 05:40:36 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_chromium_gn_rel/builds/1574)
6 years, 6 months ago (2014-06-25 05:40:37 UTC) #17
Nils Barth (inactive)
The CQ bit was checked by nbarth@chromium.org
6 years, 6 months ago (2014-06-25 07:54:01 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nbarth@chromium.org/329223004/170001
6 years, 6 months ago (2014-06-25 07:54:36 UTC) #19
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_blink_dbg on tryserver.blink ...
6 years, 6 months ago (2014-06-25 09:09:44 UTC) #20
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-25 09:38:21 UTC) #21
commit-bot: I haz the power
6 years, 6 months ago (2014-06-25 09:38:22 UTC) #22
Try jobs failed on following builders:
  linux_blink_rel on tryserver.blink
(http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/1...)

Powered by Google App Engine
This is Rietveld 408576698