Closed
Bug 930860
Opened 11 years ago
Closed 11 years ago
Move some methods in WidgetEvent to WidgetMouseEvent
Categories
(Core :: Widget, defect)
Core
Widget
Tracking
()
RESOLVED
FIXED
mozilla27
People
(Reporter: masayuki, Assigned: masayuki)
Details
Attachments
(1 file)
30.82 KB,
patch
|
roc
:
review+
smaug
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•11 years ago
|
||
From smaug's request, I wrote this.
However, at reading around the callers, this patch just makes the code complicated.
Indeed, the WidgetEvent becomes simple, but I don't feel this is good change.
Requesting to review to both roc and smaug.
Attachment #822264 -
Flags: review?(roc)
Attachment #822264 -
Flags: review?(bugs)
Comment 2•11 years ago
|
||
Well, if IsLeftClickEvent and IsContextMenuKeyEvent are in the WidgetEvent, so should
IsAlt & co. Or if those aren't there, then IsLeftClickEvent and IsContextMenuKeyEvent should be in
the right class, not in the base class.
So basically, whatever we do, let's do it consistently :)
Comment on attachment 822264 [details] [diff] [review]
Move IsLeftClickEvent() and IsContextMenuKeyEvent() from WidgetEvent to WidgetMouseEvent(Base)
Review of attachment 822264 [details] [diff] [review]:
-----------------------------------------------------------------
I think we should do this.
Attachment #822264 -
Flags: review?(roc) → review+
Comment 4•11 years ago
|
||
Comment on attachment 822264 [details] [diff] [review]
Move IsLeftClickEvent() and IsContextMenuKeyEvent() from WidgetEvent to WidgetMouseEvent(Base)
Might be useful to have IsFooBarEvent() in the base event and if that returns
true event->AsFooBarEvent()->DoSomething would be ok.
Attachment #822264 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 5•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/b9d18faa1a97
(In reply to Olli Pettay [:smaug] from comment #4)
> Might be useful to have IsFooBarEvent() in the base event and if that returns
> true event->AsFooBarEvent()->DoSomething would be ok.
Do you think that IsFooBarEvent() returns true even if the eventStructType doesn't exactly match? I.e., the implementation becomes |return AsFooBarEvent() != nullptr;|? If so, it's same as |event->AsFooBarEvent() && event->AsFooBarEvent()->DoSomething()|.
If you think that IsForBarEvent() returns true only when eventStructType exactly match, I love them. See this post:
https://groups.google.com/d/msg/mozilla.dev.platform/cHg_ExqEC_U/adfrnWQUB7cJ
Comment 6•11 years ago
|
||
IsFooBarEvent() should return true it the event is FooBar or extends FooBar.
That is what DOM code does with IsElement() for example.
Assignee | ||
Comment 7•11 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #6)
> IsFooBarEvent() should return true it the event is FooBar or extends FooBar.
> That is what DOM code does with IsElement() for example.
Hmm, then, I don't think that we need to implement them because they just do AsFooBarEvent() != nullptr...
Comment 8•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•11 years ago
|
Target Milestone: mozilla28 → mozilla27
You need to log in
before you can comment on or make changes to this bug.
Description
•