diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index b7824182755e..ff6b8fc48558 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -6098,14 +6098,22 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsIView *aView, } } - // Continue with second dispatch to system event handlers. - // Stopping propagation in the default group does not affect // propagation in the system event group. // (see also section 1.2.2.6 of the DOM3 Events Working Draft) aEvent->flags &= ~NS_EVENT_FLAG_STOP_DISPATCH; + // 3. Give event to the Frames for browser default processing. + // XXX The event isn't translated into the local coordinate space + // of the frame... + if (aEvent->eventStructType != NS_EVENT && GetCurrentEventFrame()) { + rv = mCurrentEventFrame->HandleEvent(mPresContext, (nsGUIEvent*)aEvent, + aStatus); + } + + // Continue with second dispatch to system event handlers. + // Need to null check mCurrentEventContent and mCurrentEventFrame // since the previous dispatch could have nuked them. if (mCurrentEventContent) { @@ -6124,15 +6132,6 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsIView *aView, } } - // 3. Give event to the Frames for browser default processing. - // XXX The event isn't translated into the local coordinate space - // of the frame... - if (GetCurrentEventFrame() && NS_SUCCEEDED (rv) && - aEvent->eventStructType != NS_EVENT) { - rv = mCurrentEventFrame->HandleEvent(mPresContext, (nsGUIEvent*)aEvent, - aStatus); - } - // 4. Give event to event manager for post event state changes and // generation of synthetic events. if (NS_SUCCEEDED (rv) && diff --git a/layout/generic/nsTextTransformer.h b/layout/generic/nsTextTransformer.h index 2a1eb24435e0..af11aaffe74b 100644 --- a/layout/generic/nsTextTransformer.h +++ b/layout/generic/nsTextTransformer.h @@ -349,12 +349,12 @@ protected: PRUint8 mFlags; // prefs used to configure the double-click word selection behavior - friend class WordSelectListener; class WordSelectListener: public nsIObserver { public: NS_DECL_ISUPPORTS NS_DECL_NSIOBSERVER }; + friend class WordSelectListener; static WordSelectListener *sWordSelectListener; // have we read the prefs yet? static PRBool sWordSelectStopAtPunctuation; // should we stop at punctuation? diff --git a/layout/html/base/src/nsPresShell.cpp b/layout/html/base/src/nsPresShell.cpp index b7824182755e..ff6b8fc48558 100644 --- a/layout/html/base/src/nsPresShell.cpp +++ b/layout/html/base/src/nsPresShell.cpp @@ -6098,14 +6098,22 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsIView *aView, } } - // Continue with second dispatch to system event handlers. - // Stopping propagation in the default group does not affect // propagation in the system event group. // (see also section 1.2.2.6 of the DOM3 Events Working Draft) aEvent->flags &= ~NS_EVENT_FLAG_STOP_DISPATCH; + // 3. Give event to the Frames for browser default processing. + // XXX The event isn't translated into the local coordinate space + // of the frame... + if (aEvent->eventStructType != NS_EVENT && GetCurrentEventFrame()) { + rv = mCurrentEventFrame->HandleEvent(mPresContext, (nsGUIEvent*)aEvent, + aStatus); + } + + // Continue with second dispatch to system event handlers. + // Need to null check mCurrentEventContent and mCurrentEventFrame // since the previous dispatch could have nuked them. if (mCurrentEventContent) { @@ -6124,15 +6132,6 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsIView *aView, } } - // 3. Give event to the Frames for browser default processing. - // XXX The event isn't translated into the local coordinate space - // of the frame... - if (GetCurrentEventFrame() && NS_SUCCEEDED (rv) && - aEvent->eventStructType != NS_EVENT) { - rv = mCurrentEventFrame->HandleEvent(mPresContext, (nsGUIEvent*)aEvent, - aStatus); - } - // 4. Give event to event manager for post event state changes and // generation of synthetic events. if (NS_SUCCEEDED (rv) && diff --git a/layout/html/base/src/nsTextTransformer.h b/layout/html/base/src/nsTextTransformer.h index 2a1eb24435e0..af11aaffe74b 100644 --- a/layout/html/base/src/nsTextTransformer.h +++ b/layout/html/base/src/nsTextTransformer.h @@ -349,12 +349,12 @@ protected: PRUint8 mFlags; // prefs used to configure the double-click word selection behavior - friend class WordSelectListener; class WordSelectListener: public nsIObserver { public: NS_DECL_ISUPPORTS NS_DECL_NSIOBSERVER }; + friend class WordSelectListener; static WordSelectListener *sWordSelectListener; // have we read the prefs yet? static PRBool sWordSelectStopAtPunctuation; // should we stop at punctuation?