[Webkit-unassigned] [Bug 25534] [GTK] Objects of ROLE_TABLE should implement the accessible table interface

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 27 05:47:49 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=25534


Xan Lopez <xan.lopez at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #41913|review?                     |review-
               Flag|                            |




--- Comment #13 from Xan Lopez <xan.lopez at gmail.com>  2009-10-27 05:47:49 PDT ---
(From update of attachment 41913)
>+static AccessibilityTableCell* cellAtIndex(AtkTable* table, gint index)
>+{
>+    AccessibilityObject* accTable = core(table);
>+    if (accTable->isAccessibilityRenderObject()) {
>+        AccessibilityObject::AccessibilityChildrenVector allCells;
>+        static_cast<AccessibilityTable*>(accTable)->cells(allCells);
>+        if (0 <= index < allCells.size()) {

Mmm, I don't think this does what you think. '0 <= index' becomes a boolean
(0/1), which is then compared against allCells.size(). So you'd get TRUE in
cases like 0 <= 1000 < 10, because 0 <= 1000 -> 1, 1 < 10 -> 1.

What you need is simply if (0 <= index && index < allCells.size()).


>+            AccessibilityObject* accCell = allCells.at(index).get();
>+            return static_cast<AccessibilityTableCell*>(accCell);
>+        }
>+    }
>+    return NULL;

While you are it, s/NULL/0/

Marking r- for now, but looks good to me otherwise.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list