Re: onSelectStart ?

>Looking at the DOM2 docs I found that the event model does not discuss a
>"selectStart" event. [...]


At this time the DOM doesn't have the concept of "selection". That's
considered a higher-level function, and the closest we come to it is to
point out that one of many ways to represent a selection might be as one or
more Ranges.

That doesn't mean we can't handle such an event, since the DOM event model
allows folks to create and distribute their own events, in addition to the
ones we've standardized. It just means we haven't said anything about what
that event might be called, or might contain. Your browser can implement
selectStart on top of the DOM...  but code which looks inside that event
may not be portable from platform to platform until selectStart's contents
are standardized.

We do expect to add keyboard events in DOM Level 3; we might be able to
consider this one at the same time.


>However, when the user starts "dragging" the browser begins selecting the
>text on the page. Can anyone recommend a "correct" way for avoiding this
>while sticking to the DOM1/DOM2 programming model.

If that behavior is itself being mediated through the DOM event model, then
setting up a listener which blocks some of the "default" handling might
work. If it's being implemented directly by the browser, there probably
isn't anything the DOM can do about it.

Note too that, at this time, the DOM says nothing about how events are
generated -- only about how they are distributed and what a specific set of
them is expected. So at some level you _are_ dependent upon higher-level
code to issue the appropriate events, at the appropriate time, with the
appropriate content.




Other events may be standardized in future levels of the DOM. In fact,
other events _will_ be; key events were explicitly deferred to Level 3
pending input from the i18n and accessibility working groups.

______________________________________
Joe Kesselman  / IBM Research

Received on Friday, 20 October 2000 10:30:46 UTC