diff --git a/layout/xul/base/src/nsSliderFrame.cpp b/layout/xul/base/src/nsSliderFrame.cpp index afaf3d712c09..58fd4cc0866d 100644 --- a/layout/xul/base/src/nsSliderFrame.cpp +++ b/layout/xul/base/src/nsSliderFrame.cpp @@ -628,7 +628,8 @@ nsSliderFrame::HandleEvent(nsIPresContext* aPresContext, //return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus); return NS_OK; } - else if (mMiddlePref && aEvent->message == NS_MOUSE_MIDDLE_BUTTON_DOWN) { + else if ((aEvent->message == NS_MOUSE_LEFT_BUTTON_DOWN && ((nsMouseEvent *)aEvent)->isShift) + || (mMiddlePref && aEvent->message == NS_MOUSE_MIDDLE_BUTTON_DOWN)) { // convert coord from twips to pixels nscoord pos = isHorizontal ? aEvent->point.x : aEvent->point.y; float p2t; @@ -924,14 +925,18 @@ nsSliderFrame::MouseDown(nsIDOMEvent* aMouseEvent) nsCOMPtr mouseEvent(do_QueryInterface(aMouseEvent)); PRUint16 button = 0; + PRBool scrollToClick = PR_FALSE; + mouseEvent->GetShiftKey(&scrollToClick); mouseEvent->GetButton(&button); - if((mMiddlePref && button != 0 && button != 1) || - (!mMiddlePref && button != 0)) + if (button != 0) { + if (button != 1 || !mMiddlePref) return NS_OK; + scrollToClick = PR_TRUE; + } - // If middle button, first place the middle of the slider thumb - // under the click - if (button == 1) { + // If shift click or middle button, first + // place the middle of the slider thumb under the click + if (scrollToClick) { nscoord pos; nscoord pospx; @@ -1092,6 +1097,9 @@ nsSliderFrame::HandlePress(nsIPresContext* aPresContext, nsGUIEvent* aEvent, nsEventStatus* aEventStatus) { + if (((nsMouseEvent *)aEvent)->isShift) + return NS_OK; + nsIFrame* thumbFrame = mFrames.FirstChild(); if (!thumbFrame) // display:none? return NS_OK;