[WA1] GUI Selections (was Re: [whatwg] Web Forms 2.0)

On 23 Feb, 2005, at 5:18 PM, Matthew Raymond wrote:
> ...
>    So you see, if we want to establish a GUI selection interface for 
> DOM/Javascript, we can use DOM Range as PART of the interface, but we 
> still have to define some way of getting the current selection and 
> setting the user selection. I'm thinking something like this:
>
> | var myRange = document.getSelection();

That seems harmless ...

>    The above gets the current selection within the document. If the 
> document doesn't have a selection, it returns document.createRange(). 
> Similarly, there will be a setSelection method:
>
> | document.setSelection(myRange);
>
>    If you wish to deselect everything in the document, you could do 
> the following:
>
> | document.removeSelection();
> ...

.... But those two, unfortunately, seem more likely to be abused than 
usefully used. Annoying authors would repeatedly clear any selection in 
a misguided attempt to prevent people from copying text, more often 
than application authors would use those functions for legitimate 
purposes. (Yes, you could work around this by turning off JavaScript, 
but that would work only for the small proportion of users who 
understand what's causing the problem.)

I know that authors can be annoying no matter what you give them (for 
example, displaying text as graphics), but I think this would make 
being annoying far too easy.

-- 
Matthew Thomas
http://mpt.net.nz/

Received on Wednesday, 23 February 2005 16:10:51 UTC