diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index bd7a950e7b5..62e5fbd279f 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -311,6 +311,7 @@ nsListControlFrame::nsListControlFrame(nsIPresShell* aShell, mDummyFrame = nsnull; + mControlSelectMode = PR_FALSE; REFLOW_COUNTER_INIT() } @@ -3025,7 +3026,15 @@ nsListControlFrame::KeyPress(nsIDOMEvent* aKeyEvent) // DOM_VK_ESCAPE cancels the selection // default processing checks to see if the pressed the first // letter of an item in the list and advances to it - + + if (isControl && (keycode == nsIDOMKeyEvent::DOM_VK_UP || + keycode == nsIDOMKeyEvent::DOM_VK_LEFT || + keycode == nsIDOMKeyEvent::DOM_VK_DOWN || + keycode == nsIDOMKeyEvent::DOM_VK_RIGHT)) { + mControlSelectMode = PR_TRUE; + } else if (charcode != ' ') { + mControlSelectMode = PR_FALSE; + } switch (keycode) { case nsIDOMKeyEvent::DOM_VK_UP: @@ -3205,6 +3214,8 @@ nsListControlFrame::KeyPress(nsIDOMEvent* aKeyEvent) mStartSelectionIndex = newIndex; mEndSelectionIndex = newIndex; ScrollToIndex(newIndex); + } else if (mControlSelectMode && charcode == ' ') { + SingleSelection(newIndex, PR_TRUE); } else { PRBool wasChanged = PerformSelection(newIndex, isShift, isControl); if (wasChanged) { diff --git a/mozilla/layout/forms/nsListControlFrame.h b/mozilla/layout/forms/nsListControlFrame.h index 48a3fb374b3..234a96f77b9 100644 --- a/mozilla/layout/forms/nsListControlFrame.h +++ b/mozilla/layout/forms/nsListControlFrame.h @@ -265,13 +265,13 @@ protected: PRInt32 mEndSelectionIndex; nsIComboboxControlFrame *mComboboxFrame; - PRPackedBool mChangesSinceDragStart; - PRPackedBool mButtonDown; nscoord mMaxWidth; nscoord mMaxHeight; PRInt32 mNumDisplayRows; + PRPackedBool mChangesSinceDragStart; + PRPackedBool mButtonDown; - PRBool mIsAllContentHere; + PRPackedBool mIsAllContentHere; PRPackedBool mIsAllFramesHere; PRPackedBool mHasBeenInitialized; PRPackedBool mNeedToReset; @@ -279,6 +279,9 @@ protected: PRPackedBool mOverrideReflowOpt; + //bool value for multiple discontiguous selection + PRPackedBool mControlSelectMode; + nsRefPtr mEventListener; PRInt16 mPassId;