On May 10, 2005, at 12:33 AM, Paul Ossenbruggen wrote:
In Safari 1.3+, how do you convert a selection retrieved from
window.getSelection() to a Range as specified in DOM 2 Ranges? In
Mozilla you use getRangeAt() and in IE you use selection.createRange
(). It seems that neither is supported with Safari. I was unable to
find the W3C DOM way of doing it either. If I use createRange on
the document I get an initialized textRange but not one that
represents the selection. Safari documentation on this is sparse.
Am I missing something obvious?
We should really support both of those!
Unfortunately, Safari 1.3 doesn't support either. But I suggest you
try using selection.type to find out the type and then
selection.baseNode, selection.baseOffset, selection.extentNode, and
selection.extentOffset to get the four values you need to create a
range.
-- Darin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webcore-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webcore-dev/email@hidden