[Webkit-unassigned] [Bug 26991] [Gtk] get_n_selections and get_selection fail when selecting text across object boundaries

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 11 06:24:23 PDT 2010


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





--- Comment #3 from Mario Sanchez Prada <msanchez at igalia.com>  2010-08-11 06:24:23 PST ---
Created an attachment (id=64105)
 --> (https://bugs.webkit.org/attachment.cgi?id=64105)
Patch to fix this issue

[Disclaimer: this is WIP, not a patch to be reviewed at this moment]

After working on this stuff I think I finally got a reliable way to check whether a global selection belongs (even partially only) to a accessible object inside the Atk wrapper's code, thus allowing to return the right values when executing getNSelections() in the kind of scenarios as those described by Joanmarie, and even in other cases I've tested (such as selecting text accross diferent paragraphs at the same level, with more and more nested elements inside of it and so on).

However, or the implementation of getSelection, I need to add some more code (but based on the new code in selectionBelongsToObject()) to allow getting the exact values for the start and end offsets of a selection *for a given object* (so if you have a full paragraph selected and just ask a link inside of it for the offsets they are relative to such link), and I have to say it works pretty fine in all the cases I've tested.

Hence, I guess now the next step here would be to write some unit tests (or even layout tests?) for this new code, so I'll focus on that. However, as I was chatting to Joanmarie on IRC, I couldn't find an obvious way to select and unselect text so I could write those unit tests, so perhaps it could be worth it to try to fix bug 25673 first and then write unit tests for both the setSelection and getSelection stuff.

Now attaching a patch with the code I've working now, in case you want to test it or comment on top of it.

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