<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: Add support for ARIA 1.1 attribute 'aria-modal' for dialog and alertdialog"
   href="https://bugs.webkit.org/show_bug.cgi?id=138566#c12">Comment # 12</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: Add support for ARIA 1.1 attribute 'aria-modal' for dialog and alertdialog"
   href="https://bugs.webkit.org/show_bug.cgi?id=138566">bug 138566</a>
              from <span class="vcard"><a class="email" href="mailto:cfleizach&#64;apple.com" title="chris fleizach &lt;cfleizach&#64;apple.com&gt;"> <span class="fn">chris fleizach</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=264467&amp;action=diff" name="attach_264467" title="patch">attachment 264467</a> <a href="attachment.cgi?id=264467&amp;action=edit" title="patch">[details]</a></span>
patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=264467&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=264467&amp;action=review</a>

thanks!

<span class="quote">&gt; Source/WebCore/accessibility/AXObjectCache.cpp:145
&gt; +    , m_currentAriaModalNode(nullptr)</span >

we should remove the pointer to m_currentAriaModalNode in our method that detects when nodes disappear.
you can imagine if someone removed a tree that contains m_currentAriaModalNode, we could have a stale pointer

<span class="quote">&gt; Source/WebCore/accessibility/AXObjectCache.cpp:164
&gt; +    m_currentAriaModalNode = nullptr;</span >

this is set again to null in updateCurrentAriaModalNode() so it seems unnecessary here

<span class="quote">&gt; Source/WebCore/accessibility/AXObjectCache.cpp:217
&gt; +    if (!node || !is&lt;Element&gt;(node))</span >

!is&lt;Element&gt;(node) should take care of !node so i think we can drop that

<span class="quote">&gt; Source/WebCore/accessibility/AXObjectCache.cpp:1349
&gt; +    if (!node || !is&lt;Element&gt;(node))</span >

ditto about !node

<span class="quote">&gt; Source/WebCore/accessibility/AXObjectCache.cpp:1355
&gt; +    stopCachingComputedObjectAttributes();</span >

do you need to start caching again at the end of this method?

<span class="quote">&gt; Source/WebCore/accessibility/AXObjectCache.cpp:1360
&gt; +            m_ariaModalNodesSet.add(node);</span >

since m_ariaModalNodesSet is already a set i don't think you need to check contains() first

<span class="quote">&gt; Source/WebCore/accessibility/AXObjectCache.cpp:1364
&gt; +        if (m_ariaModalNodesSet.contains(node))</span >

ditto about contains()

<span class="quote">&gt; Source/WebCore/accessibility/AXObjectCache.h:306
&gt; +    ListHashSet&lt;RefPtr&lt;Node&gt;&gt; m_ariaModalNodesSet;</span >

do we want to RefPtr the nodes here? i don't think we retain other Nodes. We just have to be careful about cleaning up these things

you can imagine if the Document node got into this list we'd have a retain cycle

<span class="quote">&gt; Source/WebCore/accessibility/AccessibilityObject.cpp:1867
&gt; +bool AccessibilityObject::ignoredFromARIAModalPresence() const</span >

can you add a comment what this method does

<span class="quote">&gt; Source/WebCore/accessibility/AccessibilityObject.cpp:1870
&gt; +    if (!node() || !node()-&gt;parentNode())</span >

is this necessary? it seems like the below checks will take care of these cases</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>