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 77134 9e0f8a7cc1a043f8d0c06c07862f4ac11e7749cf
parent 77133 01225860326563a71ab2d1cc6e92e9b6b60bf256
child 77135 2392fc3ad7584e4972ada934ac20ffb569d7f29c
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs679791
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;
         }
       }
     }
   }