mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 06:22:20 +00:00
On mouse down, make sure the frame capturing the mouse is the same one used as the selection anchor. bug=262306, r+sr=roc.
This commit is contained in:
parent
0ef715372d
commit
b62051b02f
@ -1833,8 +1833,14 @@ nsFrame::HandlePress(nsPresContext* aPresContext,
|
||||
// NS_STYLE_USER_SELECT_TOGGLE, need to change this logic
|
||||
PRBool useFrameSelection = (selectStyle == NS_STYLE_USER_SELECT_TEXT);
|
||||
|
||||
if (!IsMouseCaptured(aPresContext))
|
||||
CaptureMouse(aPresContext, PR_TRUE);
|
||||
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
|
||||
ContentOffsets offsets = GetContentOffsetsFromPoint(pt);
|
||||
|
||||
if (!IsMouseCaptured(aPresContext) && offsets.content) {
|
||||
nsIFrame* capturingFrame = shell->GetPrimaryFrameFor(offsets.content);
|
||||
if (capturingFrame)
|
||||
capturingFrame->CaptureMouse(aPresContext, PR_TRUE);
|
||||
}
|
||||
|
||||
// XXX This is screwy; it really should use the selection frame, not the
|
||||
// event frame
|
||||
@ -1863,9 +1869,6 @@ nsFrame::HandlePress(nsPresContext* aPresContext,
|
||||
return HandleMultiplePress(aPresContext, aEvent, aEventStatus);
|
||||
}
|
||||
|
||||
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
|
||||
ContentOffsets offsets = GetContentOffsetsFromPoint(pt);
|
||||
|
||||
if (!offsets.content)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user