<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: Selection change as a result of focusing an element should include that information in the intent"
   href="https://bugs.webkit.org/show_bug.cgi?id=146533#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: Selection change as a result of focusing an element should include that information in the intent"
   href="https://bugs.webkit.org/show_bug.cgi?id=146533">bug 146533</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=255970&amp;action=diff" name="attach_255970" title="patch">attachment 255970</a> <a href="attachment.cgi?id=255970&amp;action=edit" title="patch">[details]</a></span>
patch

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

<span class="quote">&gt; Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1686
&gt; +    if (AXObjectCache* cache = axObjectCache())</span >

i don't think you have to worry about axObjectCache() being nullptr inside of an AX object

<span class="quote">&gt; Source/WebCore/dom/Element.h:325
&gt; +    static AXTextStateChangeIntent defaultFocusTextStateChangeIntent() { return AXTextStateChangeIntent(AXTextStateChangeTypeSelectionMove, AXTextSelection { AXTextSelectionDirectionDiscontiguous, AXTextSelectionGranularityUnknown, true }); }</span >

is this one different from the default AXTextStateChangeIntent(); 
for cases, like
select(Element::defaultFocusTextStateChangeIntent());
it would be nice to not have to pass the argument

<span class="quote">&gt; Source/WebCore/editing/FrameSelection.cpp:174
&gt; +    AXTextStateChangeIntent newIntent;</span >

can we remove the else and just initialize with
newIntent = intent;

<span class="quote">&gt; Source/WebCore/html/HTMLTextFormControlElement.h:113
&gt; +    void restoreCachedSelection(const AXTextStateChangeIntent&amp; = AXTextStateChangeIntent());</span >

AXTextStateChangeIntent is  looking a bit wordy. Since this is being used all over non accessibility code, maybe the name should be changed to something like

TextIntention</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>