зеркало из 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
|
// Figure out which view we should point capturing at, given that drag started
|
||||||
// in this frame.
|
// in this frame.
|
||||||
static nsIView* GetNearestCapturingView(nsIFrame* aFrame) {
|
static nsIView* GetNearestCapturingView(nsIFrame* aFrame) {
|
||||||
nsIView* view;
|
nsIView* view = nsnull;
|
||||||
while (aFrame && !(view = aFrame->GetMouseCapturer())) {
|
while (!(view = aFrame->GetMouseCapturer()) && aFrame->GetParent()) {
|
||||||
aFrame = aFrame->GetParent();
|
aFrame = aFrame->GetParent();
|
||||||
}
|
}
|
||||||
if (!aFrame) {
|
if (!view) {
|
||||||
return nsnull;
|
// Use the root view. The root frame always has the root view.
|
||||||
|
view = aFrame->GetView();
|
||||||
}
|
}
|
||||||
|
NS_ASSERTION(view, "No capturing view found");
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1667,14 +1667,15 @@ nsFrame::PeekBackwardAndForward(nsSelectionAmount aAmountBack,
|
||||||
// Figure out which view we should point capturing at, given that drag started
|
// Figure out which view we should point capturing at, given that drag started
|
||||||
// in this frame.
|
// in this frame.
|
||||||
static nsIView* GetNearestCapturingView(nsIFrame* aFrame) {
|
static nsIView* GetNearestCapturingView(nsIFrame* aFrame) {
|
||||||
nsIView* view;
|
nsIView* view = nsnull;
|
||||||
while (aFrame && !(view = aFrame->GetMouseCapturer())) {
|
while (!(view = aFrame->GetMouseCapturer()) && aFrame->GetParent()) {
|
||||||
aFrame = aFrame->GetParent();
|
aFrame = aFrame->GetParent();
|
||||||
}
|
}
|
||||||
if (!aFrame) {
|
if (!view) {
|
||||||
return nsnull;
|
// Use the root view. The root frame always has the root view.
|
||||||
|
view = aFrame->GetView();
|
||||||
}
|
}
|
||||||
|
NS_ASSERTION(view, "No capturing view found");
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче