Bug 906670 - Can sometimes accessibility focus hidden content from about:home. r=lucasr
authorMax Li <maxli@maxli.ca>
Wed, 28 Aug 2013 10:37:57 -0400
changeset 144952 e355c7aae965057353b6db2d8fc0ba6d08259c75
parent 144951 38950e6974b965cfb7d4fd63eaeaa20a369cf975
child 145012 41afb723e7333f99277fb9c409953b75956b9bd0
push id2452
push usermaxli@maxli.ca
push dateThu, 29 Aug 2013 20:10:46 +0000
treeherderfx-team@e355c7aae965 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr
bugs906670
milestone26.0a1
Bug 906670 - Can sometimes accessibility focus hidden content from about:home. r=lucasr
mobile/android/base/BrowserApp.java
mobile/android/base/GeckoAccessibility.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1436,19 +1436,21 @@ abstract public class BrowserApp extends
         animateHideHomePager();
         hideBrowserSearch();
 
         return true;
     }
 
     void filterEditingMode(String searchTerm, AutocompleteHandler handler) {
         if (TextUtils.isEmpty(searchTerm)) {
+            mHomePager.setVisibility(View.VISIBLE);
             hideBrowserSearch();
         } else {
             showBrowserSearch();
+            mHomePager.setVisibility(View.INVISIBLE);
             mBrowserSearch.filter(searchTerm, handler);
         }
     }
 
     private void showHomePager(HomePager.Page page) {
         showHomePagerWithAnimator(page, null);
     }
 
--- a/mobile/android/base/GeckoAccessibility.java
+++ b/mobile/android/base/GeckoAccessibility.java
@@ -296,17 +296,17 @@ public class GeckoAccessibility {
                                 onInitializeAccessibilityNodeInfo(host, info);
                                 info.addChild(host, VIRTUAL_CURSOR_PREVIOUS);
                                 info.addChild(host, VIRTUAL_CURSOR_POSITION);
                                 info.addChild(host, VIRTUAL_CURSOR_NEXT);
                                 break;
                             default:
                                 info.setParent(host);
                                 info.setSource(host, virtualDescendantId);
-                                info.setVisibleToUser(true);
+                                info.setVisibleToUser(host.isFocused());
                                 info.setPackageName(GeckoAppShell.getContext().getPackageName());
                                 info.setClassName(host.getClass().getName());
                                 info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
                                 info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
                                 info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
                                 info.addAction(AccessibilityNodeInfo.ACTION_LONG_CLICK);
                                 info.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY);
                                 info.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY);