Changeset 284687 in webkit
- Timestamp:
- Oct 22, 2021, 9:23:23 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 14 edited
-
ChangeLog (modified) (1 diff)
-
accessibility/AccessibilityARIAGrid.cpp (modified) (2 diffs)
-
accessibility/AccessibilityListBox.cpp (modified) (1 diff)
-
accessibility/AccessibilityMenuList.cpp (modified) (1 diff)
-
accessibility/AccessibilityMenuListPopup.cpp (modified) (1 diff)
-
accessibility/AccessibilityObject.cpp (modified) (2 diffs)
-
accessibility/AccessibilityRenderObject.cpp (modified) (3 diffs)
-
accessibility/AccessibilityScrollView.cpp (modified) (1 diff)
-
accessibility/AccessibilitySlider.cpp (modified) (1 diff)
-
accessibility/AccessibilitySpinButton.cpp (modified) (1 diff)
-
accessibility/AccessibilityTable.cpp (modified) (3 diffs)
-
accessibility/AccessibilityTableColumn.cpp (modified) (1 diff)
-
accessibility/AccessibilityTableHeaderContainer.cpp (modified) (1 diff)
-
accessibility/AccessibilityTableRow.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r284685 r284687 1 2021-10-22 Ayumi Kojima <ayumi_kojima@apple.com> 2 3 Unreviewed, reverting r284606. 4 5 Reverting because this commit caused accessibility/ios- 6 simulator/accessibility-aria-table-children.html to fail 7 8 Reverted changeset: 9 10 "AX: Any addition of children should funnel through 11 AccessibilityObject::addChild" 12 https://bugs.webkit.org/show_bug.cgi?id=231914 13 https://commits.webkit.org/r284606 14 1 15 2021-10-22 Ayumi Kojima <ayumi_kojima@apple.com> 2 16 -
trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp
r284606 r284687 68 68 row.setRowIndex((int)m_rows.size()); 69 69 m_rows.append(&row); 70 addChild(&row); 70 71 // Try adding the row if it's not ignoring accessibility, 72 // otherwise add its children (the cells) as the grid's children. 73 if (!row.accessibilityIsIgnored()) 74 m_children.append(&row); 75 else 76 m_children.appendVector(row.children()); 77 71 78 appendedRows.add(&row); 72 79 return true; … … 136 143 column.setParent(this); 137 144 m_columns.append(&column); 138 addChild(&column); 145 if (!column.accessibilityIsIgnored()) 146 m_children.append(&column); 139 147 } 140 148 141 addChild(headerContainer()); 149 auto* headerContainerObject = headerContainer(); 150 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored()) 151 m_children.append(headerContainerObject); 142 152 } 143 153 -
trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp
r284606 r284687 74 74 m_haveChildren = true; 75 75 76 for (const auto& listItem : downcast<HTMLSelectElement>(*selectNode).listItems()) 77 addChild(listBoxOptionAccessibilityObject(listItem)); 76 for (const auto& listItem : downcast<HTMLSelectElement>(*selectNode).listItems()) { 77 AccessibilityObject* listOption = listBoxOptionAccessibilityObject(listItem); 78 if (listOption && !listOption->accessibilityIsIgnored()) 79 m_children.append(listOption); 80 } 78 81 } 79 82 -
trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp
r284606 r284687 83 83 84 84 m_haveChildren = true; 85 addChild(list); 85 m_children.append(list); 86 86 87 list->addChildren(); 87 88 } -
trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp
r284606 r284687 97 97 m_haveChildren = true; 98 98 99 for (const auto& listItem : downcast<HTMLSelectElement>(*selectNode).listItems()) 100 addChild(menuListOptionAccessibilityObject(listItem)); 99 for (const auto& listItem : downcast<HTMLSelectElement>(*selectNode).listItems()) { 100 // FIXME: Why does AccessibilityListBox::addChildren check accessibilityIsIgnored but this does not? 101 if (auto option = menuListOptionAccessibilityObject(listItem)) 102 m_children.append(option); 103 } 101 104 } 102 105 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r284675 r284687 484 484 results.append(object); 485 485 } 486 487 #ifndef NDEBUG 488 static bool isTableComponent(AXCoreObject& axObject) 489 { 490 return axObject.isTable() || axObject.isTableColumn() || axObject.isTableRow() || axObject.isTableCell(); 491 } 492 #endif 493 486 494 487 void AccessibilityObject::insertChild(AXCoreObject* child, unsigned index) 495 488 { … … 524 517 m_children.insert(index + i, children[i]); 525 518 } else { 526 // Table component child-parent relationships often don't line up properly, hence the need for methods 527 // like parentTable() and parentRow(). Exclude them from this ASSERT. 528 ASSERT((!isTableComponent(*child) && !isTableComponent(*this)) ? child->parentObject() == this : true); 519 ASSERT(child->parentObject() == this); 529 520 m_children.insert(index, child); 530 521 } -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r284675 r284687 3284 3284 areaObject.setParent(this); 3285 3285 if (!areaObject.accessibilityIsIgnored()) 3286 addChild(&areaObject);3286 m_children.append(&areaObject); 3287 3287 else 3288 3288 axObjectCache()->remove(areaObject.objectID()); … … 3311 3311 axSpinButton.setSpinButtonElement(downcast<SpinButtonElement>(spinButtonElement)); 3312 3312 axSpinButton.setParent(this); 3313 addChild(&axSpinButton);3313 m_children.append(&axSpinButton); 3314 3314 } 3315 3315 … … 3375 3375 // the parent must be set, because there's no other way to get back to who created the image. 3376 3376 root->setParent(this); 3377 addChild(root); 3377 3378 if (root->accessibilityIsIgnored()) { 3379 for (const auto& child : root->children()) 3380 m_children.append(child); 3381 } else 3382 m_children.append(root); 3378 3383 } 3379 3384 -
trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp
r284606 r284687 164 164 auto& scrollBarObject = downcast<AccessibilityScrollbar>(*cache->getOrCreate(scrollbar)); 165 165 scrollBarObject.setParent(this); 166 addChild(&scrollBarObject);166 m_children.append(&scrollBarObject); 167 167 return &scrollBarObject; 168 168 } -
trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp
r284606 r284687 101 101 cache->remove(thumb.objectID()); 102 102 else 103 addChild(&thumb);103 m_children.append(&thumb); 104 104 } 105 105 -
trunk/Source/WebCore/accessibility/AccessibilitySpinButton.cpp
r284606 r284687 92 92 incrementor.setIsIncrementor(true); 93 93 incrementor.setParent(this); 94 addChild(&incrementor);94 m_children.append(&incrementor); 95 95 96 96 auto& decrementor = downcast<AccessibilitySpinButtonPart>(*cache->create(AccessibilityRole::SpinButtonPart)); 97 97 decrementor.setIsIncrementor(false); 98 98 decrementor.setParent(this); 99 addChild(&decrementor);99 m_children.append(&decrementor); 100 100 } 101 101 -
trunk/Source/WebCore/accessibility/AccessibilityTable.cpp
r284606 r284687 395 395 if (auto caption = tableElement->caption()) { 396 396 AccessibilityObject* axCaption = axObjectCache()->getOrCreate(caption.get()); 397 // While `addChild` won't insert ignored children, we still need this accessibilityIsIgnored398 // check so that `addChild` doesn't try to add the caption's children in its stead. Basically,399 // explicitly checking accessibilityIsIgnored() ignores the caption and any of its children.400 397 if (axCaption && !axCaption->accessibilityIsIgnored()) 401 addChild(axCaption);398 m_children.append(axCaption); 402 399 } 403 400 } … … 424 421 column.setParent(this); 425 422 m_columns.append(&column); 426 addChild(&column); 427 } 428 addChild(headerContainer()); 423 if (!column.accessibilityIsIgnored()) 424 m_children.append(&column); 425 } 426 427 auto* headerContainerObject = headerContainer(); 428 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored()) 429 m_children.append(headerContainerObject); 429 430 430 431 // Sometimes the cell gets the wrong role initially because it is created before the parent … … 451 452 row.setRowIndex(static_cast<int>(m_rows.size())); 452 453 m_rows.append(&row); 453 addChild(&row); 454 if (!row.accessibilityIsIgnored()) 455 m_children.append(&row); 454 456 appendedRows.add(&row); 455 457 -
trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp
r284606 r284687 203 203 continue; 204 204 205 addChild(cell);205 m_children.append(cell); 206 206 } 207 207 } -
trunk/Source/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
r284606 r284687 74 74 return; 75 75 76 for (auto& columnHeader : parentTable.columnHeaders()) 77 addChild(columnHeader.get()); 76 m_children = parentTable.columnHeaders(); 78 77 79 78 for (const auto& child : m_children) -
trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp
r284606 r284687 110 110 return nullptr; 111 111 } 112 112 113 113 AXCoreObject* AccessibilityTableRow::headerObject() 114 114 { … … 151 151 { 152 152 // If the element specifies its cells through aria-owns, return that first. 153 AccessibilityChildrenVector ariaOwnedElements; 154 ariaOwnsElements(ariaOwnedElements); 155 if (ariaOwnedElements.size()) { 156 for (auto& ariaOwnedElement : ariaOwnedElements) 157 addChild(ariaOwnedElement.get()); 158 } 153 AccessibilityChildrenVector ariaOwns; 154 ariaOwnsElements(ariaOwns); 155 if (ariaOwns.size()) 156 m_children = WTFMove(ariaOwns); 159 157 else 160 158 AccessibilityRenderObject::addChildren();
Note:
See TracChangeset
for help on using the changeset viewer.