diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-06-26 13:53:12 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-06-26 13:53:12 +0200 |
commit | a7bc62dcfe5495c8b53532c1b585af07171b4403 (patch) | |
tree | 40856bf1ba28f0c304d86769519ec52821605c39 /widget/WidgetEventImpl.cpp | |
parent | 783f57d74b0caf84cec01a0ae43a2a8cb8697673 (diff) | |
download | UXP-a7bc62dcfe5495c8b53532c1b585af07171b4403.tar UXP-a7bc62dcfe5495c8b53532c1b585af07171b4403.tar.gz UXP-a7bc62dcfe5495c8b53532c1b585af07171b4403.tar.lz UXP-a7bc62dcfe5495c8b53532c1b585af07171b4403.tar.xz UXP-a7bc62dcfe5495c8b53532c1b585af07171b4403.zip |
Issue #12 Part 2: Stop using nsIDOMEvent in IsAcceptableInputEvent.
Diffstat (limited to 'widget/WidgetEventImpl.cpp')
-rw-r--r-- | widget/WidgetEventImpl.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/widget/WidgetEventImpl.cpp b/widget/WidgetEventImpl.cpp index 7dd292cb0..59c80672b 100644 --- a/widget/WidgetEventImpl.cpp +++ b/widget/WidgetEventImpl.cpp @@ -12,6 +12,7 @@ #include "mozilla/Preferences.h" #include "mozilla/TextEvents.h" #include "mozilla/TouchEvents.h" +#include "nsIDOMEventTarget.h" #include "nsPrintfCString.h" namespace mozilla { @@ -411,6 +412,39 @@ WidgetEvent::IsAllowedToDispatchDOMEvent() const } /****************************************************************************** + * mozilla::WidgetEvent + * + * Misc methods. + ******************************************************************************/ + +static dom::EventTarget* +GetTargetForDOMEvent(nsIDOMEventTarget* aTarget) +{ + return aTarget ? aTarget->GetTargetForDOMEvent() : nullptr; +} + +dom::EventTarget* +WidgetEvent::GetDOMEventTarget() const +{ + return GetTargetForDOMEvent(mTarget); +} + +dom::EventTarget* +WidgetEvent::GetCurrentDOMEventTarget() const +{ + return GetTargetForDOMEvent(mCurrentTarget); +} + +dom::EventTarget* +WidgetEvent::GetOriginalDOMEventTarget() const +{ + if (mOriginalTarget) { + return GetTargetForDOMEvent(mOriginalTarget); + } + return GetDOMEventTarget(); +} + +/****************************************************************************** * mozilla::WidgetInputEvent ******************************************************************************/ |