patch: khtml text selection with complex text

Leo Savernik l.savernik at aon.at
Tue Mar 14 13:57:06 GMT 2006


Am Sonntag, 12. März 2006 22:34 schrieb Simon Hausmann:
> Hi,
>
> text selection with complex text is currently broken in khtml, because
> khtml draws the selected text as a separate string, breaking it apart at
> invalid positions. You can see that easily on web sites with arabic text
> for example. The only solution to that problem is unfortunately to draw the
> run of text that is part of the beginning or the end of the selection
> twice, once unselected and once selected with a clip rectangle set. The
> clipping is necessary as there may be valid cursor positions inside a
> ligature.

Thanks for tackling it :-) I've had that on my todo list but never come around 
implementing it.
>
> Attached is my attempt at implementing this. Would be cool if somebody
> could comment on the patch, or perhaps even approve it :)
>

I've reviewed it. It is generally ok, yet I'm missing some cheap optimisation:
- In InlineTextBox::paintSelection, don't do visual clipping unless necessary 
(i. e. startPos!=m_start || endPos!=m_start+m_len)

Furthermore ensure that your patch doesn't cause a regression of bug 
http://bugs.kde.org/show_bug.cgi?id=90422
If scrolling starts to be very slow either with or without selected text (best 
watched with Ctrl+A), the regression is back.

mfg
	Leo




More information about the kfm-devel mailing list