Bug 679791 - Make nsIFrame::IsFocusable use heuristics that don't depend on the graphical display of scrollbars. r=roc
authorJosh Matthews <josh@joshmatthews.net>
Wed, 17 Aug 2011 13:55:57 -0400
changeset 75823 9e0f8a7cc1a043f8d0c06c07862f4ac11e7749cf
parent 75822 01225860326563a71ab2d1cc6e92e9b6b60bf256
child 75824 2392fc3ad7584e4972ada934ac20ffb569d7f29c
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersroc
bugs679791
milestone9.0a1
Bug 679791 - Make nsIFrame::IsFocusable use heuristics that don't depend on the graphical display of scrollbars. r=roc
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -6602,17 +6602,18 @@ nsIFrame::IsFocusable(PRInt32 *aTabIndex
         // Otherwise you couldn't scroll them with keyboard, which is
         // an accessibility issue (e.g. Section 508 rules)
         // However, we don't make them to be focusable with the mouse,
         // because the extra focus outlines are considered unnecessarily ugly.
         // When clicked on, the selection position within the element 
         // will be enough to make them keyboard scrollable.
         nsIScrollableFrame *scrollFrame = do_QueryFrame(this);
         if (scrollFrame &&
-            scrollFrame->GetActualScrollbarSizes() != nsMargin(0,0,0,0)) {
+            scrollFrame->GetScrollbarStyles() != nsIScrollableFrame::ScrollbarStyles(NS_STYLE_OVERFLOW_HIDDEN, NS_STYLE_OVERFLOW_HIDDEN) &&
+            !scrollFrame->GetScrollRange().IsEqualEdges(nsRect(0, 0, 0, 0))) {
             // Scroll bars will be used for overflow
             isFocusable = PR_TRUE;
             tabIndex = 0;
         }
       }
     }
   }