[Webkit-unassigned] [Bug 154366] AX: AXObjectCache::visiblePositionForTextMarkerData() doesn't account for equivalent visibly equivalent positions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 17 19:40:10 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=154366

--- Comment #6 from Ryosuke Niwa <rniwa at webkit.org> ---
Comment on attachment 271611
  --> https://bugs.webkit.org/attachment.cgi?id=271611
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=271611&action=review

> 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;

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: https://webkit.org/code-style-guidelines/#pointers-and-references

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160218/ef2c6e32/attachment-0001.html>


More information about the webkit-unassigned mailing list