Changeset 40098 in webkit


Ignore:
Timestamp:
Jan 21, 2009 2:55:01 PM (15 years ago)
Author:
Chris Fleizach
Message:

Bug 23443: Table accessibility should be re-enabled after fixing crash that occurs at WebCore::AccessibilityTable::isTableExposableThroughAccessibility() when attempting to create a link in a rich text message
https://bugs.webkit.org/show_bug.cgi?id=23443

Re-enable Accessibility tables and make sure accessibility code does not interrogate the render tree
during render tree updates

Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r40097 r40098  
     12009-01-21  Chris Fleizach  <cfleizach@apple.com>
     2
     3        Reviewed by Beth Dakin.
     4
     5        Test to make sure accessibility doesn't crash when a table is modified through JavaScript
     6
     7        * accessibility/table-modification-crash-expected.txt: Added.
     8        * accessibility/table-modification-crash.html: Added.
     9
    1102009-01-16  Eric Seidel  <eric@webkit.org>
    211
  • trunk/WebCore/ChangeLog

    r40097 r40098  
     12009-01-21  Chris Fleizach  <cfleizach@apple.com>
     2
     3        Reviewed by Beth Dakin.
     4
     5        Bug 23443: Table accessibility should be re-enabled after fixing crash that occurs at WebCore::AccessibilityTable::isTableExposableThroughAccessibility()
     6        https://bugs.webkit.org/show_bug.cgi?id=23443
     7
     8        Test: accessibility/table-modification-crash.html
     9
     10        * page/AccessibilityObject.cpp:
     11        (WebCore::AccessibilityObject::updateBackingStore):
     12        * page/AccessibilityObject.h:
     13        * page/AccessibilityRenderObject.cpp:
     14        (WebCore::AccessibilityRenderObject::childrenChanged):
     15        (WebCore::AccessibilityRenderObject::children):
     16        (WebCore::AccessibilityRenderObject::updateBackingStore):
     17        * page/AccessibilityRenderObject.h:
     18        (WebCore::AccessibilityRenderObject::markChildrenDirty):
     19        * page/AccessibilityTable.cpp:
     20        (WebCore::AccessibilityTable::AccessibilityTable):
     21        * page/mac/AccessibilityObjectWrapper.mm:
     22        (-[AccessibilityObjectWrapper accessibilityActionNames]):
     23        (-[AccessibilityObjectWrapper accessibilityAttributeNames]):
     24        (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
     25        (-[AccessibilityObjectWrapper accessibilityFocusedUIElement]):
     26        (-[AccessibilityObjectWrapper accessibilityHitTest:]):
     27        (-[AccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
     28        (-[AccessibilityObjectWrapper accessibilityIsIgnored]):
     29        (-[AccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
     30        (-[AccessibilityObjectWrapper accessibilityPerformPressAction]):
     31        (-[AccessibilityObjectWrapper accessibilityPerformAction:]):
     32        (-[AccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
     33        (-[AccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
     34        (-[AccessibilityObjectWrapper accessibilityIndexOfChild:]):
     35        (-[AccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
     36        (-[AccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
     37        * rendering/RenderObject.cpp:
     38        (WebCore::RenderObject::destroy):
     39        * rendering/RenderWidget.cpp:
     40        (WebCore::RenderWidget::destroy):
     41
    1422009-01-16  Eric Seidel  <eric@webkit.org>
    243
  • trunk/WebCore/page/AccessibilityObject.cpp

    r39601 r40098  
    10291029}
    10301030
     1031void AccessibilityObject::updateBackingStore()
     1032{
     1033}
     1034   
    10311035} // namespace WebCore
  • trunk/WebCore/page/AccessibilityObject.h

    r40003 r40098  
    401401#endif
    402402
     403    // allows for an AccessibilityObject to update its render tree or perform
     404    // other operations update type operations
     405    virtual void updateBackingStore();
     406   
    403407protected:
    404408    unsigned m_id;
  • trunk/WebCore/page/AccessibilityRenderObject.cpp

    r40030 r40098  
    22162216void AccessibilityRenderObject::childrenChanged()
    22172217{
    2218     clearChildren();
    2219    
    2220     if (accessibilityIsIgnored()) {
    2221         AccessibilityObject* parent = parentObject();
    2222         if (parent)
    2223             parent->childrenChanged();
     2218    // this method is meant as a quick way of marking dirty
     2219    // a portion of the accessibility tree
     2220   
     2221    markChildrenDirty();
     2222   
     2223    // this object may not be accessible (and thus may not appear
     2224    // in the hierarchy), which means we need to go up the parent
     2225    // chain and mark the parent's dirty. Ideally, we would want
     2226    // to only access the next object that is not ignored, but
     2227    // asking an element if it's ignored can lead to an examination of the
     2228    // render tree which is dangerous.
     2229    for (AccessibilityObject* parent = parentObject(); parent; parent = parent->parentObject()) {
     2230        if (parent->isAccessibilityRenderObject())
     2231            static_cast<AccessibilityRenderObject *>(parent)->markChildrenDirty();
    22242232    }
    22252233}
     
    22452253const AccessibilityObject::AccessibilityChildrenVector& AccessibilityRenderObject::children()
    22462254{
     2255    if (m_childrenDirty) {
     2256        clearChildren();       
     2257        m_childrenDirty = false;
     2258    }
     2259   
    22472260    if (!m_haveChildren)
    22482261        addChildren();
     
    24052418}
    24062419     
     2420void AccessibilityRenderObject::updateBackingStore()
     2421{
     2422    if (!m_renderer)
     2423        return;
     2424    m_renderer->view()->layoutIfNeeded();
     2425}   
    24072426   
    24082427} // namespace WebCore
  • trunk/WebCore/page/AccessibilityRenderObject.h

    r40003 r40098  
    210210    virtual IntRect doAXBoundsForRange(const PlainTextRange&) const;
    211211   
     212    virtual void updateBackingStore();
     213   
    212214protected:
    213215    RenderObject* m_renderer;
    214216    AccessibilityRole m_ariaRole;
     217    mutable bool m_childrenDirty;
    215218   
    216219    void setRenderObject(RenderObject* renderer) { m_renderer = renderer; }
     
    232235    AccessibilityObject* accessibilityParentForImageMap(HTMLMapElement* map) const;
    233236
     237    void markChildrenDirty() const { m_childrenDirty = true; }
    234238};
    235239   
  • trunk/WebCore/page/AccessibilityTable.cpp

    r39414 r40098  
    5454    m_headerContainer(0)
    5555{
    56     // FIXME: We need to disable Accessibility Tables entirely on the Mac until <rdar://problem/6372481> is resolved.
    57 #if PLATFORM(MAC)
     56#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
    5857    m_isAccessibilityTable = false;
    59 #else   
     58#else
    6059    m_isAccessibilityTable = isTableExposableThroughAccessibility();
    6160#endif
    62 
    6361}
    6462
  • trunk/WebCore/page/mac/AccessibilityObjectWrapper.mm

    r40033 r40098  
    581581- (NSArray*)accessibilityActionNames
    582582{
     583    m_object->updateBackingStore();
     584
    583585    static NSArray* actionElementActions = [[NSArray alloc] initWithObjects: NSAccessibilityPressAction, NSAccessibilityShowMenuAction, nil];
    584586    static NSArray* defaultElementActions = [[NSArray alloc] initWithObjects: NSAccessibilityShowMenuAction, nil];
     
    600602- (NSArray*)accessibilityAttributeNames
    601603{
     604    m_object->updateBackingStore();
     605   
    602606    if (m_object->isAttachment())
    603607        return [[self attachmentView] accessibilityAttributeNames];
     
    11251129        return nil;
    11261130
     1131    m_object->updateBackingStore();
     1132   
    11271133    if ([attributeName isEqualToString: NSAccessibilityRoleAttribute])
    11281134        return [self role];
     
    14311437- (id)accessibilityFocusedUIElement
    14321438{
     1439    m_object->updateBackingStore();
     1440
    14331441    RefPtr<AccessibilityObject> focusedObj = m_object->focusedUIElement();
    14341442
     
    14411449- (id)accessibilityHitTest:(NSPoint)point
    14421450{
     1451    m_object->updateBackingStore();
     1452
    14431453    RefPtr<AccessibilityObject> axObject = m_object->doAccessibilityHitTest(IntPoint(point));
    14441454    if (axObject)
     
    14491459- (BOOL)accessibilityIsAttributeSettable:(NSString*)attributeName
    14501460{
     1461    m_object->updateBackingStore();
     1462
    14511463    if ([attributeName isEqualToString: @"AXSelectedTextMarkerRange"])
    14521464        return YES;
     
    14831495- (BOOL)accessibilityIsIgnored
    14841496{
     1497    m_object->updateBackingStore();
     1498
    14851499    if (m_object->isAttachment())
    14861500        return [[self attachmentView] accessibilityIsIgnored];
     
    14901504- (NSArray* )accessibilityParameterizedAttributeNames
    14911505{
     1506    m_object->updateBackingStore();
     1507
    14921508    if (m_object->isAttachment())
    14931509        return nil;
     
    15701586- (void)accessibilityPerformPressAction
    15711587{
     1588    m_object->updateBackingStore();
     1589
    15721590    if (m_object->isAttachment())
    15731591        [[self attachmentView] accessibilityPerformAction:NSAccessibilityPressAction];
     
    16141632- (void)accessibilityPerformAction:(NSString*)action
    16151633{
     1634    m_object->updateBackingStore();
     1635
    16161636    if ([action isEqualToString:NSAccessibilityPressAction])
    16171637        [self accessibilityPerformPressAction];
     
    16231643- (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attributeName
    16241644{
     1645    m_object->updateBackingStore();
     1646
    16251647    WebCoreTextMarkerRange* textMarkerRange = nil;
    16261648    NSNumber*               number = nil;
     
    17451767        return nil;
    17461768
     1769    m_object->updateBackingStore();
     1770   
    17471771    // common parameter type check/casting.  Nil checks in handlers catch wrong type case.
    17481772    // NOTE: This assumes nil is not a valid parameter, because it is indistinguishable from
     
    19902014- (NSUInteger)accessibilityIndexOfChild:(id)child
    19912015{
     2016    m_object->updateBackingStore();
     2017   
    19922018    const AccessibilityObject::AccessibilityChildrenVector& children = m_object->children();
    19932019       
     
    20062032- (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute
    20072033{
     2034    m_object->updateBackingStore();
     2035   
    20082036    if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
    20092037        const AccessibilityObject::AccessibilityChildrenVector& children = m_object->children();
     
    20192047- (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount
    20202048{
     2049    m_object->updateBackingStore();
     2050   
    20212051    if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
    20222052        if (m_object->children().isEmpty()) {
  • trunk/WebCore/rendering/RenderObject.cpp

    r40074 r40098  
    26232623        RenderCounter::destroyCounterNodes(this);
    26242624
    2625     if (AXObjectCache::accessibilityEnabled())
     2625    if (AXObjectCache::accessibilityEnabled()) {
     2626        document()->axObjectCache()->childrenChanged(this->parent());
    26262627        document()->axObjectCache()->remove(this);
    2627 
     2628    }
    26282629    animation()->cancelAnimations(this);
    26292630
  • trunk/WebCore/rendering/RenderWidget.cpp

    r39175 r40098  
    7676        v->removeWidget(this);
    7777
    78     if (AXObjectCache::accessibilityEnabled())
     78    if (AXObjectCache::accessibilityEnabled()) {
     79        document()->axObjectCache()->childrenChanged(this->parent());
    7980        document()->axObjectCache()->remove(this);
    80 
     81    }
    8182    remove();
    8283
Note: See TracChangeset for help on using the changeset viewer.