| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 PassRefPtr<AccessibilityARIAGrid> AccessibilityARIAGrid::create(RenderObject* re
nderer) | 50 PassRefPtr<AccessibilityARIAGrid> AccessibilityARIAGrid::create(RenderObject* re
nderer) |
| 51 { | 51 { |
| 52 return adoptRef(new AccessibilityARIAGrid(renderer)); | 52 return adoptRef(new AccessibilityARIAGrid(renderer)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool AccessibilityARIAGrid::addTableCellChild(AccessibilityObject* child, HashSe
t<AccessibilityObject*>& appendedRows, unsigned& columnCount) | 55 bool AccessibilityARIAGrid::addTableCellChild(AccessibilityObject* child, HashSe
t<AccessibilityObject*>& appendedRows, unsigned& columnCount) |
| 56 { | 56 { |
| 57 if (!child || !child->isTableRow() || child->ariaRoleAttribute() != RowRole) | 57 if (!child || !child->isTableRow() || child->ariaRoleAttribute() != RowRole) |
| 58 return false; | 58 return false; |
| 59 | 59 |
| 60 AccessibilityTableRow* row = static_cast<AccessibilityTableRow*>(child); | 60 AccessibilityTableRow* row = toAccessibilityTableRow(child); |
| 61 if (appendedRows.contains(row)) | 61 if (appendedRows.contains(row)) |
| 62 return false; | 62 return false; |
| 63 | 63 |
| 64 // store the maximum number of columns | 64 // store the maximum number of columns |
| 65 unsigned rowCellCount = row->children().size(); | 65 unsigned rowCellCount = row->children().size(); |
| 66 if (rowCellCount > columnCount) | 66 if (rowCellCount > columnCount) |
| 67 columnCount = rowCellCount; | 67 columnCount = rowCellCount; |
| 68 | 68 |
| 69 row->setRowIndex((int)m_rows.size()); | 69 row->setRowIndex((int)m_rows.size()); |
| 70 m_rows.append(row); | 70 m_rows.append(row); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // This allows the table to dive arbitrarily deep to find the rows. | 110 // This allows the table to dive arbitrarily deep to find the rows. |
| 111 AccessibilityChildrenVector children = child->children(); | 111 AccessibilityChildrenVector children = child->children(); |
| 112 size_t length = children.size(); | 112 size_t length = children.size(); |
| 113 for (size_t i = 0; i < length; ++i) | 113 for (size_t i = 0; i < length; ++i) |
| 114 addTableCellChild(children[i].get(), appendedRows, columnCount); | 114 addTableCellChild(children[i].get(), appendedRows, columnCount); |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 // make the columns based on the number of columns in the first body | 118 // make the columns based on the number of columns in the first body |
| 119 for (unsigned i = 0; i < columnCount; ++i) { | 119 for (unsigned i = 0; i < columnCount; ++i) { |
| 120 AccessibilityTableColumn* column = static_cast<AccessibilityTableColumn*
>(axCache->getOrCreate(ColumnRole)); | 120 AccessibilityTableColumn* column = toAccessibilityTableColumn(axCache->g
etOrCreate(ColumnRole)); |
| 121 column->setColumnIndex((int)i); | 121 column->setColumnIndex((int)i); |
| 122 column->setParent(this); | 122 column->setParent(this); |
| 123 m_columns.append(column); | 123 m_columns.append(column); |
| 124 if (!column->accessibilityIsIgnored()) | 124 if (!column->accessibilityIsIgnored()) |
| 125 m_children.append(column); | 125 m_children.append(column); |
| 126 } | 126 } |
| 127 | 127 |
| 128 AccessibilityObject* headerContainerObject = headerContainer(); | 128 AccessibilityObject* headerContainerObject = headerContainer(); |
| 129 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored(
)) | 129 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored(
)) |
| 130 m_children.append(headerContainerObject); | 130 m_children.append(headerContainerObject); |
| 131 } | 131 } |
| 132 | 132 |
| 133 } // namespace WebCore | 133 } // namespace WebCore |
| OLD | NEW |