OLD | NEW |
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 children.append(child); | 93 children.append(child); |
94 computeAriaOwnsChildren(children); | 94 computeAriaOwnsChildren(children); |
95 | 95 |
96 AXObjectCacheImpl& axCache = axObjectCache(); | 96 AXObjectCacheImpl& axCache = axObjectCache(); |
97 | 97 |
98 // Only add children that are actually rows. | 98 // Only add children that are actually rows. |
99 HeapHashSet<Member<AXObject>> appendedRows; | 99 HeapHashSet<Member<AXObject>> appendedRows; |
100 unsigned columnCount = 0; | 100 unsigned columnCount = 0; |
101 for (const auto& child : children) { | 101 for (const auto& child : children) { |
102 if (!addTableRowChild(child, appendedRows, columnCount)) { | 102 if (!addTableRowChild(child, appendedRows, columnCount)) { |
103 // in case the layout tree doesn't match the expected ARIA hierarchy, look
at the children | 103 // in case the layout tree doesn't match the expected ARIA hierarchy, look |
| 104 // at the children |
104 if (!child->hasChildren()) | 105 if (!child->hasChildren()) |
105 child->addChildren(); | 106 child->addChildren(); |
106 | 107 |
107 // The children of this non-row will contain all non-ignored elements (rec
ursing to find them). | 108 // The children of this non-row will contain all non-ignored elements |
108 // This allows the table to dive arbitrarily deep to find the rows. | 109 // (recursing to find them). This allows the table to dive arbitrarily |
| 110 // deep to find the rows. |
109 for (const auto& childObject : child->children()) | 111 for (const auto& childObject : child->children()) |
110 addTableRowChild(childObject.get(), appendedRows, columnCount); | 112 addTableRowChild(childObject.get(), appendedRows, columnCount); |
111 } | 113 } |
112 } | 114 } |
113 | 115 |
114 // make the columns based on the number of columns in the first body | 116 // make the columns based on the number of columns in the first body |
115 for (unsigned i = 0; i < columnCount; ++i) { | 117 for (unsigned i = 0; i < columnCount; ++i) { |
116 AXTableColumn* column = toAXTableColumn(axCache.getOrCreate(ColumnRole)); | 118 AXTableColumn* column = toAXTableColumn(axCache.getOrCreate(ColumnRole)); |
117 column->setColumnIndex((int)i); | 119 column->setColumnIndex((int)i); |
118 column->setParent(this); | 120 column->setParent(this); |
119 m_columns.append(column); | 121 m_columns.append(column); |
120 if (!column->accessibilityIsIgnored()) | 122 if (!column->accessibilityIsIgnored()) |
121 m_children.append(column); | 123 m_children.append(column); |
122 } | 124 } |
123 | 125 |
124 AXObject* headerContainerObject = headerContainer(); | 126 AXObject* headerContainerObject = headerContainer(); |
125 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored()) | 127 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored()) |
126 m_children.append(headerContainerObject); | 128 m_children.append(headerContainerObject); |
127 } | 129 } |
128 | 130 |
129 } // namespace blink | 131 } // namespace blink |
OLD | NEW |