<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: Form label text should be exposed as static text if it contains only static text"
   href="https://bugs.webkit.org/show_bug.cgi?id=158634#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: Form label text should be exposed as static text if it contains only static text"
   href="https://bugs.webkit.org/show_bug.cgi?id=158634">bug 158634</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=281045&amp;action=diff" name="attach_281045" title="Patch">attachment 281045</a> <a href="attachment.cgi?id=281045&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt; Source/WebCore/ChangeLog:8
&gt; +        Use AccessibilityLabel to represent HTMLLabelElement to AT.</span >

AT -&gt; assistive technologies

<span class="quote">&gt; Source/WebCore/accessibility/AccessibilityLabel.cpp:71
&gt; +        if (!child-&gt;accessibilityIsIgnored() &amp;&amp; !child-&gt;isDetached()) {</span >

I think we're guaranteed to only have unignored children in m_children

The same might be true of detached children

<span class="quote">&gt; Source/WebCore/accessibility/AccessibilityLabel.cpp:76
&gt; +                    staticText = true;</span >

Seems like you don't need to keep track of staticText. As soon as you get a failure can you can just return false

Then you can return true at the end of it right

Also, you could probably cache this value and then update when children are updated

<span class="quote">&gt; Source/WebCore/accessibility/AccessibilityLabel.cpp:92
&gt; +    return WebCore::containsOnlyStaticText(m_children);</span >

This WebCore:: prefix is probably unnecessary

<span class="quote">&gt; Source/WebCore/accessibility/AccessibilityLabel.h:41
&gt; +    AccessibilityRole roleValue() const override { return LabelRole; }</span >

Add a final to these

roleValue and stringValue() can probably be private

<span class="quote">&gt; Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:2237
&gt; +    if (role == LabelRole &amp;&amp; is&lt;AccessibilityLabel&gt;(*m_object) &amp;&amp; downcast&lt;AccessibilityLabel&gt;(*m_object).containsOnlyStaticText())</span >

This check 
role == LabelRole

Is probably not necessary since is&lt;AccessibilityLabel&gt; guarantees role = Label</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>