From be41dd2fc43504583fe499a6da1697682e483177 Mon Sep 17 00:00:00 2001 From: Robert Sayre Date: Thu, 11 Dec 2008 02:43:04 -0800 Subject: [PATCH] backout bug 428988, checked in on persistent orange. --- content/base/src/nsGenericElement.cpp | 3 - content/events/src/nsDOMEvent.cpp | 1 - content/events/src/nsDOMMouseEvent.cpp | 27 -------- content/events/src/nsDOMMouseEvent.h | 10 +-- content/events/test/Makefile.in | 1 - content/events/test/test_bug428988.html | 45 ------------- dom/public/idl/events/Makefile.in | 1 - dom/public/idl/events/nsIDOMNSMouseEvent.idl | 69 -------------------- dom/src/base/nsDOMClassInfo.cpp | 5 -- widget/public/nsGUIEvent.h | 6 +- widget/src/gtk2/nsWindow.cpp | 29 -------- widget/src/gtk2/nsWindow.h | 1 - 12 files changed, 4 insertions(+), 194 deletions(-) delete mode 100644 content/events/test/test_bug428988.html delete mode 100644 dom/public/idl/events/nsIDOMNSMouseEvent.idl diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index 2adb3dff75ae..3f43bf8eb860 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -3415,12 +3415,9 @@ nsGenericElement::DispatchClickEvent(nsPresContext* aPresContext, aSourceEvent->widget, nsMouseEvent::eReal); event.refPoint = aSourceEvent->refPoint; PRUint32 clickCount = 1; - float pressure = 0; if (aSourceEvent->eventStructType == NS_MOUSE_EVENT) { clickCount = static_cast(aSourceEvent)->clickCount; - pressure = static_cast(aSourceEvent)->pressure; } - event.pressure = pressure; event.clickCount = clickCount; event.isShift = aSourceEvent->isShift; event.isControl = aSourceEvent->isControl; diff --git a/content/events/src/nsDOMEvent.cpp b/content/events/src/nsDOMEvent.cpp index 8b46a78439b7..67b5105e2024 100644 --- a/content/events/src/nsDOMEvent.cpp +++ b/content/events/src/nsDOMEvent.cpp @@ -822,7 +822,6 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData() mouseEvent->context = oldMouseEvent->context; mouseEvent->relatedTarget = oldMouseEvent->relatedTarget; mouseEvent->button = oldMouseEvent->button; - mouseEvent->pressure = oldMouseEvent->pressure; newEvent = mouseEvent; break; } diff --git a/content/events/src/nsDOMMouseEvent.cpp b/content/events/src/nsDOMMouseEvent.cpp index 88e9fe30f509..0b653d8aa63a 100644 --- a/content/events/src/nsDOMMouseEvent.cpp +++ b/content/events/src/nsDOMMouseEvent.cpp @@ -93,7 +93,6 @@ NS_IMPL_RELEASE_INHERITED(nsDOMMouseEvent, nsDOMUIEvent) NS_INTERFACE_MAP_BEGIN(nsDOMMouseEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMMouseEvent) - NS_INTERFACE_MAP_ENTRY(nsIDOMNSMouseEvent) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(MouseEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent) @@ -137,24 +136,6 @@ nsDOMMouseEvent::InitMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBo return NS_OK; } -NS_IMETHODIMP -nsDOMMouseEvent::InitNSMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable, - nsIDOMAbstractView *aView, PRInt32 aDetail, PRInt32 aScreenX, - PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY, - PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey, - PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget, - float aPressure) -{ - nsresult rv = nsDOMMouseEvent::InitMouseEvent(aType, aCanBubble, aCancelable, - aView, aDetail, aScreenX, aScreenY, - aClientX, aClientY, aCtrlKey, aAltKey, aShiftKey, - aMetaKey, aButton, aRelatedTarget); - NS_ENSURE_SUCCESS(rv, rv); - - static_cast(mEvent)->pressure = aPressure; - return NS_OK; -} - NS_IMETHODIMP nsDOMMouseEvent::GetButton(PRUint16* aButton) { @@ -268,14 +249,6 @@ nsDOMMouseEvent::GetWhich(PRUint32* aWhich) return NS_OK; } -NS_IMETHODIMP -nsDOMMouseEvent::GetMozPressure(float* aPressure) -{ - NS_ENSURE_ARG_POINTER(aPressure); - *aPressure = static_cast(mEvent)->pressure; - return NS_OK; -} - nsresult NS_NewDOMMouseEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsInputEvent *aEvent) diff --git a/content/events/src/nsDOMMouseEvent.h b/content/events/src/nsDOMMouseEvent.h index a1165710778b..0b6d47201e01 100644 --- a/content/events/src/nsDOMMouseEvent.h +++ b/content/events/src/nsDOMMouseEvent.h @@ -41,14 +41,13 @@ #include "nsIDOMMouseEvent.h" #include "nsDOMUIEvent.h" -#include "nsIDOMNSMouseEvent.h" class nsIContent; class nsIScrollableView; class nsEvent; -class nsDOMMouseEvent : public nsDOMUIEvent, - public nsIDOMNSMouseEvent +class nsDOMMouseEvent : public nsIDOMMouseEvent, + public nsDOMUIEvent { public: nsDOMMouseEvent(nsPresContext* aPresContext, nsInputEvent* aEvent); @@ -58,10 +57,7 @@ public: // nsIDOMMouseEvent Interface NS_DECL_NSIDOMMOUSEEVENT - - // nsIDOMNSMouseEvent Interface - NS_DECL_NSIDOMNSMOUSEEVENT - + // Forward to base class NS_FORWARD_TO_NSDOMUIEVENT diff --git a/content/events/test/Makefile.in b/content/events/test/Makefile.in index d6afab959699..d9b8928ffcdf 100644 --- a/content/events/test/Makefile.in +++ b/content/events/test/Makefile.in @@ -64,7 +64,6 @@ _TEST_FILES = \ test_bug447736.html \ test_bug456273.html \ test_bug457672.html \ - test_bug428988.html \ bug457672.html \ test_draggableprop.html \ test_dragstart.html \ diff --git a/content/events/test/test_bug428988.html b/content/events/test/test_bug428988.html deleted file mode 100644 index 952b500ae5cb..000000000000 --- a/content/events/test/test_bug428988.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Test for Bug 428988 - - - - - -Mozilla Bug 428988 -

- -
-
-
-testTarget - - diff --git a/dom/public/idl/events/Makefile.in b/dom/public/idl/events/Makefile.in index 8b4bf5727308..48fcec57fdfd 100644 --- a/dom/public/idl/events/Makefile.in +++ b/dom/public/idl/events/Makefile.in @@ -77,7 +77,6 @@ XPIDLSRCS = \ nsIDOMMessageEvent.idl \ nsIDOMNotifyPaintEvent.idl \ nsIDOMSimpleGestureEvent.idl \ - nsIDOMNSMouseEvent.idl \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/dom/public/idl/events/nsIDOMNSMouseEvent.idl b/dom/public/idl/events/nsIDOMNSMouseEvent.idl deleted file mode 100644 index 16b815094d96..000000000000 --- a/dom/public/idl/events/nsIDOMNSMouseEvent.idl +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2008 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Oleg Romashin (original author) - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsIDOMMouseEvent.idl" - -/** - * The nsIDOMNSMouseEvent interface extends nsIDOMMouseEvent - * by providing various information related to the mouse event. - */ - -[scriptable, uuid(1b8e528d-7dca-44ee-8ee6-c44594ebcef1)] -interface nsIDOMNSMouseEvent : nsIDOMMouseEvent -{ - // Finger or touch pressure event value - // ranges between 0.0 and 1.0 - readonly attribute float mozPressure; - - void initNSMouseEvent(in DOMString typeArg, - in boolean canBubbleArg, - in boolean cancelableArg, - in nsIDOMAbstractView viewArg, - in long detailArg, - in long screenXArg, - in long screenYArg, - in long clientXArg, - in long clientYArg, - in boolean ctrlKeyArg, - in boolean altKeyArg, - in boolean shiftKeyArg, - in boolean metaKeyArg, - in unsigned short buttonArg, - in nsIDOMEventTarget relatedTargetArg, - in float pressure); -}; diff --git a/dom/src/base/nsDOMClassInfo.cpp b/dom/src/base/nsDOMClassInfo.cpp index 0845ce440057..afe2ad06d948 100644 --- a/dom/src/base/nsDOMClassInfo.cpp +++ b/dom/src/base/nsDOMClassInfo.cpp @@ -465,8 +465,6 @@ // Simple gestures include #include "nsIDOMSimpleGestureEvent.h" -#include "nsIDOMNSMouseEvent.h" - static NS_DEFINE_CID(kCPluginManagerCID, NS_PLUGINMANAGER_CID); static NS_DEFINE_CID(kDOMSOF_CID, NS_DOM_SCRIPT_OBJECT_FACTORY_CID); @@ -2151,20 +2149,17 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(MouseEvent, nsIDOMMouseEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSMouseEvent) DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(MouseScrollEvent, nsIDOMMouseScrollEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseScrollEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSMouseEvent) DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(DragEvent, nsIDOMDragEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMDragEvent) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSMouseEvent) DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END diff --git a/widget/public/nsGUIEvent.h b/widget/public/nsGUIEvent.h index a5988892c7f7..2896e497a4dd 100644 --- a/widget/public/nsGUIEvent.h +++ b/widget/public/nsGUIEvent.h @@ -679,16 +679,12 @@ class nsMouseEvent_base : public nsInputEvent { public: nsMouseEvent_base(PRBool isTrusted, PRUint32 msg, nsIWidget *w, PRUint8 type) - : nsInputEvent(isTrusted, msg, w, type), button(0), pressure(0) {} + : nsInputEvent(isTrusted, msg, w, type), button(0) {} /// The possible related target nsCOMPtr relatedTarget; PRInt16 button; - - // Finger or touch pressure of event - // ranges between 0.0 and 1.0 - float pressure; }; class nsMouseEvent : public nsMouseEvent_base diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp index 4b27c644c92c..7720b4c39a86 100644 --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -398,7 +398,6 @@ nsWindow::nsWindow() mDragMotionY = 0; mDragMotionTime = 0; mDragMotionTimerID = 0; - mLastMotionPressure = 0; #ifdef USE_XIM mIMEData = nsnull; @@ -2535,15 +2534,6 @@ nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent) nsMouseEvent event(PR_TRUE, NS_MOUSE_MOVE, this, nsMouseEvent::eReal); - // should we move this into !synthEvent? - gdouble pressure = 0; - gdk_event_get_axis ((GdkEvent*)aEvent, GDK_AXIS_PRESSURE, &pressure); - // Sometime gdk generate 0 pressure value between normal values - // We have to ignore that and use last valid value - if (pressure) - mLastMotionPressure = pressure; - event.pressure = mLastMotionPressure; - nsRect windowRect; ScreenToWidget(nsRect(nscoord(cursorX), nscoord(cursorY), 1, 1), windowRect); @@ -2597,14 +2587,6 @@ nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent) nsMouseEvent event(PR_TRUE, NS_MOUSE_MOVE, this, nsMouseEvent::eReal); - gdouble pressure = 0; - gdk_event_get_axis ((GdkEvent*)aEvent, GDK_AXIS_PRESSURE, &pressure); - // Sometime gdk generate 0 pressure value between normal values - // We have to ignore that and use last valid value - if (pressure) - mLastMotionPressure = pressure; - event.pressure = mLastMotionPressure; - if (synthEvent) { #ifdef MOZ_X11 event.refPoint.x = nscoord(xevent.xmotion.x); @@ -2733,10 +2715,6 @@ nsWindow::OnButtonPressEvent(GtkWidget *aWidget, GdkEventButton *aEvent) if (gConsumeRollupEvent && rolledUp) return; - gdouble pressure = 0; - gdk_event_get_axis ((GdkEvent*)aEvent, GDK_AXIS_PRESSURE, &pressure); - mLastMotionPressure = pressure; - PRUint16 domButton; switch (aEvent->button) { case 1: @@ -2753,7 +2731,6 @@ nsWindow::OnButtonPressEvent(GtkWidget *aWidget, GdkEventButton *aEvent) case 7: { nsMouseScrollEvent event(PR_TRUE, NS_MOUSE_SCROLL, this); - event.pressure = mLastMotionPressure; event.scrollFlags = nsMouseScrollEvent::kIsHorizontal; event.refPoint.x = nscoord(aEvent->x); event.refPoint.y = nscoord(aEvent->y); @@ -2784,7 +2761,6 @@ nsWindow::OnButtonPressEvent(GtkWidget *aWidget, GdkEventButton *aEvent) nsMouseEvent event(PR_TRUE, NS_MOUSE_BUTTON_DOWN, this, nsMouseEvent::eReal); event.button = domButton; InitButtonEvent(event, aEvent); - event.pressure = mLastMotionPressure; DispatchEvent(&event, status); @@ -2794,7 +2770,6 @@ nsWindow::OnButtonPressEvent(GtkWidget *aWidget, GdkEventButton *aEvent) nsMouseEvent contextMenuEvent(PR_TRUE, NS_CONTEXTMENU, this, nsMouseEvent::eReal); InitButtonEvent(contextMenuEvent, aEvent); - contextMenuEvent.pressure = mLastMotionPressure; DispatchEvent(&contextMenuEvent, status); } } @@ -2822,13 +2797,9 @@ nsWindow::OnButtonReleaseEvent(GtkWidget *aWidget, GdkEventButton *aEvent) nsMouseEvent event(PR_TRUE, NS_MOUSE_BUTTON_UP, this, nsMouseEvent::eReal); event.button = domButton; InitButtonEvent(event, aEvent); - gdouble pressure = 0; - gdk_event_get_axis ((GdkEvent*)aEvent, GDK_AXIS_PRESSURE, &pressure); - event.pressure = pressure ? pressure : mLastMotionPressure; nsEventStatus status; DispatchEvent(&event, status); - mLastMotionPressure = pressure; } void diff --git a/widget/src/gtk2/nsWindow.h b/widget/src/gtk2/nsWindow.h index cec20b10f2ad..6647fd063f79 100644 --- a/widget/src/gtk2/nsWindow.h +++ b/widget/src/gtk2/nsWindow.h @@ -550,7 +550,6 @@ private: guint mDragMotionTime; guint mDragMotionTimerID; nsCOMPtr mDragLeaveTimer; - float mLastMotionPressure; static PRBool sIsDraggingOutOf; // drag in progress