зеркало из https://github.com/mozilla/gecko-dev.git
Bug 258175. Always capture the mouse at the root of the document if we haven't captured it in any child. r+sr=bzbarsky
This commit is contained in:
Родитель
ca479a7c10
Коммит
ed606a4d5d
|
@ -1667,14 +1667,15 @@ nsFrame::PeekBackwardAndForward(nsSelectionAmount aAmountBack,
|
|||
// Figure out which view we should point capturing at, given that drag started
|
||||
// in this frame.
|
||||
static nsIView* GetNearestCapturingView(nsIFrame* aFrame) {
|
||||
nsIView* view;
|
||||
while (aFrame && !(view = aFrame->GetMouseCapturer())) {
|
||||
nsIView* view = nsnull;
|
||||
while (!(view = aFrame->GetMouseCapturer()) && aFrame->GetParent()) {
|
||||
aFrame = aFrame->GetParent();
|
||||
}
|
||||
if (!aFrame) {
|
||||
return nsnull;
|
||||
if (!view) {
|
||||
// Use the root view. The root frame always has the root view.
|
||||
view = aFrame->GetView();
|
||||
}
|
||||
|
||||
NS_ASSERTION(view, "No capturing view found");
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -1667,14 +1667,15 @@ nsFrame::PeekBackwardAndForward(nsSelectionAmount aAmountBack,
|
|||
// Figure out which view we should point capturing at, given that drag started
|
||||
// in this frame.
|
||||
static nsIView* GetNearestCapturingView(nsIFrame* aFrame) {
|
||||
nsIView* view;
|
||||
while (aFrame && !(view = aFrame->GetMouseCapturer())) {
|
||||
nsIView* view = nsnull;
|
||||
while (!(view = aFrame->GetMouseCapturer()) && aFrame->GetParent()) {
|
||||
aFrame = aFrame->GetParent();
|
||||
}
|
||||
if (!aFrame) {
|
||||
return nsnull;
|
||||
if (!view) {
|
||||
// Use the root view. The root frame always has the root view.
|
||||
view = aFrame->GetView();
|
||||
}
|
||||
|
||||
NS_ASSERTION(view, "No capturing view found");
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче