Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: Source/WebCore/accessibility/AccessibilityRenderObject.cpp

Issue 8037036: Merge 94716 - Changes to aria-hidden don't change VO navigation (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/accessibility/AccessibilityObject.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
Merged /trunk/WebCore/accessibility/AccessibilityRenderObject.cpp:r53455
OLDNEW
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 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after
1694 } 1694 }
1695 1695
1696 bool AccessibilityRenderObject::ariaIsHidden() const 1696 bool AccessibilityRenderObject::ariaIsHidden() const
1697 { 1697 {
1698 if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "true")) 1698 if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "true"))
1699 return true; 1699 return true;
1700 1700
1701 // aria-hidden hides this object and any children 1701 // aria-hidden hides this object and any children
1702 AccessibilityObject* object = parentObject(); 1702 AccessibilityObject* object = parentObject();
1703 while (object) { 1703 while (object) {
1704 if (object->isAccessibilityRenderObject() && equalIgnoringCase(static_ca st<AccessibilityRenderObject*>(object)->getAttribute(aria_hiddenAttr), "true")) 1704 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true"))
1705 return true; 1705 return true;
1706 object = object->parentObject(); 1706 object = object->parentObject();
1707 } 1707 }
1708 1708
1709 return false; 1709 return false;
1710 } 1710 }
1711 1711
1712 bool AccessibilityRenderObject::isDescendantOfBarrenParent() const 1712 bool AccessibilityRenderObject::isDescendantOfBarrenParent() const
1713 { 1713 {
1714 for (AccessibilityObject* object = parentObject(); object; object = object-> parentObject()) { 1714 for (AccessibilityObject* object = parentObject(); object; object = object-> parentObject()) {
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
3318 bool sentChildrenChanged = false; 3318 bool sentChildrenChanged = false;
3319 3319
3320 // Go up the accessibility parent chain, but only if the element already exi sts. This method is 3320 // Go up the accessibility parent chain, but only if the element already exi sts. This method is
3321 // called during render layouts, minimal work should be done. 3321 // called during render layouts, minimal work should be done.
3322 // If AX elements are created now, they could interrogate the render tree wh ile it's in a funky state. 3322 // If AX elements are created now, they could interrogate the render tree wh ile it's in a funky state.
3323 // At the same time, process ARIA live region changes. 3323 // At the same time, process ARIA live region changes.
3324 for (AccessibilityObject* parent = this; parent; parent = parent->parentObje ctIfExists()) { 3324 for (AccessibilityObject* parent = this; parent; parent = parent->parentObje ctIfExists()) {
3325 if (!parent->isAccessibilityRenderObject()) 3325 if (!parent->isAccessibilityRenderObject())
3326 continue; 3326 continue;
3327 3327
3328 AccessibilityRenderObject* axParent = static_cast<AccessibilityRenderObj ect*>(parent); 3328 AccessibilityRenderObject* axParent = toAccessibilityRenderObject(parent );
3329 3329
3330 // Send the children changed notification on the first accessibility ren der object ancestor. 3330 // Send the children changed notification on the first accessibility ren der object ancestor.
3331 if (!sentChildrenChanged) { 3331 if (!sentChildrenChanged) {
3332 axObjectCache()->postNotification(axParent->renderer(), AXObjectCach e::AXChildrenChanged, true); 3332 axObjectCache()->postNotification(axParent->renderer(), AXObjectCach e::AXChildrenChanged, true);
3333 sentChildrenChanged = true; 3333 sentChildrenChanged = true;
3334 } 3334 }
3335 3335
3336 // Only do work if the children haven't been marked dirty. This has the effect of blocking 3336 // Only do work if the children haven't been marked dirty. This has the effect of blocking
3337 // future live region change notifications until the AX tree has been ac cessed again. This 3337 // future live region change notifications until the AX tree has been ac cessed again. This
3338 // is a good performance win for all parties. 3338 // is a good performance win for all parties.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
3400 return; 3400 return;
3401 3401
3402 m_haveChildren = true; 3402 m_haveChildren = true;
3403 3403
3404 if (!canHaveChildren()) 3404 if (!canHaveChildren())
3405 return; 3405 return;
3406 3406
3407 // add all unignored acc children 3407 // add all unignored acc children
3408 for (RefPtr<AccessibilityObject> obj = firstChild(); obj; obj = obj->nextSib ling()) { 3408 for (RefPtr<AccessibilityObject> obj = firstChild(); obj; obj = obj->nextSib ling()) {
3409 if (obj->accessibilityIsIgnored()) { 3409 if (obj->accessibilityIsIgnored()) {
3410 obj->updateChildrenIfNecessary(); 3410
3411 // If the parent is asking for this child's children, then either it 's the first time (and clearing is a no-op),
3412 // or its visibility has changed. In the latter case, this child may have a stale child cached.
3413 // This can prevent aria-hidden changes from working correctly. Henc e, whenever a parent is getting children, ensure data is not stale.
3414 obj->clearChildren();
3415
3411 AccessibilityChildrenVector children = obj->children(); 3416 AccessibilityChildrenVector children = obj->children();
3412 unsigned length = children.size(); 3417 unsigned length = children.size();
3413 for (unsigned i = 0; i < length; ++i) 3418 for (unsigned i = 0; i < length; ++i)
3414 m_children.append(children[i]); 3419 m_children.append(children[i]);
3415 } else { 3420 } else {
3416 ASSERT(obj->parentObject() == this); 3421 ASSERT(obj->parentObject() == this);
3417 m_children.append(obj); 3422 m_children.append(obj);
3418 } 3423 }
3419 } 3424 }
3420 3425
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
3750 3755
3751 m_roleForMSAA = msaaRoleForRenderer(m_renderer); 3756 m_roleForMSAA = msaaRoleForRenderer(m_renderer);
3752 3757
3753 if (m_roleForMSAA == UnknownRole) 3758 if (m_roleForMSAA == UnknownRole)
3754 m_roleForMSAA = roleValue(); 3759 m_roleForMSAA = roleValue();
3755 3760
3756 return m_roleForMSAA; 3761 return m_roleForMSAA;
3757 } 3762 }
3758 3763
3759 } // namespace WebCore 3764 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/accessibility/AccessibilityObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698