Changeset 261729 in webkit
- Timestamp:
- May 14, 2020 7:28:43 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r261726 r261729 1 2020-05-14 Andres Gonzalez <andresg_22@apple.com> 2 3 Expose isColumnHeaderCell and isRowHeaderCell through AXCoreObject. 4 https://bugs.webkit.org/show_bug.cgi?id=211919 5 6 Reviewed by Chris Fleizach. 7 8 Multiple tests including accessibility/crash-table-recursive-layout.html. 9 10 - Expose isColumn/RowHeaderCell through AXCoreObject in order to make the 11 return value of AccessibilityTable::cellForColumnAndRow an AXCoreObject. 12 - Implemented these methods for AXIsolatedObject. 13 - isolatedCopy the accessibilityDescription property. 14 15 * accessibility/AccessibilityObject.h: 16 * accessibility/AccessibilityObjectInterface.h: 17 * accessibility/AccessibilityTable.cpp: 18 (WebCore::AccessibilityTable::cellForColumnAndRow): Removed incorrect 19 assert since children are AXCoreObjects and not necessarily AccessibilityTableCells. 20 * accessibility/AccessibilityTable.h: 21 * accessibility/AccessibilityTableCell.cpp: 22 (WebCore::AccessibilityTableCell::isTableCellInSameRowGroup): 23 (WebCore::AccessibilityTableCell::isTableCellInSameColGroup): 24 (WebCore::AccessibilityTableCell::columnHeaders): 25 (WebCore::AccessibilityTableCell::rowHeaders): 26 * accessibility/AccessibilityTableCell.h: 27 * accessibility/AccessibilityTableColumn.cpp: 28 (WebCore::AccessibilityTableColumn::addChildren): 29 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: 30 (-[WebAccessibilityObjectWrapper accessibilityElementForRow:andColumn:]): 31 * accessibility/isolatedtree/AXIsolatedObject.cpp: 32 (WebCore::AXIsolatedObject::initializeAttributeData): 33 * accessibility/isolatedtree/AXIsolatedObject.h: 34 1 35 2020-05-14 Timothy Hatcher <timothy@apple.com> 2 36 -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r261705 r261729 161 161 // Returns the start location and column span of the cell. 162 162 std::pair<unsigned, unsigned> columnIndexRange() const override { return { 0, 1 }; } 163 bool isColumnHeaderCell() const override { return false; } 164 bool isRowHeaderCell() const override { return false; } 163 165 int axColumnIndex() const override { return -1; } 164 166 int axRowIndex() const override { return -1; } -
trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h
r261705 r261729 564 564 // Returns the start location and column span of the cell. 565 565 virtual std::pair<unsigned, unsigned> columnIndexRange() const = 0; 566 virtual bool isColumnHeaderCell() const = 0; 567 virtual bool isRowHeaderCell() const = 0; 566 568 virtual int axColumnIndex() const = 0; 567 569 virtual int axRowIndex() const = 0; -
trunk/Source/WebCore/accessibility/AccessibilityTable.cpp
r257548 r261729 620 620 } 621 621 622 A ccessibilityTableCell* AccessibilityTable::cellForColumnAndRow(unsigned column, unsigned row)622 AXCoreObject* AccessibilityTable::cellForColumnAndRow(unsigned column, unsigned row) 623 623 { 624 624 updateChildrenIfNecessary(); … … 635 635 unsigned colIndex = colIndexCounter - 1; 636 636 AXCoreObject* child = children[colIndex].get(); 637 ASSERT(is<AccessibilityTableCell>(*child)); 638 if (!is<AccessibilityTableCell>(*child)) 637 if (!child) 639 638 continue; 640 639 … … 644 643 if ((column >= columnRange.first && column < (columnRange.first + columnRange.second)) 645 644 && (row >= rowRange.first && row < (rowRange.first + rowRange.second))) 646 return downcast<AccessibilityTableCell>(child);645 return child; 647 646 } 648 647 } -
trunk/Source/WebCore/accessibility/AccessibilityTable.h
r257200 r261729 62 62 // all the cells in the table 63 63 AccessibilityChildrenVector cells() override; 64 A ccessibilityTableCell* cellForColumnAndRow(unsigned column, unsigned row) override;64 AXCoreObject* cellForColumnAndRow(unsigned column, unsigned row) override; 65 65 66 66 AccessibilityChildrenVector columnHeaders() override; -
trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp
r257548 r261729 201 201 } 202 202 203 bool AccessibilityTableCell::isTableCellInSameRowGroup(A ccessibilityTableCell* otherTableCell)203 bool AccessibilityTableCell::isTableCellInSameRowGroup(AXCoreObject* otherTableCell) 204 204 { 205 205 Node* parentNode = node(); … … 218 218 } 219 219 220 221 bool AccessibilityTableCell::isTableCellInSameColGroup(AccessibilityTableCell* tableCell) 220 bool AccessibilityTableCell::isTableCellInSameColGroup(AXCoreObject* tableCell) 222 221 { 223 222 auto colRange = columnIndexRange(); … … 256 255 257 256 for (unsigned row = 0; row < rowRange.first; row++) { 258 AccessibilityTableCell* tableCell = parent->cellForColumnAndRow(colRange.first, row);257 auto* tableCell = parent->cellForColumnAndRow(colRange.first, row); 259 258 if (!tableCell || tableCell == this || headers.contains(tableCell)) 260 259 continue; … … 281 280 282 281 for (unsigned column = 0; column < colRange.first; column++) { 283 AccessibilityTableCell* tableCell = parent->cellForColumnAndRow(column, rowRange.first);282 auto* tableCell = parent->cellForColumnAndRow(column, rowRange.first); 284 283 if (!tableCell || tableCell == this || headers.contains(tableCell)) 285 284 continue; -
trunk/Source/WebCore/accessibility/AccessibilityTableCell.h
r257548 r261729 43 43 bool isTableCell() const final; 44 44 bool isTableHeaderCell() const; 45 bool isColumnHeaderCell() const ;46 bool isRowHeaderCell() const ;45 bool isColumnHeaderCell() const override; 46 bool isRowHeaderCell() const override; 47 47 48 48 // Returns the start location and row span of the cell. … … 78 78 bool supportsExpandedTextValue() const final; 79 79 80 bool isTableCellInSameRowGroup(A ccessibilityTableCell*);81 bool isTableCellInSameColGroup(A ccessibilityTableCell*);80 bool isTableCellInSameRowGroup(AXCoreObject*); 81 bool isTableCellInSameColGroup(AXCoreObject*); 82 82 }; 83 83 -
trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp
r257473 r261729 195 195 196 196 for (int i = 0; i < numRows; ++i) { 197 AccessibilityTableCell* cell = parentTable.cellForColumnAndRow(m_columnIndex, i);197 auto* cell = parentTable.cellForColumnAndRow(m_columnIndex, i); 198 198 if (!cell) 199 199 continue; -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTable.cpp
r257548 r261729 55 55 } 56 56 57 static AccessibilityTableCell* cell(AtkTable* table, guint row, guint column) 58 { 59 AccessibilityObject* accTable = core(table); 60 if (is<AccessibilityTable>(*accTable)) 61 return downcast<AccessibilityTable>(*accTable).cellForColumnAndRow(column, row); 62 return nullptr; 63 } 64 65 static gint cellIndex(AccessibilityTableCell* axCell, AccessibilityTable* axTable) 57 static AXCoreObject* cell(AtkTable* table, guint row, guint column) 58 { 59 auto* accTable = core(table); 60 return accTable ? accTable->cellForColumnAndRow(column, row) : nullptr; 61 } 62 63 static gint cellIndex(AXCoreObject* axCell, AccessibilityTable* axTable) 66 64 { 67 65 // Calculate the cell's index as if we had a traditional Gtk+ table in 68 66 // which cells are all direct children of the table, arranged row-first. 69 67 auto allCells = axTable->cells(); 70 A ccessibilityObject::AccessibilityChildrenVector::iterator position;68 AXCoreObject::AccessibilityChildrenVector::iterator position; 71 69 position = std::find(allCells.begin(), allCells.end(), axCell); 72 70 if (position == allCells.end()) … … 91 89 returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(table), 0); 92 90 93 AccessibilityTableCell* axCell = cell(table, row, column);91 auto* axCell = cell(table, row, column); 94 92 if (!axCell) 95 93 return 0; … … 109 107 returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(table), -1); 110 108 111 AccessibilityTableCell* axCell = cell(table, row, column);109 auto* axCell = cell(table, row, column); 112 110 AccessibilityTable* axTable = downcast<AccessibilityTable>(core(table)); 113 111 return cellIndex(axCell, axTable); … … 175 173 returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(table), 0); 176 174 177 AccessibilityTableCell* axCell = cell(table, row, column);175 auto* axCell = cell(table, row, column); 178 176 if (axCell) { 179 177 auto columnRange = axCell->columnIndexRange(); … … 188 186 returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(table), 0); 189 187 190 AccessibilityTableCell* axCell = cell(table, row, column);188 auto* axCell = cell(table, row, column); 191 189 if (axCell) { 192 190 auto rowRange = axCell->rowIndexRange(); -
trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
r260725 r261729 1268 1268 return nil; 1269 1269 1270 AccessibilityTableCell* cell = table->cellForColumnAndRow(column, row); 1271 if (!cell) 1272 return nil; 1273 return cell->wrapper(); 1270 auto* cell = table->cellForColumnAndRow(column, row); 1271 return cell ? cell->wrapper() : nil; 1274 1272 } 1275 1273 -
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
r261705 r261729 61 61 { 62 62 setProperty(AXPropertyName::ARIALandmarkRoleDescription, object.ariaLandmarkRoleDescription().isolatedCopy()); 63 setProperty(AXPropertyName::AccessibilityDescription, object.accessibilityDescription() );63 setProperty(AXPropertyName::AccessibilityDescription, object.accessibilityDescription().isolatedCopy()); 64 64 setProperty(AXPropertyName::BoundingBoxRect, object.boundingBoxRect()); 65 65 setProperty(AXPropertyName::Description, object.descriptionAttributeValue().isolatedCopy()); … … 251 251 setObjectVectorProperty(AXPropertyName::ColumnHeaders, object.columnHeaders()); 252 252 setObjectVectorProperty(AXPropertyName::RowHeaders, object.rowHeaders()); 253 setProperty(AXPropertyName::IsColumnHeaderCell, object.isColumnHeaderCell()); 254 setProperty(AXPropertyName::IsRowHeaderCell, object.isRowHeaderCell()); 253 255 setProperty(AXPropertyName::AXColumnIndex, object.axColumnIndex()); 254 256 setProperty(AXPropertyName::AXRowIndex, object.axRowIndex()); -
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h
r261705 r261729 175 175 IsChecked, 176 176 IsCollapsed, 177 IsColumnHeaderCell, 177 178 IsControl, 178 179 IsDataTable, … … 239 240 IsRangeControl, 240 241 IsRequired, 242 IsRowHeaderCell, 241 243 IsScrollbar, 242 244 IsSearchField, … … 427 429 // Returns the start location and column span of the cell. 428 430 std::pair<unsigned, unsigned> columnIndexRange() const override { return pairAttributeValue<unsigned>(AXPropertyName::ColumnIndexRange); } 431 bool isColumnHeaderCell() const override { return boolAttributeValue(AXPropertyName::IsColumnHeaderCell); } 432 bool isRowHeaderCell() const override { return boolAttributeValue(AXPropertyName::IsRowHeaderCell); } 429 433 int axColumnIndex() const override { return intAttributeValue(AXPropertyName::AXColumnIndex); } 430 434 int axRowIndex() const override { return intAttributeValue(AXPropertyName::AXRowIndex); }
Note: See TracChangeset
for help on using the changeset viewer.