From 80f9b75efa08ea449937298b791ff278cbf5fa22 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 4 Feb 2018 23:15:50 +0100 Subject: Implement auxclick Bug(s): https://bugzilla.mozilla.org/show_bug.cgi?id=1304044 (native in moebius) --- dom/events/EventNameList.h | 4 ++ dom/events/EventStateManager.cpp | 66 ++++++++++------- dom/events/EventStateManager.h | 10 ++- dom/events/WheelHandlingHelper.cpp | 1 + dom/events/test/mochitest.ini | 1 + dom/events/test/test_bug1304044.html | 133 +++++++++++++++++++++++++++++++++++ 6 files changed, 189 insertions(+), 26 deletions(-) create mode 100644 dom/events/test/test_bug1304044.html (limited to 'dom/events') diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index b1be6dd76..d66c20b4b 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -164,6 +164,10 @@ EVENT(change, eFormChange, EventNameType_HTMLXUL, eBasicEventClass) +EVENT(auxclick, + eMouseAuxClick, + EventNameType_All, + eMouseEventClass) EVENT(click, eMouseClick, EventNameType_All, diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 659629066..25bf96078 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -492,6 +492,7 @@ IsMessageMouseUserActivity(EventMessage aMessage) return aMessage == eMouseMove || aMessage == eMouseUp || aMessage == eMouseDown || + aMessage == eMouseAuxClick || aMessage == eMouseDoubleClick || aMessage == eMouseClick || aMessage == eMouseActivate || @@ -4645,6 +4646,32 @@ EventStateManager::SetClickCount(WidgetMouseEvent* aEvent, return NS_OK; } +nsresult +EventStateManager::InitAndDispatchClickEvent(WidgetMouseEvent* aEvent, + nsEventStatus* aStatus, + EventMessage aMessage, + nsIPresShell* aPresShell, + nsIContent* aMouseTarget, + nsWeakFrame aCurrentTarget, + bool aNoContentDispatch) +{ + WidgetMouseEvent event(aEvent->IsTrusted(), aMessage, + aEvent->mWidget, WidgetMouseEvent::eReal); + + event.mRefPoint = aEvent->mRefPoint; + event.mClickCount = aEvent->mClickCount; + event.mModifiers = aEvent->mModifiers; + event.buttons = aEvent->buttons; + event.mTime = aEvent->mTime; + event.mTimeStamp = aEvent->mTimeStamp; + event.mFlags.mNoContentDispatch = aNoContentDispatch; + event.button = aEvent->button; + event.inputSource = aEvent->inputSource; + + return aPresShell->HandleEventWithTarget(&event, aCurrentTarget, + aMouseTarget, aStatus); +} + nsresult EventStateManager::CheckForAndDispatchClick(WidgetMouseEvent* aEvent, nsEventStatus* aStatus) @@ -4664,17 +4691,7 @@ EventStateManager::CheckForAndDispatchClick(WidgetMouseEvent* aEvent, (aEvent->button == WidgetMouseEvent::eMiddleButton || aEvent->button == WidgetMouseEvent::eRightButton); - WidgetMouseEvent event(aEvent->IsTrusted(), eMouseClick, - aEvent->mWidget, WidgetMouseEvent::eReal); - event.mRefPoint = aEvent->mRefPoint; - event.mClickCount = aEvent->mClickCount; - event.mModifiers = aEvent->mModifiers; - event.buttons = aEvent->buttons; - event.mTime = aEvent->mTime; - event.mTimeStamp = aEvent->mTimeStamp; - event.mFlags.mNoContentDispatch = notDispatchToContents; - event.button = aEvent->button; - event.inputSource = aEvent->inputSource; + bool fireAuxClick = notDispatchToContents; nsCOMPtr presShell = mPresContext->GetPresShell(); if (presShell) { @@ -4693,23 +4710,22 @@ EventStateManager::CheckForAndDispatchClick(WidgetMouseEvent* aEvent, // HandleEvent clears out mCurrentTarget which we might need again nsWeakFrame currentTarget = mCurrentTarget; - ret = presShell->HandleEventWithTarget(&event, currentTarget, - mouseContent, aStatus); + ret = InitAndDispatchClickEvent(aEvent, aStatus, eMouseClick, + presShell, mouseContent, currentTarget, + notDispatchToContents); + if (NS_SUCCEEDED(ret) && aEvent->mClickCount == 2 && mouseContent && mouseContent->IsInComposedDoc()) { //fire double click - WidgetMouseEvent event2(aEvent->IsTrusted(), eMouseDoubleClick, - aEvent->mWidget, WidgetMouseEvent::eReal); - event2.mRefPoint = aEvent->mRefPoint; - event2.mClickCount = aEvent->mClickCount; - event2.mModifiers = aEvent->mModifiers; - event2.buttons = aEvent->buttons; - event2.mFlags.mNoContentDispatch = notDispatchToContents; - event2.button = aEvent->button; - event2.inputSource = aEvent->inputSource; - - ret = presShell->HandleEventWithTarget(&event2, currentTarget, - mouseContent, aStatus); + ret = InitAndDispatchClickEvent(aEvent, aStatus, eMouseDoubleClick, + presShell, mouseContent, currentTarget, + notDispatchToContents); + } + if (NS_SUCCEEDED(ret) && mouseContent && fireAuxClick && + mouseContent->IsInComposedDoc()) { + ret = InitAndDispatchClickEvent(aEvent, aStatus, eMouseAuxClick, + presShell, mouseContent, currentTarget, + false); } } } diff --git a/dom/events/EventStateManager.h b/dom/events/EventStateManager.h index 49ecf0586..d0461e7fa 100644 --- a/dom/events/EventStateManager.h +++ b/dom/events/EventStateManager.h @@ -415,6 +415,13 @@ protected: */ void UpdateDragDataTransfer(WidgetDragEvent* dragEvent); + static nsresult InitAndDispatchClickEvent(WidgetMouseEvent* aEvent, + nsEventStatus* aStatus, + EventMessage aMessage, + nsIPresShell* aPresShell, + nsIContent* aMouseTarget, + nsWeakFrame aCurrentTarget, + bool aNoContentDispatch); nsresult SetClickCount(WidgetMouseEvent* aEvent, nsEventStatus* aStatus); nsresult CheckForAndDispatchClick(WidgetMouseEvent* aEvent, nsEventStatus* aStatus); @@ -1046,6 +1053,7 @@ private: #define NS_EVENT_NEEDS_FRAME(event) \ (!(event)->HasPluginActivationEventMessage() && \ (event)->mMessage != eMouseClick && \ - (event)->mMessage != eMouseDoubleClick) + (event)->mMessage != eMouseDoubleClick && \ + (event)->mMessage != eMouseAuxClick) #endif // mozilla_EventStateManager_h_ diff --git a/dom/events/WheelHandlingHelper.cpp b/dom/events/WheelHandlingHelper.cpp index 7665ee922..81f2b6bfa 100644 --- a/dom/events/WheelHandlingHelper.cpp +++ b/dom/events/WheelHandlingHelper.cpp @@ -257,6 +257,7 @@ WheelTransaction::OnEvent(WidgetEvent* aEvent) case eMouseUp: case eMouseDown: case eMouseDoubleClick: + case eMouseAuxClick: case eMouseClick: case eContextMenu: case eDrop: diff --git a/dom/events/test/mochitest.ini b/dom/events/test/mochitest.ini index e100e60a1..0397487bb 100644 --- a/dom/events/test/mochitest.ini +++ b/dom/events/test/mochitest.ini @@ -184,3 +184,4 @@ skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM [test_wheel_default_action.html] [test_bug687787.html] [test_bug1298970.html] +[test_bug1304044.html] diff --git a/dom/events/test/test_bug1304044.html b/dom/events/test/test_bug1304044.html new file mode 100644 index 000000000..0911dcf73 --- /dev/null +++ b/dom/events/test/test_bug1304044.html @@ -0,0 +1,133 @@ + + + + + + Test for Bug 1304044 + + + + + + +Mozilla Bug 1304044 +

+

Target
+

+
+ +
+
+
+ + -- cgit v1.2.3 From cf4482199c5b92c5029b79c086cf9f831a87f895 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 14 Mar 2018 08:52:52 +0100 Subject: Bug 1264125: Fire transitioncancel event when a transition is canceled - part 1 (in the description) Issue #55 part 1 - Add transitioncancel event handler part 2 - Add ontransitioncancel EventHandler to WebIDL part 3 - Add member of active time to ComputedTiming --- dom/events/EventNameList.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dom/events') diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index ba2427623..61942b251 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -1003,6 +1003,10 @@ EVENT(transitionend, eTransitionEnd, EventNameType_All, eTransitionEventClass) +EVENT(transitioncancel, + eTransitionCancel, + EventNameType_All, + eTransitionEventClass) EVENT(animationstart, eAnimationStart, EventNameType_All, -- cgit v1.2.3 From aade91b13a50ee4f246016fa8d8d1561f58f80ee Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 14 Mar 2018 11:45:38 +0100 Subject: moebius#89: DOM - implement animationcancel event Issue #55 --- dom/events/EventNameList.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dom/events') diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index 61942b251..00478c87b 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -1019,6 +1019,10 @@ EVENT(animationiteration, eAnimationIteration, EventNameType_All, eAnimationEventClass) +EVENT(animationcancel, + eAnimationCancel, + EventNameType_All, + eAnimationEventClass) // Webkit-prefixed versions of Transition & Animation events, for web compat: EVENT(webkitAnimationEnd, -- cgit v1.2.3 From c58cec26c73da9a5c48f7d75555c6a2409965693 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 14 Mar 2018 11:55:23 +0100 Subject: Bug 1202333: AnimationEvent elapsedTime should reflect playbackRate (added tests) Issue #55 --- dom/events/test/test_legacy_event.html | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'dom/events') diff --git a/dom/events/test/test_legacy_event.html b/dom/events/test/test_legacy_event.html index d772be106..b2105a6df 100644 --- a/dom/events/test/test_legacy_event.html +++ b/dom/events/test/test_legacy_event.html @@ -73,22 +73,15 @@ function triggerShortAnimation(node) { node.style.animation = "anim1 1ms linear"; } -// This function triggers a long animation with two iterations, which is -// *nearly* at the end of its first iteration. It will hit the end of that -// iteration (firing an event) almost immediately, 1ms in the future. +// This function triggers a very short (10ms long) animation with many +// iterations, which will cause a start event followed by an iteration event +// on each subsequent tick, to fire. // -// NOTE: It's important that this animation have a *long* duration. If it were -// short (e.g. 1ms duration), then we might jump past all its iterations in -// a single refresh-driver tick. And if that were to happens, we'd *never* fire -// any animationiteration events -- the CSS Animations spec says this event -// must not be fired "...when an animationend event would fire at the same time" -// (which would be the case in this example with a 1ms duration). So, to make -// sure our event does fire, we use a long duration and a nearly-as-long -// negative delay. This ensures we hit the end of the first iteration right -// away, and that we don't risk hitting the end of the second iteration at the -// same time. +// NOTE: We need the many iterations since if an animation frame coincides +// with the animation starting or ending we dispatch only the start or end +// event and not the iteration event. function triggerAnimationIteration(node) { - node.style.animation = "anim1 300s -299.999s linear 2"; + node.style.animation = "anim1 10ms linear 20000"; } // GENERAL UTILITY FUNCTIONS -- cgit v1.2.3 From 04c7949bc3da9e02e563436d7d772424c5492a69 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Fri, 20 Apr 2018 19:16:00 +0200 Subject: Bug 1317030 - Removing/reattaching an element from the DOM triggers spurious mouseenter events native in moebius --- dom/events/EventStateManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'dom/events') diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index c23cdb575..f66cf3f90 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -4034,7 +4034,7 @@ public: } } - ~EnterLeaveDispatcher() + void Dispatch() { if (mEventMessage == eMouseEnter || mEventMessage == ePointerEnter) { for (int32_t i = mTargets.Count() - 1; i >= 0; --i) { @@ -4119,6 +4119,7 @@ EventStateManager::NotifyMouseOut(WidgetMouseEvent* aMouseEvent, // Fire mouseout DispatchMouseOrPointerEvent(aMouseEvent, isPointer ? ePointerOut : eMouseOut, wrapper->mLastOverElement, aMovingInto); + leaveDispatcher.Dispatch(); wrapper->mLastOverFrame = nullptr; wrapper->mLastOverElement = nullptr; @@ -4193,6 +4194,7 @@ EventStateManager::NotifyMouseOver(WidgetMouseEvent* aMouseEvent, DispatchMouseOrPointerEvent(aMouseEvent, isPointer ? ePointerOver : eMouseOver, aContent, lastOverElement); + enterDispatcher->Dispatch(); wrapper->mLastOverElement = aContent; } else { wrapper->mLastOverFrame = nullptr; -- cgit v1.2.3 From d4feeb474eeedbd9e90356d36bb2ae70dc7808a1 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Fri, 20 Apr 2018 19:44:42 +0200 Subject: Bug 1322994 - Update pointerevent web-platform-tests (partially - depends on) https://github.com/MoonchildProductions/moebius/pull/71 --- ...ercapture_events_to_original_target-manual.html | 41 +++++++++++++++------- 1 file changed, 28 insertions(+), 13 deletions(-) (limited to 'dom/events') diff --git a/dom/events/test/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html b/dom/events/test/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html index f4d5573ed..31fe919af 100644 --- a/dom/events/test/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html +++ b/dom/events/test/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html @@ -1,4 +1,4 @@ - + Pointer Event: releasePointerCapture() - subsequent events follow normal hitting testing mechanisms @@ -14,17 +14,21 @@ +

Pointer Event: releasePointerCapture() - subsequent events follow normal hitting testing mechanisms

- Use mouse, touch or pen to contact here and move around.

Test complete: Scroll to Summary to view Pass/Fail Results.

diff --git a/dom/events/test/pointerevents/test_bug1285128.html b/dom/events/test/pointerevents/test_bug1285128.html index f7f1eb698..9577940c1 100644 --- a/dom/events/test/pointerevents/test_bug1285128.html +++ b/dom/events/test/pointerevents/test_bug1285128.html @@ -13,7 +13,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1285128 Mozilla Bug 1285128

-
+
+
+ + + + +

+ + + diff --git a/dom/events/test/pointerevents/test_pointerevent_capture_suppressing_mouse-manual.html b/dom/events/test/pointerevents/test_pointerevent_capture_suppressing_mouse-manual.html index 5eb631f6a..2b08e2bb8 100644 --- a/dom/events/test/pointerevents/test_pointerevent_capture_suppressing_mouse-manual.html +++ b/dom/events/test/pointerevents/test_pointerevent_capture_suppressing_mouse-manual.html @@ -19,6 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1000870 function executeTest(int_win) { sendMouseEvent(int_win, "target0", "mousemove"); sendMouseEvent(int_win, "target1", "mousemove"); + sendMouseEvent(int_win, "btnCapture", "mousemove"); sendMouseEvent(int_win, "btnCapture", "mousedown"); sendMouseEvent(int_win, "target1", "mousemove"); sendMouseEvent(int_win, "target0", "mousemove"); diff --git a/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_events_to_original_target-manual.html b/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_events_to_original_target-manual.html index cbf91df74..35350e016 100644 --- a/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_events_to_original_target-manual.html +++ b/dom/events/test/pointerevents/test_pointerevent_releasepointercapture_events_to_original_target-manual.html @@ -17,9 +17,30 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1000870 runTestInNewWindow("pointerevent_releasepointercapture_events_to_original_target-manual.html"); } function executeTest(int_win) { - sendTouchEvent(int_win, "target0", "touchstart"); - sendTouchEvent(int_win, "target0", "touchmove"); - sendTouchEvent(int_win, "target0", "touchend"); + // Synthesize mouse events to run this test. + sendMouseEvent(int_win, "target0", "mousemove"); + sendMouseEvent(int_win, "target0", "mousedown"); + sendMouseEvent(int_win, "target0", "mousemove", {buttons: 1}); + sendMouseEvent(int_win, "target0", "mousemove", {buttons: 1}); + sendMouseEvent(int_win, "target0", "mouseup"); + + window.addEventListener("message", function(aEvent) { + if (aEvent.data == "Test Touch") { + // Synthesize touch events to run this test. + sendTouchEvent(int_win, "target0", "touchstart"); + sendTouchEvent(int_win, "target0", "touchmove"); + sendTouchEvent(int_win, "target0", "touchend"); + window.postMessage("Test Pen", "*"); + } else if (aEvent.data == "Test Pen") { + // Synthesize pen events to run this test. + sendMouseEvent(int_win, "target0", "mousemove", {inputSource:MouseEvent.MOZ_SOURCE_PEN}); + sendMouseEvent(int_win, "target0", "mousedown", {inputSource:MouseEvent.MOZ_SOURCE_PEN}); + sendMouseEvent(int_win, "target0", "mousemove", {inputSource:MouseEvent.MOZ_SOURCE_PEN, buttons: 1}); + sendMouseEvent(int_win, "target0", "mousemove", {inputSource:MouseEvent.MOZ_SOURCE_PEN, buttons: 1}); + sendMouseEvent(int_win, "target0", "mouseup", {inputSource:MouseEvent.MOZ_SOURCE_PEN}); + } + }); + window.postMessage("Test Touch", "*"); } diff --git a/dom/events/test/pointerevents/test_pointerevent_setpointercapture_relatedtarget-manual.html b/dom/events/test/pointerevents/test_pointerevent_setpointercapture_relatedtarget-manual.html index 0883d616b..09e97ec97 100644 --- a/dom/events/test/pointerevents/test_pointerevent_setpointercapture_relatedtarget-manual.html +++ b/dom/events/test/pointerevents/test_pointerevent_setpointercapture_relatedtarget-manual.html @@ -19,8 +19,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1000870 function executeTest(int_win) { sendMouseEvent(int_win, "target1", "mousemove"); sendMouseEvent(int_win, "btnCapture", "mousedown"); - sendMouseEvent(int_win, "target1", "mousemove"); - sendMouseEvent(int_win, "target1", "mouseup"); + sendMouseEvent(int_win, "btnCapture", "mousemove"); + sendMouseEvent(int_win, "btnCapture", "mouseup"); } -- cgit v1.2.3 From 9957290b5a27555aeebd9c8ce0e6891fee747fee Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Mon, 23 Apr 2018 09:13:00 +0200 Subject: moebius#123: DOM - Events - support createEvent("FocusEvent") https://github.com/MoonchildProductions/moebius/pull/123 --- dom/events/EventDispatcher.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'dom/events') diff --git a/dom/events/EventDispatcher.cpp b/dom/events/EventDispatcher.cpp index a1d0675ae..65f01844b 100644 --- a/dom/events/EventDispatcher.cpp +++ b/dom/events/EventDispatcher.cpp @@ -1056,6 +1056,11 @@ EventDispatcher::CreateEvent(EventTarget* aOwner, LOG_EVENT_CREATION(STORAGEEVENT); return NS_NewDOMStorageEvent(aOwner); } + if (aEventType.LowerCaseEqualsLiteral("focusevent")) { + RefPtr event = NS_NewDOMFocusEvent(aOwner, aPresContext, nullptr); + event->MarkUninitialized(); + return event.forget(); + } #undef LOG_EVENT_CREATION -- cgit v1.2.3 From d9d3b687b7c892b400e781dd5c57897efd7173aa Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Mon, 23 Apr 2018 11:54:06 +0200 Subject: moebius#195: DOM - PointerEvent - improvements https://github.com/MoonchildProductions/moebius/pull/195 --- dom/events/Event.cpp | 19 ++++++ dom/events/test/pointerevents/mochitest.ini | 18 ++--- .../test_trigger_fullscreen_by_pointer_events.html | 57 ++++++++++++++++ .../test_trigger_popup_by_pointer_events.html | 76 ++++++++++++++++++++++ 4 files changed, 162 insertions(+), 8 deletions(-) create mode 100644 dom/events/test/pointerevents/test_trigger_fullscreen_by_pointer_events.html create mode 100644 dom/events/test/pointerevents/test_trigger_popup_by_pointer_events.html (limited to 'dom/events') diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index 2546a81ad..7e19cd74d 100755 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -855,6 +855,25 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent) } } break; + case ePointerEventClass: + if (aEvent->IsTrusted() && + aEvent->AsPointerEvent()->button == WidgetMouseEvent::eLeftButton) { + switch(aEvent->mMessage) { + case ePointerUp: + if (PopupAllowedForEvent("pointerup")) { + abuse = openControlled; + } + break; + case ePointerDown: + if (PopupAllowedForEvent("pointerdown")) { + abuse = openControlled; + } + break; + default: + break; + } + } + break; case eFormEventClass: // For these following events only allow popups if they're // triggered while handling user input. See diff --git a/dom/events/test/pointerevents/mochitest.ini b/dom/events/test/pointerevents/mochitest.ini index 5de7f27ea..af762feb2 100644 --- a/dom/events/test/pointerevents/mochitest.ini +++ b/dom/events/test/pointerevents/mochitest.ini @@ -6,6 +6,14 @@ support-files = pointerevent_styles.css pointerevent_support.js +[test_bug1285128.html] +[test_bug1293174_implicit_pointer_capture_for_touch_1.html] + support-files = bug1293174_implicit_pointer_capture_for_touch_1.html +[test_bug1293174_implicit_pointer_capture_for_touch_2.html] + support-files = bug1293174_implicit_pointer_capture_for_touch_2.html +[test_bug1323158.html] +[test_empty_file.html] + disabled = disabled # Bug 1150091 - Issue with support-files [test_pointerevent_attributes_mouse-manual.html] support-files = pointerevent_attributes_mouse-manual.html [test_pointerevent_capture_mouse-manual.html] @@ -143,11 +151,5 @@ support-files = pointerevent_touch-action-span-test_touch-manual.html pointerevent_touch-action-svg-test_touch-manual.html pointerevent_touch-action-table-test_touch-manual.html -[test_bug1285128.html] -[test_bug1293174_implicit_pointer_capture_for_touch_1.html] - support-files = bug1293174_implicit_pointer_capture_for_touch_1.html -[test_bug1293174_implicit_pointer_capture_for_touch_2.html] - support-files = bug1293174_implicit_pointer_capture_for_touch_2.html -[test_bug1323158.html] -[test_empty_file.html] - disabled = disabled # Bug 1150091 - Issue with support-files +[test_trigger_fullscreen_by_pointer_events.html] +[test_trigger_popup_by_pointer_events.html] diff --git a/dom/events/test/pointerevents/test_trigger_fullscreen_by_pointer_events.html b/dom/events/test/pointerevents/test_trigger_fullscreen_by_pointer_events.html new file mode 100644 index 000000000..53d390996 --- /dev/null +++ b/dom/events/test/pointerevents/test_trigger_fullscreen_by_pointer_events.html @@ -0,0 +1,57 @@ + + + + + Test for triggering Fullscreen by pointer events + + + + + + + + diff --git a/dom/events/test/pointerevents/test_trigger_popup_by_pointer_events.html b/dom/events/test/pointerevents/test_trigger_popup_by_pointer_events.html new file mode 100644 index 000000000..cda279e26 --- /dev/null +++ b/dom/events/test/pointerevents/test_trigger_popup_by_pointer_events.html @@ -0,0 +1,76 @@ + + + + + Test for triggering popup by pointer events + + + + + +
+ + + -- cgit v1.2.3 From d564205c583cb6b95487c237fbe05e08ed53a915 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 29 Apr 2018 12:18:35 +0200 Subject: Bug 1313420 - Implement Performance.timeOrigin - part 2 - tests https://hg.mozilla.org/mozilla-central/rev/c22f17e0db9d --- dom/events/test/test_eventTimeStamp.html | 36 +++++++++++++++----------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'dom/events') diff --git a/dom/events/test/test_eventTimeStamp.html b/dom/events/test/test_eventTimeStamp.html index 107a21f87..056203e92 100644 --- a/dom/events/test/test_eventTimeStamp.html +++ b/dom/events/test/test_eventTimeStamp.html @@ -17,7 +17,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=77992 @@ -57,9 +57,9 @@ function testRegularEvents() { finishTests(); return; } - var timeBeforeEvent = window.performance.now(); - window.addEventListener("load", function(evt) { - var timeAfterEvent = window.performance.now(); + var timeBeforeEvent = performance.now(); + addEventListener("load", function(evt) { + var timeAfterEvent = performance.now(); ok(evt.timeStamp >= timeBeforeEvent && evt.timeStamp <= timeAfterEvent, "Event timestamp (" + evt.timeStamp + ") is in expected range: (" + @@ -71,19 +71,18 @@ function testRegularEvents() { function testWorkerEvents() { var blob = new Blob([ document.getElementById("worker-src").textContent ], { type: "text/javascript" }); - var worker = new Worker(window.URL.createObjectURL(blob)); + var worker = new Worker(URL.createObjectURL(blob)); worker.onmessage = function(evt) { - var timeAfterEvent = window.performance.now(); - // Comparing times across timelines may break now - // ok(evt.data >= timeBeforeEvent && - // evt.data <= timeAfterEvent, + var timeAfterEvent = performance.now() + performance.timeOrigin; + ok(evt.data >= timeBeforeEvent && + evt.data <= timeAfterEvent, // "Event timestamp in dedicated worker (" + evt.data + // ") is in expected range: (" + // timeBeforeEvent + ", " + timeAfterEvent + ")"); worker.terminate(); testSharedWorkerEvents(); }; - var timeBeforeEvent = window.performance.now(); + var timeBeforeEvent = performance.now() + performance.timeOrigin; worker.postMessage(""); } @@ -93,17 +92,16 @@ function testSharedWorkerEvents() { { type: "text/javascript" }); // Delay creation of worker slightly so it is easier to distinguish // shared worker creation time from this document's navigation start - window.setTimeout(function() { - var timeBeforeWorkerCreation = window.performance.now(); - var worker = new SharedWorker(window.URL.createObjectURL(blob)); + setTimeout(function() { + var timeBeforeEvent = performance.now() + performance.timeOrigin; + var worker = new SharedWorker(URL.createObjectURL(blob)); worker.port.onmessage = function(evt) { - var timeAfterEvent = window.performance.now(); - // Comparing times across timelines may break now - // ok(evt.data >= 0 && - // evt.data <= timeAfterEvent - timeBeforeWorkerCreation, + var timeAfterEvent = performance.now() + performance.timeOrigin; + ok(evt.data >= timeBeforeEvent && + evt.data <= timeAfterEvent, // "Event timestamp in shared worker (" + evt.data + // ") is in expected range: (0, " + - // (timeAfterEvent - timeBeforeWorkerCreation) + ")"); + // timeBeforeEvent + ", " + timeAfterEvent + ")"); worker.port.close(); finishTests(); }; -- cgit v1.2.3 From 089a0bd9a4dace03e5800878055b86854eee5002 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 29 Apr 2018 12:32:19 +0200 Subject: Bug 1322292 - Some fixes for the Performance API in workers - part 2 - Get rid of NowBaseTimeStamp() https://hg.mozilla.org/mozilla-central/rev/301231f4165a --- dom/events/Event.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'dom/events') diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index 7e19cd74d..4e39675da 100755 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -1146,15 +1146,14 @@ Event::TimeStampImpl() const return perf->GetDOMTiming()->TimeStampToDOMHighRes(mEvent->mTimeStamp); } - // For dedicated workers, we should make times relative to the navigation - // start of the document that created the worker, which is the same as the - // timebase for performance.now(). + // For dedicated workers, we should make times relative to the creation time + // of the worker, which is the same as the timebase for performance.now(). workers::WorkerPrivate* workerPrivate = workers::GetCurrentThreadWorkerPrivate(); MOZ_ASSERT(workerPrivate); TimeDuration duration = - mEvent->mTimeStamp - workerPrivate->NowBaseTimeStamp(); + mEvent->mTimeStamp - workerPrivate->CreationTimeStamp(); return duration.ToMilliseconds(); } -- cgit v1.2.3 From eeaf0a73acf661662b9baf9929c9688c60d0bf38 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 29 Apr 2018 12:35:55 +0200 Subject: Bug 1322292 - Some fixes for the Performance API in workers - part 3 - TimeStampToDOMHighRes() in workerPrivate https://hg.mozilla.org/mozilla-central/rev/b827e4d0dc73 --- dom/events/Event.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'dom/events') diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index 4e39675da..4b9776c0a 100755 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -1146,15 +1146,11 @@ Event::TimeStampImpl() const return perf->GetDOMTiming()->TimeStampToDOMHighRes(mEvent->mTimeStamp); } - // For dedicated workers, we should make times relative to the creation time - // of the worker, which is the same as the timebase for performance.now(). workers::WorkerPrivate* workerPrivate = workers::GetCurrentThreadWorkerPrivate(); MOZ_ASSERT(workerPrivate); - TimeDuration duration = - mEvent->mTimeStamp - workerPrivate->CreationTimeStamp(); - return duration.ToMilliseconds(); + return workerPrivate->TimeStampToDOMHighRes(mEvent->mTimeStamp); } bool -- cgit v1.2.3 From b7d9dad58e5a3f87a6c767412941700bc8010044 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 12 May 2018 14:32:03 +0200 Subject: Remove MOZ_B2G leftovers and some dead B2G-only components. --- dom/events/EventListenerManager.cpp | 34 ---------------------------------- dom/events/EventNameList.h | 16 ---------------- dom/events/KeyNameList.h | 4 ---- dom/events/TouchEvent.cpp | 2 +- 4 files changed, 1 insertion(+), 55 deletions(-) (limited to 'dom/events') diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp index a8c48ede8..ae8bf1b1a 100644 --- a/dom/events/EventListenerManager.cpp +++ b/dom/events/EventListenerManager.cpp @@ -13,9 +13,6 @@ #include "mozilla/DOMEventTargetHelper.h" #include "mozilla/EventDispatcher.h" #include "mozilla/EventListenerManager.h" -#ifdef MOZ_B2G -#include "mozilla/Hal.h" -#endif // #ifdef MOZ_B2G #include "mozilla/HalSensor.h" #include "mozilla/InternalMutationEvent.h" #include "mozilla/JSEventHandler.h" @@ -359,14 +356,6 @@ EventListenerManager::AddEventListenerInternal( } else if (aTypeAtom == nsGkAtoms::onorientationchange) { EnableDevice(eOrientationChange); #endif -#ifdef MOZ_B2G - } else if (aTypeAtom == nsGkAtoms::onmoztimechange) { - EnableDevice(eTimeChange); - } else if (aTypeAtom == nsGkAtoms::onmoznetworkupload) { - EnableDevice(eNetworkUpload); - } else if (aTypeAtom == nsGkAtoms::onmoznetworkdownload) { - EnableDevice(eNetworkDownload); -#endif // MOZ_B2G } else if (aTypeAtom == nsGkAtoms::ontouchstart || aTypeAtom == nsGkAtoms::ontouchend || aTypeAtom == nsGkAtoms::ontouchmove || @@ -494,11 +483,6 @@ EventListenerManager::IsDeviceType(EventMessage aEventMessage) case eUserProximity: #if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) case eOrientationChange: -#endif -#ifdef MOZ_B2G - case eTimeChange: - case eNetworkUpload: - case eNetworkDownload: #endif return true; default: @@ -549,15 +533,6 @@ EventListenerManager::EnableDevice(EventMessage aEventMessage) case eOrientationChange: window->EnableOrientationChangeListener(); break; -#endif -#ifdef MOZ_B2G - case eTimeChange: - window->EnableTimeChangeNotifications(); - break; - case eNetworkUpload: - case eNetworkDownload: - window->EnableNetworkEvent(aEventMessage); - break; #endif default: NS_WARNING("Enabling an unknown device sensor."); @@ -605,15 +580,6 @@ EventListenerManager::DisableDevice(EventMessage aEventMessage) window->DisableOrientationChangeListener(); break; #endif -#ifdef MOZ_B2G - case eTimeChange: - window->DisableTimeChangeNotifications(); - break; - case eNetworkUpload: - case eNetworkDownload: - window->DisableNetworkEvent(aEventMessage); - break; -#endif // MOZ_B2G default: NS_WARNING("Disabling an unknown device sensor."); break; diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index 509863e6c..3f0af9fe9 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -637,22 +637,6 @@ WINDOW_ONLY_EVENT(appinstalled, EventNameType_None, eBasicEventClass) - -#ifdef MOZ_B2G -WINDOW_ONLY_EVENT(moztimechange, - eTimeChange, - EventNameType_None, - eBasicEventClass) -WINDOW_ONLY_EVENT(moznetworkupload, - eNetworkUpload, - EventNameType_None, - eBasicEventClass) -WINDOW_ONLY_EVENT(moznetworkdownload, - eNetworkDownload, - EventNameType_None, - eBasicEventClass) -#endif // MOZ_B2G - TOUCH_EVENT(touchstart, eTouchStart, EventNameType_All, diff --git a/dom/events/KeyNameList.h b/dom/events/KeyNameList.h index 35fbe2d5f..361122ec7 100644 --- a/dom/events/KeyNameList.h +++ b/dom/events/KeyNameList.h @@ -32,10 +32,6 @@ DEFINE_KEYNAME_INTERNAL(PrintableKey, "MozPrintableKey") DEFINE_KEYNAME_INTERNAL(SoftLeft, "MozSoftLeft") DEFINE_KEYNAME_INTERNAL(SoftRight, "MozSoftRight") -#ifdef MOZ_B2G -DEFINE_KEYNAME_INTERNAL(HomeScreen, "MozHomeScreen") -#endif // #ifdef MOZ_B2G - /****************************************************************************** * Modifier Keys *****************************************************************************/ diff --git a/dom/events/TouchEvent.cpp b/dom/events/TouchEvent.cpp index cc9684eb3..9b7a74ac2 100644 --- a/dom/events/TouchEvent.cpp +++ b/dom/events/TouchEvent.cpp @@ -203,7 +203,7 @@ TouchEvent::PrefEnabled(nsIDocShell* aDocShell) enabled = false; } else { if (sPrefCacheValue == 2) { -#if defined(MOZ_B2G) || defined(MOZ_WIDGET_ANDROID) +#if defined(MOZ_WIDGET_ANDROID) // Touch support is always enabled on B2G and android. enabled = true; #elif defined(XP_WIN) || MOZ_WIDGET_GTK == 3 -- cgit v1.2.3 From 6571d2ceb42930dab01677ef0e95e732d5076fb8 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 12 May 2018 16:19:33 +0200 Subject: Remove MOZ_WIDGET_GONK [1/2] Tag #288 --- dom/events/EventListenerManager.cpp | 8 ++++---- dom/events/EventNameList.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'dom/events') diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp index ae8bf1b1a..fe896870c 100644 --- a/dom/events/EventListenerManager.cpp +++ b/dom/events/EventListenerManager.cpp @@ -352,7 +352,7 @@ EventListenerManager::AddEventListenerInternal( EnableDevice(eDeviceLight); } else if (aTypeAtom == nsGkAtoms::ondevicemotion) { EnableDevice(eDeviceMotion); -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) } else if (aTypeAtom == nsGkAtoms::onorientationchange) { EnableDevice(eOrientationChange); #endif @@ -481,7 +481,7 @@ EventListenerManager::IsDeviceType(EventMessage aEventMessage) case eDeviceLight: case eDeviceProximity: case eUserProximity: -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) case eOrientationChange: #endif return true; @@ -529,7 +529,7 @@ EventListenerManager::EnableDevice(EventMessage aEventMessage) window->EnableDeviceSensor(SENSOR_LINEAR_ACCELERATION); window->EnableDeviceSensor(SENSOR_GYROSCOPE); break; -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) case eOrientationChange: window->EnableOrientationChangeListener(); break; @@ -575,7 +575,7 @@ EventListenerManager::DisableDevice(EventMessage aEventMessage) case eDeviceLight: window->DisableDeviceSensor(SENSOR_LIGHT); break; -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) case eOrientationChange: window->DisableOrientationChangeListener(); break; diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index 3f0af9fe9..214b844e7 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -563,7 +563,7 @@ WINDOW_EVENT(online, eOnline, EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly, eBasicEventClass) -#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) +#if defined(MOZ_WIDGET_ANDROID) WINDOW_EVENT(orientationchange, eOrientationChange, EventNameType_HTMLBodyOrFramesetOnly, -- cgit v1.2.3 From 1124fb525bf7b8341170d886b8de070e20323efd Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 13 May 2018 22:46:04 +0200 Subject: Remove other gonk widget conditionals and unused files. Tag #288. --- dom/events/moz.build | 5 ----- 1 file changed, 5 deletions(-) (limited to 'dom/events') diff --git a/dom/events/moz.build b/dom/events/moz.build index ee4946038..ec3813207 100644 --- a/dom/events/moz.build +++ b/dom/events/moz.build @@ -153,10 +153,5 @@ LOCAL_INCLUDES += [ '/layout/xul/tree/', ] -if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': - LOCAL_INCLUDES += [ - '/dom/wifi', - ] - if CONFIG['GNU_CXX']: CXXFLAGS += ['-Wno-error=shadow'] -- cgit v1.2.3 From a7bc62dcfe5495c8b53532c1b585af07171b4403 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Tue, 26 Jun 2018 13:53:12 +0200 Subject: Issue #12 Part 2: Stop using nsIDOMEvent in IsAcceptableInputEvent. --- dom/events/Event.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'dom/events') diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index 4b9776c0a..f33bfa5a8 100755 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -280,16 +280,10 @@ Event::GetType(nsAString& aType) return NS_OK; } -static EventTarget* -GetDOMEventTarget(nsIDOMEventTarget* aTarget) -{ - return aTarget ? aTarget->GetTargetForDOMEvent() : nullptr; -} - EventTarget* Event::GetTarget() const { - return GetDOMEventTarget(mEvent->mTarget); + return mEvent->GetDOMEventTarget(); } NS_IMETHODIMP @@ -302,7 +296,7 @@ Event::GetTarget(nsIDOMEventTarget** aTarget) EventTarget* Event::GetCurrentTarget() const { - return GetDOMEventTarget(mEvent->mCurrentTarget); + return mEvent->GetCurrentDOMEventTarget(); } NS_IMETHODIMP @@ -349,11 +343,7 @@ Event::GetExplicitOriginalTarget(nsIDOMEventTarget** aRealEventTarget) EventTarget* Event::GetOriginalTarget() const { - if (mEvent->mOriginalTarget) { - return GetDOMEventTarget(mEvent->mOriginalTarget); - } - - return GetTarget(); + return mEvent->GetOriginalDOMEventTarget(); } NS_IMETHODIMP -- cgit v1.2.3