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:
roc+%cs.cmu.edu 2004-09-21 13:58:22 +00:00
Родитель ca479a7c10
Коммит ed606a4d5d
2 изменённых файлов: 12 добавлений и 10 удалений

Просмотреть файл

@ -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;
}