Changeset 188769 in webkit
- Timestamp:
- Aug 21, 2015 12:55:53 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r188768 r188769 1 2015-08-21 Doug Russell <d_russell@apple.com> 2 3 AX: Table with CSS that makes a row anonymous can return NULL from cellForColumnAndRow 4 https://bugs.webkit.org/show_bug.cgi?id=148293 5 6 Reviewed by Chris Fleizach. 7 8 When RenderTableRows are anonymous, they may not be added to the accessible data 9 table's internal row list. However, when calculating the row range for a cell, 10 we were still accounting for those anonymous sections. 11 Change how the row range is calculated to directly ask the accessible parent row 12 for its index. This will ensure it’s more inline with what’s being represented to 13 the accessibility API. 14 15 * accessibility/aria-table-content-expected.txt: Added. 16 * accessibility/aria-table-content.html: Added. 17 1 18 2015-08-21 Joseph Pecoraro <pecoraro@apple.com> 2 19 -
trunk/Source/WebCore/ChangeLog
r188768 r188769 1 2015-08-21 Doug Russell <d_russell@apple.com> 2 3 AX: Table with CSS that makes a row anonymous can return NULL from cellForColumnAndRow 4 https://bugs.webkit.org/show_bug.cgi?id=148293 5 6 Reviewed by Chris Fleizach. 7 8 When RenderTableRows are anonymous, they may not be added to the accessible data 9 table's internal row list. However, when calculating the row range for a cell, 10 we were still accounting for those anonymous sections. 11 Change how the row range is calculated to directly ask the accessible parent row 12 for its index. This will ensure it’s more inline with what’s being represented to 13 the accessibility API. 14 15 Test: accessibility/aria-table-content.html 16 17 * accessibility/AccessibilityTableCell.cpp: 18 (WebCore::AccessibilityTableCell::parentRow): 19 (WebCore::AccessibilityTableCell::rowIndexRange): 20 * accessibility/AccessibilityTableCell.h: 21 1 22 2015-08-21 Joseph Pecoraro <pecoraro@apple.com> 2 23 -
trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp
r188203 r188769 303 303 } 304 304 } 305 305 306 AccessibilityTableRow* AccessibilityTableCell::parentRow() const 307 { 308 AccessibilityObject* parent = parentObjectUnignored(); 309 if (!is<AccessibilityTableRow>(*parent)) 310 return nullptr; 311 return downcast<AccessibilityTableRow>(parent); 312 } 313 306 314 void AccessibilityTableCell::rowIndexRange(std::pair<unsigned, unsigned>& rowRange) const 307 315 { … … 310 318 311 319 RenderTableCell& renderCell = downcast<RenderTableCell>(*m_renderer); 312 rowRange.first = renderCell.rowIndex();313 320 rowRange.second = renderCell.rowSpan(); 314 321 315 // since our table might have multiple sections, we have to offset our row appropriately 316 RenderTableSection* section = renderCell.section(); 317 RenderTable* table = renderCell.table(); 318 if (!table || !section) 319 return; 320 321 RenderTableSection* footerSection = table->footer(); 322 unsigned rowOffset = 0; 323 for (RenderTableSection* tableSection = table->topSection(); tableSection; tableSection = table->sectionBelow(tableSection, SkipEmptySections)) { 324 // Don't add row offsets for bottom sections that are placed in before the body section. 325 if (tableSection == footerSection) 326 continue; 327 if (tableSection == section) { 328 // If the table section is anonymous, we should to use the parent row's API to get the rowIndex 329 if (tableSection->isAnonymous()) { 330 AccessibilityObject* parent = parentObjectUnignored(); 331 if (is<AccessibilityTableRow>(*parent)) 332 rowOffset = downcast<AccessibilityTableRow>(*parent).rowIndex(); 333 } 334 break; 335 } 336 rowOffset += tableSection->numRows(); 337 } 338 339 rowRange.first += rowOffset; 322 if (AccessibilityTableRow* parentRow = this->parentRow()) 323 rowRange.first = parentRow->rowIndex(); 340 324 } 341 325 -
trunk/Source/WebCore/accessibility/AccessibilityTableCell.h
r177733 r188769 35 35 36 36 class AccessibilityTable; 37 37 class AccessibilityTableRow; 38 38 39 class AccessibilityTableCell : public AccessibilityRenderObject { 39 40 public: … … 57 58 explicit AccessibilityTableCell(RenderObject*); 58 59 60 AccessibilityTableRow* parentRow() const; 59 61 virtual AccessibilityTable* parentTable() const; 60 62 virtual AccessibilityRole determineAccessibilityRole() override final;
Note: See TracChangeset
for help on using the changeset viewer.