<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#c6">Comment # 6</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:rniwa@webkit.org" title="Ryosuke Niwa <rniwa@webkit.org>"> <span class="fn">Ryosuke Niwa</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=271611&action=diff" name="attach_271611" title="Patch">attachment 271611</a> <a href="attachment.cgi?id=271611&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=271611&action=review">https://bugs.webkit.org/attachment.cgi?id=271611&action=review</a>
<span class="quote">> Source/WebCore/accessibility/AXObjectCache.cpp:1416
> + Position deepEquivalent = visiblePosition.deepEquivalent();
> + bool equivalent = deepEquivalent.deprecatedNode() == textMarkerData.node && deepEquivalent.deprecatedEditingOffset() == textMarkerData.offset;
> + if (!equivalent && visiblePosition.affinity() != textMarkerData.affinity) {
> + Position position;
> + if (textMarkerData.affinity == UPSTREAM)
> + position = deepEquivalent.upstream();
> + else
> + position = deepEquivalent.downstream();
> + if (position.deprecatedNode() == textMarkerData.node && position.deprecatedEditingOffset() == textMarkerData.offset)
> + equivalent = true;
> + }
> + return equivalent;</span >
Instead of manually adjusting the visible position's deep equivalent, you should just create a new VisiblePosition out of textMarkerData and check whether they match or not.
By the way, '&' should be directly adjacent to type in C++ code: <a href="https://webkit.org/code-style-guidelines/#pointers-and-references">https://webkit.org/code-style-guidelines/#pointers-and-references</a></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>