Closed
Bug 1455076
Opened 7 years ago
Closed 7 years ago
Port Bug 1455055 and bug 1455052 - Replace use of nsIDOMEvent
Categories
(Thunderbird :: General, enhancement)
Thunderbird
General
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 61.0
People
(Reporter: jorgk-bmo, Assigned: jorgk-bmo)
References
Details
Attachments
(2 files)
|
1.88 KB,
patch
|
aceman
:
review+
|
Details | Diff | Splinter Review |
|
1.90 KB,
patch
|
jorgk-bmo
:
review+
bzbarsky
:
feedback+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #1455055 +++
Boris, please adjust the summary as you deem fit. Here I've done what we always do.
| Assignee | ||
Updated•7 years ago
|
Summary: Port |Bug 1455055 - Convert nsIDOMEventListener to taking Event, not nsIDOMEvent| → Port Bug 1455055 - Change HandleEvent(nsIDOMEvent*) to HandleEvent(mozilla::dom::Event*)
| Assignee | ||
Comment 1•7 years ago
|
||
Boris, could you kindly take a look what we need to do here:
https://dxr.mozilla.org/comm-central/search?q=nsIDOMEvent&redirect=false
im/ is dead-code, so we only have
mail/test/resources/mozmill/mozmill/extension/content/stdlib/EventUtils.js
187 const masks = Ci.nsIDOMEvent;
which would need replacement when nsIDOMEvent is removed, which is about now.
Would he replacement be:
https://dxr.mozilla.org/comm-central/source/mail/test/resources/mozmill/mozmill/extension/content/stdlib/EventUtils.js#187
if (aEvent.shiftKey)
mval |= masks.SHIFT_MASK;
change to
mval |= aEvent.SHIFT_MASK;
Aceman, could you take care of the EventUtils.js?
Flags: needinfo?(bzbarsky)
Flags: needinfo?(acelists)
| Assignee | ||
Comment 2•7 years ago
|
||
Re-badging the bug now. Disregarding im/, we have exactly one call site:
mail/test/resources/mozmill/mozmill/extension/content/stdlib/EventUtils.js
187 const masks = Ci.nsIDOMEvent;
In suite/ I can only see nsIDOMEventListener, which we removed in bug 1453403.
Summary: Port Bug 1455055 - Change HandleEvent(nsIDOMEvent*) to HandleEvent(mozilla::dom::Event*) → Port Bug 1455055 and bug 1455052 - Replace use of nsIDOMEvent
Comment 3•7 years ago
|
||
So first of all, that search is ... pretty useless. You want a search more like this:
https://searchfox.org/comm-central/search?q=nsIDOMEvent[^a-zA-Z0-9]&case=true®exp=true&path=
Second, you may want to wait for indices to update to the changes I already landed, or do an equivalent grep locally.
Third, you can replace Ci.nsIDOMEvent with Event for purposes of getting constants off it. You may need to Cu.importGlobalProperties(["Event"]) if you're not in window scope.
In general, looks like mail/ is set except for that mask thing (which will likely break at some point in the future when those nonstandard mask constants go away). im/ will need changes to C++ code to use Event instead of nsIDOMEvent. suite/ has the one use in nsTypeAheadFind.js that can use aEvent.CAPTURING_PHASE if that's a real event, or import Event and use Event.CAPTURING_PHASE.
Flags: needinfo?(bzbarsky)
| Assignee | ||
Comment 4•7 years ago
|
||
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Flags: needinfo?(acelists)
Attachment #8969832 -
Flags: review?(acelists)
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/e3a8338a8df4
Port bug 1455052: Remove use of nsIDOMEvent and hard-code mask values. rs=bustage-fix CLOSED TREE
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•7 years ago
|
Target Milestone: --- → Thunderbird 61.0
(In reply to Boris Zbarsky [:bz] (no decent commit message means r-) from comment #3)
> In general, looks like mail/ is set except for that mask thing (which will
> likely break at some point in the future when those nonstandard mask
> constants go away).
Thanks, so what would be the proper standard way to get the constants?
Flags: needinfo?(bzbarsky)
| Assignee | ||
Comment 7•7 years ago
|
||
I think there is a misunderstanding here. The "proper" way, as I understand it, is to use
Cu.importGlobalProperties(["Event"])
and get them from 'Event'.
I chose not to do that since we might as well hard-code them as we have done on other occasions (like Ci.nsIDOMXPathResult.NUMBER_TYPE, IIRC:
https://dxr.mozilla.org/comm-central/rev/8d636ad5810b5586433294c16cb2376d826fcca8/calendar/base/modules/utils/calXMLUtils.jsm#36
The worry is that the entire concept of those masks might disappear as Boris indicated. Also see the code here:
https://searchfox.org/mozilla-central/rev/14578d6f2d2ec5246572827061ecefa60a40855d/dom/webidl/Event.webidl#63
// Mozilla specific legacy stuff.
What about this? Modeled after the m-c version of the function at
https://dxr.mozilla.org/comm-central/rev/5ded36cb383d3ccafd9b6c231c5120dcdae196a2/mozilla/testing/mochitest/tests/SimpleTest/EventUtils.js#335
Attachment #8969915 -
Flags: review?(jorgk)
Attachment #8969915 -
Flags: feedback?(bzbarsky)
Comment on attachment 8969832 [details] [diff] [review]
1455076-remove-nsIDOMEvent.patch
Review of attachment 8969832 [details] [diff] [review]:
-----------------------------------------------------------------
OK as a quick fix, but we should try to find the proper way without hardcoding magic constants.
Attachment #8969832 -
Flags: review?(acelists) → review+
| Assignee | ||
Comment 10•7 years ago
|
||
Comment on attachment 8969915 [details] [diff] [review]
1455076.patch - use nsIDomWindowUtils.
I hope Boris doesn't axe nsIDOMWindowUtils next week ;-)
I think we'll wait with the check-in until we hear from him.
Attachment #8969915 -
Flags: review?(jorgk) → review+
Comment 11•7 years ago
|
||
> Thanks, so what would be the proper standard way to get the constants?
What constants? There is no proper standard way to get the event *_MASK constants because there is no standard reason for them to exist. There is no information on events that relies on those constants in any way.
Note bug 674696 which tracks removing various stuff including these constants.
Flags: needinfo?(bzbarsky)
Comment 12•7 years ago
|
||
Comment on attachment 8969915 [details] [diff] [review]
1455076.patch - use nsIDomWindowUtils.
This seems fine, if the only point of this function is to create a modifier mask for calling nsIDOMWindowUtils.sendMouseEvent.
Attachment #8969915 -
Flags: feedback?(bzbarsky) → feedback+
Comment 13•7 years ago
|
||
(In reply to Boris Zbarsky [:bz] (no decent commit message means r-) from comment #12)
> This seems fine, if the only point of this function is to create a modifier
> mask for calling nsIDOMWindowUtils.sendMouseEvent.
Yes, that is the case in mozmill. Thanks.
Comment 14•7 years ago
|
||
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/b6cce393a6ac
Use nsIDOMWindowUtils instead of nsIDOMEvent to get modifiers in EventUtils.js. r=jorgk
Keywords: checkin-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•