Great! That is just what I was looking for. I think it is working.
Should I file a bug about the missing functions or is it already
reported?
- Paul
On May 10, 2005, at 6:44 PM, Darin Adler wrote:
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