RenderText::checkSelectionPoint

John Tapsell john at geola.co.uk
Thu Jan 6 12:05:11 GMT 2005


Hi all,
  If you have html like litterally:

>
                                       on Thursday January 06, @03:50AM (

(taken from slashdot), you get a textImpl node with the text:

>
                                       on Thursday January 06, @03:50AM (

When this is rendered, the \n[ \t]*   gets stripped.
This means that when you make a selection (e.g. "on") with the mouse, it 
reports the selection is from offset 2, as the rendered text is "> on Thu.."

The copy to clipboard code uses this offset with the textImp Node value, and 
so starts just after then \n, in the middle of the spaces/tabs.  This means 
when you paste, you get spaces.

The problem I think is with RenderText::checkSelectionPoint.  Looking at the 
Changelog, this has been fixed, deleted, readded, and fixed again many times 
over.

Should checkSelectionPoint be fixed to return the correct offset relative to 
the string in the textImpl, or should it indeed return the offset for the 
rendered string, and the copy to clipboard code changed to grab the rendered 
string?

John





More information about the kfm-devel mailing list