The issue here is that selections aren't arbitrary DOM ranges. They
correspond only to what users see; so the selection begins at the
first character inside the H1 element and ends at the first
character on the next line.
Does that mean I should really manipulate the DOM objects to make
changes to the DOM tree? I guess replaceSelectionWithNode: is then
just for modifications coming through the UI (or for modifications
not really caring about what the DOM tree will look like)?
I think that WebKit ought to make it easier to do these kinds of
changes in an undoable way.
That would be great! Should I file a bug, and what would be the magic
words for that bug?
If your original selection was inside some text, then the container
of the range endpoint was a text node, and the offset was the
character inside the text where the selection began.
Ah, of course. How stupid of me! :) I forgot that, because I was the
massaging the actually selected DOM text node to the H1 node, its
parent. Thanks a lot!
My problems are solved! Thanks again!
--
Petteri Kamppuri
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden