<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#c5">Comment # 5</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;&gt;&gt; Source/WebCore/accessibility/AccessibilityLabel.cpp:76
&gt;&gt;&gt; +                    staticText = true;
&gt;&gt; 
&gt;&gt; Seems like you don't need to keep track of staticText. As soon as you get a failure can you can just return false
&gt;&gt; 
&gt;&gt; Then you can return true at the end of it right
&gt;&gt; 
&gt;&gt; Also, you could probably cache this value and then update when children are updated
&gt; 
&gt; Having bool staticText means I don't have to check if children is empty. I could switch to size == 0 at the top.
&gt; 
&gt; Caching seemed tricky given there seem to be a lot of cases where the funnels aren't used and m_children.append() is used directly. And this method needs to be const to be called from stringValue() so calculating lazily and caching is tricky.</span >

<span class="quote">&gt;&gt; I could switch to size == 0 at the top.</span >

That seems better to me

<span class="quote">&gt;&gt;&gt; Source/WebCore/accessibility/AccessibilityLabel.cpp:92
&gt;&gt;&gt; +    return WebCore::containsOnlyStaticText(m_children);
&gt;&gt; 
&gt;&gt; This WebCore:: prefix is probably unnecessary
&gt; 
&gt; You need it to disambiguate from AccessibilityLabel::containsOnlyStaticText() (the compiler gets huffy without it)</span >

Might be better named

objectsContainOnlyStaticText or elementsContainOnlyStaticText

Since children is no longer accurate, the method being static rattan than an instance</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>