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

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

Issue 1197723003: Fix aria-owns support in ARIA grids. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix style nit Created 5 years, 6 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 | « LayoutTests/accessibility/aria-owns-grid.html ('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')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 if (!isAXTable()) { 86 if (!isAXTable()) {
87 AXLayoutObject::addChildren(); 87 AXLayoutObject::addChildren();
88 return; 88 return;
89 } 89 }
90 90
91 m_haveChildren = true; 91 m_haveChildren = true;
92 if (!m_layoutObject) 92 if (!m_layoutObject)
93 return; 93 return;
94 94
95 Vector<AXObject*> children;
96 for (AXObject* child = firstChild(); child; child = child->nextSibling())
97 children.append(child);
98 computeAriaOwnsChildren(children);
99
95 AXObjectCacheImpl& axCache = axObjectCache(); 100 AXObjectCacheImpl& axCache = axObjectCache();
96 101
97 // add only rows that are labeled as aria rows 102 // add only rows that are labeled as aria rows
98 HashSet<AXObject*> appendedRows; 103 HashSet<AXObject*> appendedRows;
99 unsigned columnCount = 0; 104 unsigned columnCount = 0;
100 for (RefPtr<AXObject> child = firstChild(); child; child = child->nextSiblin g()) { 105 for (const auto& child : children) {
101 106 if (!addTableCellChild(child, appendedRows, columnCount)) {
102 if (!addTableCellChild(child.get(), appendedRows, columnCount)) {
103 107
104 // in case the layout tree doesn't match the expected ARIA hierarchy , look at the children 108 // in case the layout tree doesn't match the expected ARIA hierarchy , look at the children
105 if (!child->hasChildren()) 109 if (!child->hasChildren())
106 child->addChildren(); 110 child->addChildren();
107 111
108 // The children of this non-row will contain all non-ignored element s (recursing to find them). 112 // The children of this non-row will contain all non-ignored element s (recursing to find them).
109 // This allows the table to dive arbitrarily deep to find the rows. 113 // This allows the table to dive arbitrarily deep to find the rows.
110 for (const auto& childObject : child->children()) 114 for (const auto& childObject : child->children())
111 addTableCellChild(childObject.get(), appendedRows, columnCount); 115 addTableCellChild(childObject.get(), appendedRows, columnCount);
112 } 116 }
113 } 117 }
114 118
115 // make the columns based on the number of columns in the first body 119 // make the columns based on the number of columns in the first body
116 for (unsigned i = 0; i < columnCount; ++i) { 120 for (unsigned i = 0; i < columnCount; ++i) {
117 AXTableColumn* column = toAXTableColumn(axCache.getOrCreate(ColumnRole)) ; 121 AXTableColumn* column = toAXTableColumn(axCache.getOrCreate(ColumnRole)) ;
118 column->setColumnIndex((int)i); 122 column->setColumnIndex((int)i);
119 column->setParent(this); 123 column->setParent(this);
120 m_columns.append(column); 124 m_columns.append(column);
121 if (!column->accessibilityIsIgnored()) 125 if (!column->accessibilityIsIgnored())
122 m_children.append(column); 126 m_children.append(column);
123 } 127 }
124 128
125 AXObject* headerContainerObject = headerContainer(); 129 AXObject* headerContainerObject = headerContainer();
126 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored( )) 130 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored( ))
127 m_children.append(headerContainerObject); 131 m_children.append(headerContainerObject);
128 } 132 }
129 133
130 } // namespace blink 134 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/accessibility/aria-owns-grid.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698