The following piece of code in WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp should be simplified: // Set preliminar values for start and end offsets startOffset = nodeRangeStart.offsetInContainerNode(); endOffset = nodeRangeEnd.offsetInContainerNode(); // If the end node is different then the start node, iterate over // those among them to build the effective value for endOffset if (nodeRangeStart.anchorNode() != nodeRangeEnd.anchorNode()) { RefPtr<Range> nodeRange = Range::create(node->document(), nodeRangeStart, positionBeforeNode(nodeRangeEnd.anchorNode())); for (TextIterator it(nodeRange.get()); !it.atEnd(); it.advance()) { RefPtr<Range> range = it.range(); if (range->startContainer()->isTextNode()) endOffset += range->endOffset(); } } This could be simplified using TextIterator::rangeLength(), making the code cleaner and more readable
Created attachment 67433 [details] Patch to fix this issue Attaching a patch to fix this "issue" by simplifying the code as expected: Use TextIterator::rangeLength() to calculate endOffset * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: (getSelectionOffsetsForObject): Don't manually iterate over a artificial new range but just call TextIterator::rangeLength on the range created between the start and end positions. Hence, asking for review (and for the cq+ flag as well ;-)
Comment on attachment 67433 [details] Patch to fix this issue Awesome. Thanks!
Comment on attachment 67433 [details] Patch to fix this issue Clearing flags on attachment: 67433 Committed r67435: <http://trac.webkit.org/changeset/67435>
All reviewed patches have been landed. Closing bug.