Bug 1013006 - Ignore actionCount on text leaves when checking if the subtree is flat. r=yzen
authorEitan Isaacson <eitan@monotonous.org>
Tue, 20 May 2014 12:01:22 -0700
changeset 184000 37e1dd2155b68297531da4d122da2b9f5b20d146
parent 183999 48a5383944fad959ab6cc569df364d21e93a00e3
child 184001 57f1981b6a49710bf7a8afcd57d2410c165e1ab3
push id26810
push usercbook@mozilla.com
push dateWed, 21 May 2014 11:46:36 +0000
treeherdermozilla-central@50fb8c4db2fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyzen
bugs1013006
milestone32.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 1013006 - Ignore actionCount on text leaves when checking if the subtree is flat. r=yzen
accessible/src/jsat/TraversalRules.jsm
accessible/tests/mochitest/jsat/doc_traversal.html
--- a/accessible/src/jsat/TraversalRules.jsm
+++ b/accessible/src/jsat/TraversalRules.jsm
@@ -108,16 +108,21 @@ var gSimpleMatchFunc = function gSimpleM
         return false;
       }
     }
     return true;
   }
 
   function isFlatSubtree(acc) {
     for (let child = acc.firstChild; child; child = child.nextSibling) {
+      // text leafs inherit the actionCount of any ancestor that has a click
+      // listener.
+      if ([Roles.TEXT_LEAF, Roles.STATICTEXT].indexOf(child.role) >= 0) {
+        continue;
+      }
       if (child.childCount > 0 || child.actionCount > 0) {
         return false;
       }
     }
     return true;
   }
 
   switch (aAccessible.role) {
--- a/accessible/tests/mochitest/jsat/doc_traversal.html
+++ b/accessible/tests/mochitest/jsat/doc_traversal.html
@@ -55,17 +55,17 @@
   <div id="button-2-3" tabindex="0" role="button" aria-pressed="false">My little togglebutton</div>
   <div id="button-2-4" tabindex="0" role="spinbutton">ARIA fun</div>
   <h1 id="heading-4" style="display:none">Invisible header</h1>
   <dl id="list-1">
     <dt id="listitem-1-1">Programming Language</dt>
     <dd>A esoteric weapon wielded by only the most formidable warriors,
     for its unrelenting strict power is unfathomable.</dd>
   </dl>
-  <ul id="list-2">
+  <ul id="list-2" onclick="alert('hi');">
     <li id="listitem-2-1">Lists of Programming Languages</li>
     <li id="listitem-2-2">Lisp
       <ol id="list-3">
         <li id="listitem-3-1">Scheme</li>
         <li id="listitem-3-2">Racket</li>
         <li id="listitem-3-3">Clojure</li>
         <li id="listitem-3-4"><strong>Standard</strong> Lisp</li>
         <li id="listitem-3-5"><a id="link-0" href="#">Common</a> Lisp</li>