Move MouseEvent to Web IDL

RESOLVED FIXED in mozilla22

Status

()

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

Trunk
mozilla22
x86
Mac OS X
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Comment hidden (empty)
(Assignee)

Comment 1

6 years ago
Created attachment 725018 [details] [diff] [review]
Patch (v1)
Attachment #725018 - Flags: review?(bugs)

Comment 3

6 years ago
Comment on attachment 725018 [details] [diff] [review]
Patch (v1)


>-    CallQueryInterface(relatedTarget, aRelatedTarget);
>+    if (relatedTarget) {
>+      relatedTarget = do_QueryInterface(relatedTarget->GetTargetForDOMEvent());
>+    }
I believe this got fixed, so that you get mozilla::dom::EventTarget from GetTargetForDOMEvent()


>+  void InitMouseEvent(const nsAString & aType, bool aCanBubble, bool aCancelable,
>+                      nsIDOMWindow* aView, int32_t aDetail, int32_t aScreenX,
>+                      int32_t aScreenY, int32_t aClientX, int32_t aClientY,
>+                      bool aCtrlKey, bool aAltKey, bool aShiftKey,
>+                      bool aMetaKey, uint16_t aButton, nsIDOMEventTarget *aRelatedTarget,
Hmm, shouldn't that be mozilla::dom::EventTarget* aRelatedTarget

>+  void InitNSMouseEvent(const nsAString & aType, bool aCanBubble, bool aCancelable,
>+                        nsIDOMWindow *aView, int32_t aDetail, int32_t aScreenX,
>+                        int32_t aScreenY, int32_t aClientX, int32_t aClientY,
>+                        bool aCtrlKey, bool aAltKey, bool aShiftKey,
>+                        bool aMetaKey, uint16_t aButton, nsIDOMEventTarget *aRelatedTarget,
>+                        float aPressure, uint16_t aInputSource,
>+                        mozilla::ErrorResult& aRv)

Same here


>+++ b/dom/bindings/Bindings.conf
>@@ -284,16 +284,17 @@ DOMInterfaces = {
> {
>     'workers': True,
> }],
> 
> 'EventTarget': [
> {
>     'hasXPConnectImpls': True,
>     'concrete': False,
>+    'headerFile': 'EventTarget.h'
This shouldn't be needed.

>+// Event Constructor Syntax:
>+[Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)]
>+partial interface MouseEvent
>+{
>+};
Not sure we need this partial interface... but it is that way in DOM 4 events draft

>+
>+// Suggested initMouseEvent replacement initializer:
>+dictionary MouseEventInit {
>+  // Attributes from Event:
>+  boolean        bubbles       = false;
>+  boolean        cancelable    = false;
>+
>+  // Attributes from UIEvent:
>+  WindowProxy?  view          = null;
add a space before 'view'
Attachment #725018 - Flags: review?(bugs) → review+
(Assignee)

Comment 4

6 years ago
(In reply to Olli Pettay [:smaug] from comment #3)
> Comment on attachment 725018 [details] [diff] [review]
> Patch (v1)
> 
> 
> >-    CallQueryInterface(relatedTarget, aRelatedTarget);
> >+    if (relatedTarget) {
> >+      relatedTarget = do_QueryInterface(relatedTarget->GetTargetForDOMEvent());
> >+    }
> I believe this got fixed, so that you get mozilla::dom::EventTarget from
> GetTargetForDOMEvent()

OK, nice.

> >+  void InitMouseEvent(const nsAString & aType, bool aCanBubble, bool aCancelable,
> >+                      nsIDOMWindow* aView, int32_t aDetail, int32_t aScreenX,
> >+                      int32_t aScreenY, int32_t aClientX, int32_t aClientY,
> >+                      bool aCtrlKey, bool aAltKey, bool aShiftKey,
> >+                      bool aMetaKey, uint16_t aButton, nsIDOMEventTarget *aRelatedTarget,
> Hmm, shouldn't that be mozilla::dom::EventTarget* aRelatedTarget

Hmm, yeah I guess so.

> >+++ b/dom/bindings/Bindings.conf
> >@@ -284,16 +284,17 @@ DOMInterfaces = {
> > {
> >     'workers': True,
> > }],
> > 
> > 'EventTarget': [
> > {
> >     'hasXPConnectImpls': True,
> >     'concrete': False,
> >+    'headerFile': 'EventTarget.h'
> This shouldn't be needed.

It is, since the default would be mozilla/dom/EventTarget.h, and that's not where this header is exported.
(Assignee)

Comment 5

6 years ago
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #4)
> > >+++ b/dom/bindings/Bindings.conf
> > >@@ -284,16 +284,17 @@ DOMInterfaces = {
> > > {
> > >     'workers': True,
> > > }],
> > > 
> > > 'EventTarget': [
> > > {
> > >     'hasXPConnectImpls': True,
> > >     'concrete': False,
> > >+    'headerFile': 'EventTarget.h'
> > This shouldn't be needed.
> 
> It is, since the default would be mozilla/dom/EventTarget.h, and that's not
> where this header is exported.

Oh I see that has changed since I wrote this patch.  :-)
https://hg.mozilla.org/mozilla-central/rev/b66cea2dc7d2
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.