[Webkit-unassigned] [Bug 118908] [ATK] Issues with edge cases when getting offsets for a text range in AtkText

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 24 11:19:58 PDT 2013


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





--- Comment #3 from Mario Sanchez Prada <mario at webkit.org>  2013-07-24 11:19:49 PST ---
(In reply to comment #2)
> (From update of attachment 207114 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=207114&action=review
> 
> > Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp:521
> > +    // Default values, unless the contrary is proved.
> 
> This comment seems superfluous.
> 
Ok

> > Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp:538
> > +        startOffset = comparePositions(selection.start(), firstValidPosition) < 0 ? 0 : accessibilityObjectLength(coreObject);
> 
> So if the selection is after the node then you return accessibilityObjectLength 
> as the start and end offsets?

Yes. If we reached that point it means that the selection falls *entirely* out of the range associated to the accessibility object, so we need to return a zero-length offsets range.

Now the reason why we return accesibilityObjectLength in that case is because in that situation the selection happens to be after the accessibility object, and so we must return a zero-length range coherent with that, since that's what other ATK implementations do.

Just think of it as normalizing the start and end offsets to the correct side of the text range associated to the object, so you either will have [0, 0] when the selection is before the object or [n, n] when it's after it.

> > Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp:560
> > +    int rangeLength = TextIterator::rangeLength(nodeRange.get(), true);
> 
> Looks like you can avoid this temporary.

Ok

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list