diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index 5892f477a04..f725acbc6d3 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -665,6 +665,7 @@ nsContentUtils::InitializeEventTable() { { nsGkAtoms::onvolumechange, NS_VOLUMECHANGE, EventNameType_HTML, NS_EVENT_NULL }, #endif // MOZ_MEDIA { nsGkAtoms::onMozAfterPaint, NS_AFTERPAINT, EventNameType_None, NS_EVENT }, + { nsGkAtoms::onMozBeforePaint, NS_BEFOREPAINT, EventNameType_None, NS_EVENT_NULL }, { nsGkAtoms::onMozScrolledAreaChanged, NS_SCROLLEDAREACHANGED, EventNameType_None, NS_SCROLLAREA_EVENT }, diff --git a/content/base/src/nsGkAtomList.h b/content/base/src/nsGkAtomList.h index e06cf4c6283..2b0640205f4 100644 --- a/content/base/src/nsGkAtomList.h +++ b/content/base/src/nsGkAtomList.h @@ -669,6 +669,7 @@ GK_ATOM(onmouseover, "onmouseover") GK_ATOM(onMozMouseHittest, "onMozMouseHittest") GK_ATOM(onmouseup, "onmouseup") GK_ATOM(onMozAfterPaint, "onMozAfterPaint") +GK_ATOM(onMozBeforePaint, "onMozBeforePaint") GK_ATOM(onMozMousePixelScroll, "onMozMousePixelScroll") GK_ATOM(onMozScrolledAreaChanged, "onMozScrolledAreaChanged") GK_ATOM(ononline, "ononline") diff --git a/content/events/src/nsDOMEvent.cpp b/content/events/src/nsDOMEvent.cpp index 299c0b01e1a..4f29e7a24d0 100644 --- a/content/events/src/nsDOMEvent.cpp +++ b/content/events/src/nsDOMEvent.cpp @@ -91,6 +91,7 @@ static const char* const sEventNames[] = { "durationchange", "volumechange", #endif // MOZ_MEDIA "MozAfterPaint", + "MozBeforePaint", "MozSwipeGesture", "MozMagnifyGestureStart", "MozMagnifyGestureUpdate", @@ -400,7 +401,7 @@ nsDOMEvent::GetCancelable(PRBool* aCancelable) NS_IMETHODIMP nsDOMEvent::GetTimeStamp(PRUint64* aTimeStamp) { - LL_UI2L(*aTimeStamp, mEvent->time); + *aTimeStamp = mEvent->time; return NS_OK; } @@ -1302,6 +1303,8 @@ const char* nsDOMEvent::GetEventName(PRUint32 aEventType) #endif case NS_AFTERPAINT: return sEventNames[eDOMEvents_afterpaint]; + case NS_BEFOREPAINT: + return sEventNames[eDOMEvents_beforepaint]; case NS_SIMPLE_GESTURE_SWIPE: return sEventNames[eDOMEvents_MozSwipeGesture]; case NS_SIMPLE_GESTURE_MAGNIFY_START: diff --git a/content/events/src/nsDOMEvent.h b/content/events/src/nsDOMEvent.h index 300fd0e69de..f655f474ba0 100644 --- a/content/events/src/nsDOMEvent.h +++ b/content/events/src/nsDOMEvent.h @@ -170,6 +170,7 @@ public: eDOMEvents_volumechange, #endif eDOMEvents_afterpaint, + eDOMEvents_beforepaint, eDOMEvents_MozSwipeGesture, eDOMEvents_MozMagnifyGestureStart, eDOMEvents_MozMagnifyGestureUpdate, diff --git a/widget/public/nsGUIEvent.h b/widget/public/nsGUIEvent.h index 575a04027fa..76c62b3591c 100644 --- a/widget/public/nsGUIEvent.h +++ b/widget/public/nsGUIEvent.h @@ -413,6 +413,7 @@ class nsHashKey; // paint notification events #define NS_NOTIFYPAINT_START 3400 #define NS_AFTERPAINT (NS_NOTIFYPAINT_START) +#define NS_BEFOREPAINT (NS_NOTIFYPAINT_START+1) // Simple gesture events #define NS_SIMPLE_GESTURE_EVENT_START 3500 @@ -534,7 +535,7 @@ public: nsIntPoint refPoint; // Elapsed time, in milliseconds, from a platform-specific zero time // to the time the message was created - PRUint32 time; + PRUint64 time; // Flags to hold event flow stage and capture/bubble cancellation // status. This is used also to indicate whether the event is trusted. PRUint32 flags;