PPS In short, assuming that the pseudo selector :active ONLY applies to the 
initial mousedown "target" element

then shouldnt this be all that is necessary to limit text selection to 
single table cells?

        TD:active        {-moz-user-select:text}

Am I correct in thinking that -moz-user-select is buggy?


"rvj" <[email protected]> wrote in message 
news:[email protected]...
> PS  In the example above, the mouseup script  is only for testing 
> purposes.
>
> In reality  what is needed is that the mousedown event would ALSO need to 
> change the class of the previous element  which has its class set 
> to -moz-user-select:text back to -moz-user-select:-moz-none
>
> the point is that it seems to be getting very messy for a such a simple 
> task !
>
> Is there an easier approach?
>
>
> "rvj" <[email protected]> wrote in message 
> news:[email protected]...
>>
>> thanks .. although I wasnt exactly sure what you meant by a  manual flush
>>
>> have appended a different approach to the problem - by changing the class 
>> of the element
>>
>> however the effect is the same - the text of the "target" element DOES 
>> NOT become selectable when the mouse down event fires
>> and of course is made unselectable when the mouse up event fires ( i 
>> assume addeventlistener is not mandatory).
>>
>> <html>
>> <head>
>> <script>
>> function depressbutton(tag) { tag.setAttribute('class','editor') }}
>> function releasebutton(tag){ tag.setAttribute('class','reader')}
>> </script>
>>
>> <style>
>> table{-moz-user-select:-moz-none;}
>> .editor {-moz-user-select:text;}
>> .reader {-moz-user-select:-moz-none;}
>> </style>
>>
>> <body  onmousedown="depressbutton(event.target)" 
>> onmouseup="releasebutton(event.target)">
>> <table>
>>
>> <tr>
>> <td>a  aaaaa  aaaaaa  aaa </td>
>> <td>bb bb bbb   bbb</td>
>> </tr>
>>
>> <tr>
>> <td>c cccc cccccc ccc</td>
>> <td >dddd dddd ddd</td>
>> </tr>
>>
>> </table>
>> </body>
>> </html>
>>
>>
>> "Boris Zbarsky" <[email protected]> wrote in message 
>> news:[email protected]...
>>> On 10/13/10 12:22 AM, rvj wrote:
>>>>    this.setAttribute('style','-moz-user-select:text')
>>>
>>> When is this running?  I suggest putting it in a capturing listener (and 
>>> perhaps manually triggering a style flush after that call....)
>>>
>>> -Boris
>>
>>
>
> 


_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to