Bug 254966. Make css scrollable elements tab navigable. r=mats, sr=roc

git-svn-id: svn://10.0.0.236/trunk@161578 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
aaronleventhal%moonset.net
2004-09-01 14:58:34 +00:00
parent 9d27279c06
commit ef3f8b9010
17 changed files with 170 additions and 58 deletions

View File

@@ -3665,22 +3665,21 @@ nsIScrollableView*
PresShell::GetViewToScroll()
{
nsCOMPtr<nsIEventStateManager> esm = mPresContext->EventStateManager();
nsIFrame* selectionFrame = nsnull;
nsIScrollableView* scrollView = nsnull;
nsCOMPtr<nsIContent> selectionContent, endSelectionContent; // NOT USED
PRUint32 selectionOffset; // NOT USED
esm->GetDocSelectionLocation(getter_AddRefs(selectionContent),
getter_AddRefs(endSelectionContent),
&selectionFrame,
&selectionOffset);
if (selectionFrame) {
nsCOMPtr<nsIScrollableViewProvider> svp = do_QueryInterface(selectionFrame);
if (svp) {
svp->GetScrollableView(mPresContext, &scrollView);
} else {
nsIView* selectionView = selectionFrame->GetClosestView();
if (selectionView)
scrollView = nsLayoutUtils::GetNearestScrollingView(selectionView);
nsCOMPtr<nsIContent> focusedContent;
esm->GetFocusedContent(getter_AddRefs(focusedContent));
if (focusedContent) {
nsIFrame* startFrame = nsnull;
GetPrimaryFrameFor(focusedContent, &startFrame);
if (startFrame) {
nsCOMPtr<nsIScrollableViewProvider> svp = do_QueryInterface(startFrame);
if (svp) {
svp->GetScrollableView(mPresContext, &scrollView);
} else {
nsIView* startView = startFrame->GetClosestView();
if (startView)
scrollView = nsLayoutUtils::GetNearestScrollingView(startView);
}
}
}
if (!scrollView) {