Closed Bug 851073 Opened 11 years ago Closed 11 years ago

Move MouseEvent to Web IDL

Categories

(Core :: DOM: Events, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

Attachments

(1 file)

      No description provided.
Attached patch Patch (v1)Splinter Review
Attachment #725018 - Flags: review?(bugs)
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+
(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.
(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
Closed: 11 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.

Attachment

General

Created:
Updated:
Size: