<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[284606] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/284606">284606</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2021-10-21 09:27:29 -0700 (Thu, 21 Oct 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: Any addition of children should funnel through AccessibilityObject::addChild
https://bugs.webkit.org/show_bug.cgi?id=231914

Patch by Tyler Wilcock <tyler_w@apple.com> on 2021-10-21
Reviewed by Chris Fleizach.

All addition of children now goes through
AccessibilityObject::addChild. This is good for two reasons:

1. It ensures we aren't inserting ignored elements into the tree.
`insertChild` (downstream of `addChild`) checks this. Prior to this
patch, there were cases where we could insert ignored children into the
tree because no check was made.

2. We can reliably set state on the child based on the state of the
parent at insertion time. For example, children can set a flag if
any of their ancestors have an application or document role, which can
be useful for some AX clients.

* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::addTableCellChild):
(WebCore::AccessibilityARIAGrid::addChildren):
* accessibility/AccessibilityListBox.cpp:
(WebCore::AccessibilityListBox::addChildren):
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::addChildren):
* accessibility/AccessibilityMenuListPopup.cpp:
(WebCore::AccessibilityMenuListPopup::addChildren):
* accessibility/AccessibilityObject.cpp:
(WebCore::isAutofillButton):
(WebCore::isTableComponent):
(WebCore::AccessibilityObject::insertChild):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::addImageMapChildren):
(WebCore::AccessibilityRenderObject::addTextFieldChildren):
(WebCore::AccessibilityRenderObject::addRemoteSVGChildren):
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::addChildScrollbar):
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::addChildren):
* accessibility/AccessibilitySpinButton.cpp:
(WebCore::AccessibilitySpinButton::addChildren):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::addChildren):
(WebCore::AccessibilityTable::addTableCellChild):
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::addChildren):
* accessibility/AccessibilityTableHeaderContainer.cpp:
(WebCore::AccessibilityTableHeaderContainer::addChildren):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::addChildren):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityARIAGridcpp">trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityListBoxcpp">trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityMenuListcpp">trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityMenuListPopupcpp">trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityScrollViewcpp">trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilitySlidercpp">trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilitySpinButtoncpp">trunk/Source/WebCore/accessibility/AccessibilitySpinButton.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTablecpp">trunk/Source/WebCore/accessibility/AccessibilityTable.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableColumncpp">trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableHeaderContainercpp">trunk/Source/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableRowcpp">trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/ChangeLog      2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -1,3 +1,56 @@
</span><ins>+2021-10-21  Tyler Wilcock  <tyler_w@apple.com>
+
+        AX: Any addition of children should funnel through AccessibilityObject::addChild
+        https://bugs.webkit.org/show_bug.cgi?id=231914
+
+        Reviewed by Chris Fleizach.
+
+        All addition of children now goes through
+        AccessibilityObject::addChild. This is good for two reasons:
+
+        1. It ensures we aren't inserting ignored elements into the tree.
+        `insertChild` (downstream of `addChild`) checks this. Prior to this
+        patch, there were cases where we could insert ignored children into the
+        tree because no check was made.
+
+        2. We can reliably set state on the child based on the state of the
+        parent at insertion time. For example, children can set a flag if
+        any of their ancestors have an application or document role, which can
+        be useful for some AX clients.
+
+        * accessibility/AccessibilityARIAGrid.cpp:
+        (WebCore::AccessibilityARIAGrid::addTableCellChild):
+        (WebCore::AccessibilityARIAGrid::addChildren):
+        * accessibility/AccessibilityListBox.cpp:
+        (WebCore::AccessibilityListBox::addChildren):
+        * accessibility/AccessibilityMenuList.cpp:
+        (WebCore::AccessibilityMenuList::addChildren):
+        * accessibility/AccessibilityMenuListPopup.cpp:
+        (WebCore::AccessibilityMenuListPopup::addChildren):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::isAutofillButton):
+        (WebCore::isTableComponent):
+        (WebCore::AccessibilityObject::insertChild):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::addImageMapChildren):
+        (WebCore::AccessibilityRenderObject::addTextFieldChildren):
+        (WebCore::AccessibilityRenderObject::addRemoteSVGChildren):
+        * accessibility/AccessibilityScrollView.cpp:
+        (WebCore::AccessibilityScrollView::addChildScrollbar):
+        * accessibility/AccessibilitySlider.cpp:
+        (WebCore::AccessibilitySlider::addChildren):
+        * accessibility/AccessibilitySpinButton.cpp:
+        (WebCore::AccessibilitySpinButton::addChildren):
+        * accessibility/AccessibilityTable.cpp:
+        (WebCore::AccessibilityTable::addChildren):
+        (WebCore::AccessibilityTable::addTableCellChild):
+        * accessibility/AccessibilityTableColumn.cpp:
+        (WebCore::AccessibilityTableColumn::addChildren):
+        * accessibility/AccessibilityTableHeaderContainer.cpp:
+        (WebCore::AccessibilityTableHeaderContainer::addChildren):
+        * accessibility/AccessibilityTableRow.cpp:
+        (WebCore::AccessibilityTableRow::addChildren):
+
</ins><span class="cx"> 2021-10-21  Antti Koivisto  <antti@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Move Style::Resolver::State out of header
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityARIAGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp     2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp        2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -67,14 +67,7 @@
</span><span class="cx">     
</span><span class="cx">     row.setRowIndex((int)m_rows.size());
</span><span class="cx">     m_rows.append(&row);
</span><del>-
-    // Try adding the row if it's not ignoring accessibility,
-    // otherwise add its children (the cells) as the grid's children.
-    if (!row.accessibilityIsIgnored())
-        m_children.append(&row);
-    else
-        m_children.appendVector(row.children());
-
</del><ins>+    addChild(&row);
</ins><span class="cx">     appendedRows.add(&row);
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -142,13 +135,10 @@
</span><span class="cx">         column.setColumnIndex(i);
</span><span class="cx">         column.setParent(this);
</span><span class="cx">         m_columns.append(&column);
</span><del>-        if (!column.accessibilityIsIgnored())
-            m_children.append(&column);
</del><ins>+        addChild(&column);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto* headerContainerObject = headerContainer();
-    if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored())
-        m_children.append(headerContainerObject);
</del><ins>+    addChild(headerContainer());
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityListBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp      2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp 2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -73,11 +73,8 @@
</span><span class="cx"> 
</span><span class="cx">     m_haveChildren = true;
</span><span class="cx"> 
</span><del>-    for (const auto& listItem : downcast<HTMLSelectElement>(*selectNode).listItems()) {
-        AccessibilityObject* listOption = listBoxOptionAccessibilityObject(listItem);
-        if (listOption && !listOption->accessibilityIsIgnored())
-            m_children.append(listOption);
-    }
</del><ins>+    for (const auto& listItem : downcast<HTMLSelectElement>(*selectNode).listItems())
+        addChild(listBoxOptionAccessibilityObject(listItem));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityListBox::setSelectedChildren(const AccessibilityChildrenVector& children)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityMenuListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp     2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp        2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -82,8 +82,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_haveChildren = true;
</span><del>-    m_children.append(list);
-
</del><ins>+    addChild(list);
</ins><span class="cx">     list->addChildren();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityMenuListPopupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp        2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp   2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -96,11 +96,8 @@
</span><span class="cx"> 
</span><span class="cx">     m_haveChildren = true;
</span><span class="cx"> 
</span><del>-    for (const auto& listItem : downcast<HTMLSelectElement>(*selectNode).listItems()) {
-        // FIXME: Why does AccessibilityListBox::addChildren check accessibilityIsIgnored but this does not?
-        if (auto option = menuListOptionAccessibilityObject(listItem))
-            m_children.append(option);
-    }
</del><ins>+    for (const auto& listItem : downcast<HTMLSelectElement>(*selectNode).listItems())
+        addChild(menuListOptionAccessibilityObject(listItem));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityMenuListPopup::childrenChanged()
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp       2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp  2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -483,7 +483,14 @@
</span><span class="cx">     if (object)
</span><span class="cx">         results.append(object);
</span><span class="cx"> }
</span><del>-    
</del><ins>+
+#ifndef NDEBUG
+static bool isTableComponent(AXCoreObject& axObject)
+{
+    return axObject.isTable() || axObject.isTableColumn() || axObject.isTableRow() || axObject.isTableCell();
+}
+#endif
+
</ins><span class="cx"> void AccessibilityObject::insertChild(AXCoreObject* child, unsigned index)
</span><span class="cx"> {
</span><span class="cx">     if (!child)
</span><span class="lines">@@ -516,7 +523,9 @@
</span><span class="cx">         for (size_t i = 0; i < length; ++i)
</span><span class="cx">             m_children.insert(index + i, children[i]);
</span><span class="cx">     } else {
</span><del>-        ASSERT(child->parentObject() == this);
</del><ins>+        // Table component child-parent relationships often don't line up properly, hence the need for methods
+        // like parentTable() and parentRow(). Exclude them from this ASSERT.
+        ASSERT((!isTableComponent(*child) && !isTableComponent(*this)) ? child->parentObject() == this : true);
</ins><span class="cx">         m_children.insert(index, child);
</span><span class="cx">     }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp    2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -3283,7 +3283,7 @@
</span><span class="cx">         areaObject.setHTMLMapElement(map);
</span><span class="cx">         areaObject.setParent(this);
</span><span class="cx">         if (!areaObject.accessibilityIsIgnored())
</span><del>-            m_children.append(&areaObject);
</del><ins>+            addChild(&areaObject);
</ins><span class="cx">         else
</span><span class="cx">             axObjectCache()->remove(areaObject.objectID());
</span><span class="cx">     }
</span><span class="lines">@@ -3316,7 +3316,7 @@
</span><span class="cx">     auto& axSpinButton = downcast<AccessibilitySpinButton>(*axObjectCache()->create(AccessibilityRole::SpinButton));
</span><span class="cx">     axSpinButton.setSpinButtonElement(downcast<SpinButtonElement>(spinButtonElement));
</span><span class="cx">     axSpinButton.setParent(this);
</span><del>-    m_children.append(&axSpinButton);
</del><ins>+    addChild(&axSpinButton);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> bool AccessibilityRenderObject::isSVGImage() const
</span><span class="lines">@@ -3380,12 +3380,7 @@
</span><span class="cx">     // In order to connect the AX hierarchy from the SVG root element from the loaded resource
</span><span class="cx">     // the parent must be set, because there's no other way to get back to who created the image.
</span><span class="cx">     root->setParent(this);
</span><del>-    
-    if (root->accessibilityIsIgnored()) {
-        for (const auto& child : root->children())
-            m_children.append(child);
-    } else
-        m_children.append(root);
</del><ins>+    addChild(root);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityRenderObject::addCanvasChildren()
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityScrollViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp   2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp      2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto& scrollBarObject = downcast<AccessibilityScrollbar>(*cache->getOrCreate(scrollbar));
</span><span class="cx">     scrollBarObject.setParent(this);
</span><del>-    m_children.append(&scrollBarObject);
</del><ins>+    addChild(&scrollBarObject);
</ins><span class="cx">     return &scrollBarObject;
</span><span class="cx"> }
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilitySlidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp       2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp  2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx">     if (thumb.accessibilityIsIgnored())
</span><span class="cx">         cache->remove(thumb.objectID());
</span><span class="cx">     else
</span><del>-        m_children.append(&thumb);
</del><ins>+        addChild(&thumb);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const AtomString& AccessibilitySlider::getAttribute(const QualifiedName& attribute) const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilitySpinButtoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilitySpinButton.cpp (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilitySpinButton.cpp   2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/accessibility/AccessibilitySpinButton.cpp      2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -91,12 +91,12 @@
</span><span class="cx">     auto& incrementor = downcast<AccessibilitySpinButtonPart>(*cache->create(AccessibilityRole::SpinButtonPart));
</span><span class="cx">     incrementor.setIsIncrementor(true);
</span><span class="cx">     incrementor.setParent(this);
</span><del>-    m_children.append(&incrementor);
</del><ins>+    addChild(&incrementor);
</ins><span class="cx"> 
</span><span class="cx">     auto& decrementor = downcast<AccessibilitySpinButtonPart>(*cache->create(AccessibilityRole::SpinButtonPart));
</span><span class="cx">     decrementor.setIsIncrementor(false);
</span><span class="cx">     decrementor.setParent(this);
</span><del>-    m_children.append(&decrementor);
</del><ins>+    addChild(&decrementor);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void AccessibilitySpinButton::step(int amount)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTable.cpp (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTable.cpp        2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/accessibility/AccessibilityTable.cpp   2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -394,8 +394,11 @@
</span><span class="cx">     if (HTMLTableElement* tableElement = this->tableElement()) {
</span><span class="cx">         if (auto caption = tableElement->caption()) {
</span><span class="cx">             AccessibilityObject* axCaption = axObjectCache()->getOrCreate(caption.get());
</span><ins>+            // While `addChild` won't insert ignored children, we still need this accessibilityIsIgnored
+            // check so that `addChild` doesn't try to add the caption's children in its stead. Basically,
+            // explicitly checking accessibilityIsIgnored() ignores the caption and any of its children.
</ins><span class="cx">             if (axCaption && !axCaption->accessibilityIsIgnored())
</span><del>-                m_children.append(axCaption);
</del><ins>+                addChild(axCaption);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -420,14 +423,10 @@
</span><span class="cx">         column.setColumnIndex(i);
</span><span class="cx">         column.setParent(this);
</span><span class="cx">         m_columns.append(&column);
</span><del>-        if (!column.accessibilityIsIgnored())
-            m_children.append(&column);
</del><ins>+        addChild(&column);
</ins><span class="cx">     }
</span><ins>+    addChild(headerContainer());
</ins><span class="cx"> 
</span><del>-    auto* headerContainerObject = headerContainer();
-    if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored())
-        m_children.append(headerContainerObject);
-
</del><span class="cx">     // Sometimes the cell gets the wrong role initially because it is created before the parent
</span><span class="cx">     // determines whether it is an accessibility table. Iterate all the cells and allow them to
</span><span class="cx">     // update their roles now that the table knows its status.
</span><span class="lines">@@ -451,8 +450,7 @@
</span><span class="cx">     
</span><span class="cx">     row.setRowIndex(static_cast<int>(m_rows.size()));
</span><span class="cx">     m_rows.append(&row);
</span><del>-    if (!row.accessibilityIsIgnored())
-        m_children.append(&row);
</del><ins>+    addChild(&row);
</ins><span class="cx">     appendedRows.add(&row);
</span><span class="cx">         
</span><span class="cx">     // store the maximum number of columns
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableColumncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp  2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp     2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -202,7 +202,7 @@
</span><span class="cx">         if (m_children.size() > 0 && m_children.last() == cell)
</span><span class="cx">             continue;
</span><span class="cx">             
</span><del>-        m_children.append(cell);
</del><ins>+        addChild(cell);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableHeaderContainercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp 2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp    2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -73,7 +73,8 @@
</span><span class="cx">     if (!parentTable.isExposable())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_children = parentTable.columnHeaders();
</del><ins>+    for (auto& columnHeader : parentTable.columnHeaders())
+        addChild(columnHeader.get());
</ins><span class="cx"> 
</span><span class="cx">     for (const auto& child : m_children)
</span><span class="cx">         m_headerRect.unite(child->elementRect());
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableRowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp (284605 => 284606)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp     2021-10-21 16:17:10 UTC (rev 284605)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp        2021-10-21 16:27:29 UTC (rev 284606)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx">     
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><del>-    
</del><ins>+
</ins><span class="cx"> AXCoreObject* AccessibilityTableRow::headerObject()
</span><span class="cx"> {
</span><span class="cx">     if (!m_renderer || !m_renderer->isTableRow())
</span><span class="lines">@@ -150,10 +150,12 @@
</span><span class="cx"> void AccessibilityTableRow::addChildren()
</span><span class="cx"> {
</span><span class="cx">     // If the element specifies its cells through aria-owns, return that first.
</span><del>-    AccessibilityChildrenVector ariaOwns;
-    ariaOwnsElements(ariaOwns);
-    if (ariaOwns.size())
-        m_children = WTFMove(ariaOwns);
</del><ins>+    AccessibilityChildrenVector ariaOwnedElements;
+    ariaOwnsElements(ariaOwnedElements);
+    if (ariaOwnedElements.size()) {
+        for (auto& ariaOwnedElement : ariaOwnedElements)
+            addChild(ariaOwnedElement.get());
+    }
</ins><span class="cx">     else
</span><span class="cx">         AccessibilityRenderObject::addChildren();
</span><span class="cx">     
</span></span></pre>
</div>
</div>

</body>
</html>