Changeset 140340 in webkit


Ignore:
Timestamp:
Jan 21, 2013 8:57:38 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Crash in AccessibilityTableCell::parentTable()
https://bugs.webkit.org/show_bug.cgi?id=107261

Patch by Joanmarie Diggs <jdiggs@igalia.com> on 2013-01-21
Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/table-destroyed-crash.html

Getting the parent table in order to get the role value should not be
done when objects are being destroyed. Also, it does not seem safe to
assume we have an AXObjectCache.

Moving the logic from roleValue() to determineAccessibilityRole() has
the side effect of not being able to verify the cell is in an AXTable
when that AXTable has not yet been created. Therefore isTableCell()
should look to see if it is the descendant of an AXRow.

  • accessibility/AccessibilityTableCell.cpp:

(WebCore::AccessibilityTableCell::parentTable):
(WebCore::AccessibilityTableCell::isTableCell):
(WebCore::AccessibilityTableCell::determineAccessibilityRole):

  • accessibility/AccessibilityTableCell.h:

(AccessibilityTableCell):

LayoutTests:

Getting the parent table in order to get the role value should not be
done when objects are being destroyed. Also, it does not seem safe to
assume we have an AXObjectCache.

  • accessibility/table-destroyed-crash-expected.txt: Added.
  • accessibility/table-destroyed-crash.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140334 r140340  
     12013-01-21  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        Crash in AccessibilityTableCell::parentTable()
     4        https://bugs.webkit.org/show_bug.cgi?id=107261
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Getting the parent table in order to get the role value should not be
     9        done when objects are being destroyed. Also, it does not seem safe to
     10        assume we have an AXObjectCache.
     11
     12        * accessibility/table-destroyed-crash-expected.txt: Added.
     13        * accessibility/table-destroyed-crash.html: Added.
     14
    1152013-01-21  Ádám Kallai  <kadam@inf.u-szeged.hu>
    216
  • trunk/Source/WebCore/ChangeLog

    r140339 r140340  
     12013-01-21  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        Crash in AccessibilityTableCell::parentTable()
     4        https://bugs.webkit.org/show_bug.cgi?id=107261
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Test: accessibility/table-destroyed-crash.html
     9
     10        Getting the parent table in order to get the role value should not be
     11        done when objects are being destroyed. Also, it does not seem safe to
     12        assume we have an AXObjectCache.
     13
     14        Moving the logic from roleValue() to determineAccessibilityRole() has
     15        the side effect of not being able to verify the cell is in an AXTable
     16        when that AXTable has not yet been created. Therefore isTableCell()
     17        should look to see if it is the descendant of an AXRow.
     18
     19        * accessibility/AccessibilityTableCell.cpp:
     20        (WebCore::AccessibilityTableCell::parentTable):
     21        (WebCore::AccessibilityTableCell::isTableCell):
     22        (WebCore::AccessibilityTableCell::determineAccessibilityRole):
     23        * accessibility/AccessibilityTableCell.h:
     24        (AccessibilityTableCell):
     25
    1262013-01-21  Halton Huo  <halton.huo@intel.com>
    227
  • trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp

    r123428 r140340  
    7575    if (!m_renderer || !m_renderer->isTableCell())
    7676        return 0;
     77
     78    // If the document no longer exists, we might not have an axObjectCache.
     79    if (!axObjectCache())
     80        return 0;
    7781   
    7882    // Do not use getOrCreate. parentTable() can be called while the render tree is being modified
     
    8690bool AccessibilityTableCell::isTableCell() const
    8791{
    88     AccessibilityObject* table = parentTable();
    89     if (!table || !table->isAccessibilityTable())
     92    AccessibilityObject* parent = parentObjectUnignored();
     93    if (!parent || !parent->isTableRow())
    9094        return false;
    9195   
     
    9397}
    9498   
    95 AccessibilityRole AccessibilityTableCell::roleValue() const
     99AccessibilityRole AccessibilityTableCell::determineAccessibilityRole()
    96100{
    97101    if (!isTableCell())
    98         return AccessibilityRenderObject::roleValue();
     102        return AccessibilityRenderObject::determineAccessibilityRole();
    99103   
    100104    return CellRole;
  • trunk/Source/WebCore/accessibility/AccessibilityTableCell.h

    r124582 r140340  
    4343   
    4444    virtual bool isTableCell() const;
    45     virtual AccessibilityRole roleValue() const;
    4645   
    4746    virtual bool accessibilityIsIgnored() const;
     
    5554    virtual AccessibilityObject* parentTable() const;
    5655    int m_rowIndex;
     56    virtual AccessibilityRole determineAccessibilityRole();
    5757
    5858private:
Note: See TracChangeset for help on using the changeset viewer.