Bug 894716 - Parameterize nsLayoutUtils::GetNearestScrollableFrame. r=dbaron

This commit is contained in:
Corey Ford
2013-07-30 21:01:06 -07:00
parent 156b377521
commit 0289681dcf
3 changed files with 26 additions and 23 deletions

View File

@@ -2554,15 +2554,14 @@ nsFrame::HandlePress(nsPresContext* aPresContext,
// frame, or something else is already capturing the mouse, there's no
// reason to capture.
if (!nsIPresShell::GetCapturingContent()) {
nsIFrame* checkFrame = this;
nsIScrollableFrame *scrollFrame = nullptr;
while (checkFrame) {
scrollFrame = do_QueryFrame(checkFrame);
if (scrollFrame) {
nsIPresShell::SetCapturingContent(checkFrame->GetContent(), CAPTURE_IGNOREALLOWED);
break;
}
checkFrame = checkFrame->GetParent();
nsIScrollableFrame* scrollFrame =
nsLayoutUtils::GetNearestScrollableFrame(this,
nsLayoutUtils::SCROLLABLE_SAME_DOC |
nsLayoutUtils::SCROLLABLE_INCLUDE_HIDDEN);
if (scrollFrame) {
nsIFrame* capturingFrame = do_QueryFrame(scrollFrame);
nsIPresShell::SetCapturingContent(capturingFrame->GetContent(),
CAPTURE_IGNOREALLOWED);
}
}
@@ -2925,15 +2924,10 @@ NS_IMETHODIMP nsFrame::HandleDrag(nsPresContext* aPresContext,
}
// get the nearest scrollframe
nsIFrame* checkFrame = this;
nsIScrollableFrame *scrollFrame = nullptr;
while (checkFrame) {
scrollFrame = do_QueryFrame(checkFrame);
if (scrollFrame) {
break;
}
checkFrame = checkFrame->GetParent();
}
nsIScrollableFrame* scrollFrame =
nsLayoutUtils::GetNearestScrollableFrame(this,
nsLayoutUtils::SCROLLABLE_SAME_DOC |
nsLayoutUtils::SCROLLABLE_INCLUDE_HIDDEN);
if (scrollFrame) {
nsIFrame* capturingFrame = scrollFrame->GetScrolledFrame();