OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1703 } | 1703 } |
1704 | 1704 |
1705 bool AccessibilityRenderObject::ariaIsHidden() const | 1705 bool AccessibilityRenderObject::ariaIsHidden() const |
1706 { | 1706 { |
1707 if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "true")) | 1707 if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "true")) |
1708 return true; | 1708 return true; |
1709 | 1709 |
1710 // aria-hidden hides this object and any children | 1710 // aria-hidden hides this object and any children |
1711 AccessibilityObject* object = parentObject(); | 1711 AccessibilityObject* object = parentObject(); |
1712 while (object) { | 1712 while (object) { |
1713 if (object->isAccessibilityRenderObject() && equalIgnoringCase(static_ca
st<AccessibilityRenderObject*>(object)->getAttribute(aria_hiddenAttr), "true")) | 1713 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true")) |
1714 return true; | 1714 return true; |
1715 object = object->parentObject(); | 1715 object = object->parentObject(); |
1716 } | 1716 } |
1717 | 1717 |
1718 return false; | 1718 return false; |
1719 } | 1719 } |
1720 | 1720 |
1721 bool AccessibilityRenderObject::isDescendantOfBarrenParent() const | 1721 bool AccessibilityRenderObject::isDescendantOfBarrenParent() const |
1722 { | 1722 { |
1723 for (AccessibilityObject* object = parentObject(); object; object = object->
parentObject()) { | 1723 for (AccessibilityObject* object = parentObject(); object; object = object->
parentObject()) { |
(...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3375 bool sentChildrenChanged = false; | 3375 bool sentChildrenChanged = false; |
3376 | 3376 |
3377 // Go up the accessibility parent chain, but only if the element already exi
sts. This method is | 3377 // Go up the accessibility parent chain, but only if the element already exi
sts. This method is |
3378 // called during render layouts, minimal work should be done. | 3378 // called during render layouts, minimal work should be done. |
3379 // If AX elements are created now, they could interrogate the render tree wh
ile it's in a funky state. | 3379 // If AX elements are created now, they could interrogate the render tree wh
ile it's in a funky state. |
3380 // At the same time, process ARIA live region changes. | 3380 // At the same time, process ARIA live region changes. |
3381 for (AccessibilityObject* parent = this; parent; parent = parent->parentObje
ctIfExists()) { | 3381 for (AccessibilityObject* parent = this; parent; parent = parent->parentObje
ctIfExists()) { |
3382 if (!parent->isAccessibilityRenderObject()) | 3382 if (!parent->isAccessibilityRenderObject()) |
3383 continue; | 3383 continue; |
3384 | 3384 |
3385 AccessibilityRenderObject* axParent = static_cast<AccessibilityRenderObj
ect*>(parent); | 3385 AccessibilityRenderObject* axParent = toAccessibilityRenderObject(parent
); |
3386 | 3386 |
3387 // Send the children changed notification on the first accessibility ren
der object ancestor. | 3387 // Send the children changed notification on the first accessibility ren
der object ancestor. |
3388 if (!sentChildrenChanged) { | 3388 if (!sentChildrenChanged) { |
3389 axObjectCache()->postNotification(axParent->renderer(), AXObjectCach
e::AXChildrenChanged, true); | 3389 axObjectCache()->postNotification(axParent->renderer(), AXObjectCach
e::AXChildrenChanged, true); |
3390 sentChildrenChanged = true; | 3390 sentChildrenChanged = true; |
3391 } | 3391 } |
3392 | 3392 |
3393 // Only do work if the children haven't been marked dirty. This has the
effect of blocking | 3393 // Only do work if the children haven't been marked dirty. This has the
effect of blocking |
3394 // future live region change notifications until the AX tree has been ac
cessed again. This | 3394 // future live region change notifications until the AX tree has been ac
cessed again. This |
3395 // is a good performance win for all parties. | 3395 // is a good performance win for all parties. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3457 return; | 3457 return; |
3458 | 3458 |
3459 m_haveChildren = true; | 3459 m_haveChildren = true; |
3460 | 3460 |
3461 if (!canHaveChildren()) | 3461 if (!canHaveChildren()) |
3462 return; | 3462 return; |
3463 | 3463 |
3464 // add all unignored acc children | 3464 // add all unignored acc children |
3465 for (RefPtr<AccessibilityObject> obj = firstChild(); obj; obj = obj->nextSib
ling()) { | 3465 for (RefPtr<AccessibilityObject> obj = firstChild(); obj; obj = obj->nextSib
ling()) { |
3466 if (obj->accessibilityIsIgnored()) { | 3466 if (obj->accessibilityIsIgnored()) { |
3467 obj->updateChildrenIfNecessary(); | 3467 |
| 3468 // If the parent is asking for this child's children, then either it
's the first time (and clearing is a no-op), |
| 3469 // or its visibility has changed. In the latter case, this child may
have a stale child cached. |
| 3470 // This can prevent aria-hidden changes from working correctly. Henc
e, whenever a parent is getting children, ensure data is not stale. |
| 3471 obj->clearChildren(); |
| 3472 |
3468 AccessibilityChildrenVector children = obj->children(); | 3473 AccessibilityChildrenVector children = obj->children(); |
3469 unsigned length = children.size(); | 3474 unsigned length = children.size(); |
3470 for (unsigned i = 0; i < length; ++i) | 3475 for (unsigned i = 0; i < length; ++i) |
3471 m_children.append(children[i]); | 3476 m_children.append(children[i]); |
3472 } else { | 3477 } else { |
3473 ASSERT(obj->parentObject() == this); | 3478 ASSERT(obj->parentObject() == this); |
3474 m_children.append(obj); | 3479 m_children.append(obj); |
3475 } | 3480 } |
3476 } | 3481 } |
3477 | 3482 |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3867 | 3872 |
3868 m_roleForMSAA = msaaRoleForRenderer(m_renderer); | 3873 m_roleForMSAA = msaaRoleForRenderer(m_renderer); |
3869 | 3874 |
3870 if (m_roleForMSAA == UnknownRole) | 3875 if (m_roleForMSAA == UnknownRole) |
3871 m_roleForMSAA = roleValue(); | 3876 m_roleForMSAA = roleValue(); |
3872 | 3877 |
3873 return m_roleForMSAA; | 3878 return m_roleForMSAA; |
3874 } | 3879 } |
3875 | 3880 |
3876 } // namespace WebCore | 3881 } // namespace WebCore |
OLD | NEW |