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

Side by Side Diff: Source/modules/accessibility/AXLayoutObject.cpp

Issue 1213203002: Move AXObjectCache::remove so it is after ContainerNode::detach Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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
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 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 // case SeparatorRole: 1237 // case SeparatorRole:
1238 return true; 1238 return true;
1239 default: 1239 default:
1240 return false; 1240 return false;
1241 } 1241 }
1242 } 1242 }
1243 1243
1244 AXObject* AXLayoutObject::ancestorForWhichThisIsAPresentationalChild() const 1244 AXObject* AXLayoutObject::ancestorForWhichThisIsAPresentationalChild() const
1245 { 1245 {
1246 // Walk the parent chain looking for a parent that has presentational childr en 1246 // Walk the parent chain looking for a parent that has presentational childr en
1247 AXObject* parent = parentObject(); 1247 AXObject* parent = parentObjectIfExists();
1248 while (parent) { 1248 while (parent) {
1249 if (parent->ariaRoleHasPresentationalChildren()) 1249 if (parent->ariaRoleHasPresentationalChildren())
1250 break; 1250 break;
1251 1251
1252 // The descendants of a AXMenuList that are AXLayoutObjects are all 1252 // The descendants of a AXMenuList that are AXLayoutObjects are all
1253 // presentational. (The real descendants are a AXMenuListPopup and 1253 // presentational. (The real descendants are a AXMenuListPopup and
1254 // AXMenuListOptions, which are not AXLayoutObjects.) 1254 // AXMenuListOptions, which are not AXLayoutObjects.)
1255 if (parent->isMenuList()) 1255 if (parent->isMenuList())
1256 break; 1256 break;
1257 1257
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 1575
1576 return AXObject::elementAccessibilityHitTest(point); 1576 return AXObject::elementAccessibilityHitTest(point);
1577 } 1577 }
1578 1578
1579 // 1579 //
1580 // High-level accessibility tree access. 1580 // High-level accessibility tree access.
1581 // 1581 //
1582 1582
1583 AXObject* AXLayoutObject::computeParent() const 1583 AXObject* AXLayoutObject::computeParent() const
1584 { 1584 {
1585 ASSERT(!isDetached());
1585 if (!m_layoutObject) 1586 if (!m_layoutObject)
1586 return 0; 1587 return 0;
1587 1588
1588 if (ariaRoleAttribute() == MenuBarRole) 1589 if (ariaRoleAttribute() == MenuBarRole)
1589 return axObjectCache().getOrCreate(m_layoutObject->parent()); 1590 return axObjectCache().getOrCreate(m_layoutObject->parent());
1590 1591
1591 // menuButton and its corresponding menu are DOM siblings, but Accessibility needs them to be parent/child 1592 // menuButton and its corresponding menu are DOM siblings, but Accessibility needs them to be parent/child
1592 if (ariaRoleAttribute() == MenuRole) { 1593 if (ariaRoleAttribute() == MenuRole) {
1593 AXObject* parent = menuButtonForMenu(); 1594 AXObject* parent = menuButtonForMenu();
1594 if (parent) 1595 if (parent)
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 } 1689 }
1689 1690
1690 if (!nextSibling) 1691 if (!nextSibling)
1691 return 0; 1692 return 0;
1692 1693
1693 return axObjectCache().getOrCreate(nextSibling); 1694 return axObjectCache().getOrCreate(nextSibling);
1694 } 1695 }
1695 1696
1696 void AXLayoutObject::addChildren() 1697 void AXLayoutObject::addChildren()
1697 { 1698 {
1699 ASSERT(!isDetached());
1698 // If the need to add more children in addition to existing children arises, 1700 // If the need to add more children in addition to existing children arises,
1699 // childrenChanged should have been called, leaving the object with no child ren. 1701 // childrenChanged should have been called, leaving the object with no child ren.
1700 ASSERT(!m_haveChildren); 1702 ASSERT(!m_haveChildren);
1701 1703
1702 m_haveChildren = true; 1704 m_haveChildren = true;
1703 1705
1704 if (!canHaveChildren()) 1706 if (!canHaveChildren())
1705 return; 1707 return;
1706 1708
1707 Vector<AXObject*> ownedChildren; 1709 Vector<AXObject*> ownedChildren;
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
2508 if (label && label->layoutObject()) { 2510 if (label && label->layoutObject()) {
2509 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe ct(); 2511 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe ct();
2510 result.unite(labelRect); 2512 result.unite(labelRect);
2511 } 2513 }
2512 } 2514 }
2513 2515
2514 return result; 2516 return result;
2515 } 2517 }
2516 2518
2517 } // namespace blink 2519 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXInlineTextBox.cpp ('k') | Source/modules/accessibility/AXMenuList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698