<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: AXObjectCache::visiblePositionForTextMarkerData() doesn't account for equivalent visibly equivalent positions"
   href="https://bugs.webkit.org/show_bug.cgi?id=154366#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: AXObjectCache::visiblePositionForTextMarkerData() doesn't account for equivalent visibly equivalent positions"
   href="https://bugs.webkit.org/show_bug.cgi?id=154366">bug 154366</a>
              from <span class="vcard"><a class="email" href="mailto:d_russell&#64;apple.com" title="Doug Russell &lt;d_russell&#64;apple.com&gt;"> <span class="fn">Doug Russell</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=154366#c6">comment #6</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=271611&amp;action=diff" name="attach_271611" title="Patch">attachment 271611</a> <a href="attachment.cgi?id=271611&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=271611&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=271611&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.cpp:1416
&gt; &gt; +    Position deepEquivalent = visiblePosition.deepEquivalent();
&gt; &gt; +    bool equivalent = deepEquivalent.deprecatedNode() == textMarkerData.node &amp;&amp; deepEquivalent.deprecatedEditingOffset() == textMarkerData.offset;
&gt; &gt; +    if (!equivalent &amp;&amp; visiblePosition.affinity() != textMarkerData.affinity) {
&gt; &gt; +        Position position;
&gt; &gt; +        if (textMarkerData.affinity == UPSTREAM)
&gt; &gt; +            position = deepEquivalent.upstream();
&gt; &gt; +        else
&gt; &gt; +            position = deepEquivalent.downstream();
&gt; &gt; +        if (position.deprecatedNode() == textMarkerData.node &amp;&amp; position.deprecatedEditingOffset() == textMarkerData.offset)
&gt; &gt; +            equivalent = true;
&gt; &gt; +    }
&gt; &gt; +    return equivalent;
&gt; 
&gt; Instead of manually adjusting the visible position's deep equivalent, you
&gt; should just create a new VisiblePosition out of textMarkerData and check
&gt; whether they match or not.
&gt; 
&gt; By the way, '&amp;' should be directly adjacent to type in C++ code:
&gt; <a href="https://webkit.org/code-style-guidelines/#pointers-and-references">https://webkit.org/code-style-guidelines/#pointers-and-references</a></span >

The VisiblePosition I have was created from the TextMarkerData so it would always match. I was considering making VisiblePosition::canonicalPosition() a public static method instead of this manual adjustment. What do you think of that?</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>