RESOLVED DUPLICATE of bug 80159 90348
-webkit-user-select:none does not work as intended with select All( Ctrl + A)
https://bugs.webkit.org/show_bug.cgi?id=90348
Summary -webkit-user-select:none does not work as intended with select All( Ctrl + A)
Sanjay
Reported 2012-07-01 07:52:55 PDT
Consider below code. The 2nd div element should not be selected, but it does get selected when i give Select All (Ctrl + A) on the browser window. <!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <div id="first"> First </div> <div id="second" style="-webkit-user-select:none;-moz-user-select:none"> Second.. Cannot be selected. </div> <div id="third"> Third </div> </body> </html> If you remove the third div element, the second one is not selected because there is no select-able element in DOM after the 2nd one which is not select-able I tried to apply -moz-user-select to test in firefox where it works just fine.
Attachments
Sanjay
Comment 1 2012-07-01 08:58:40 PDT
(In reply to comment #0) > Consider below code. The 2nd div element should not be selected, but it does get selected when i give Select All (Ctrl + A) on the browser window. I can confirm this by giving Copy (Ctrl + c) followed by select all (Ctrl+A) and pasting the content in a text file. > <!DOCTYPE html> > <html> > <head> > <title></title> > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> > </head> > <body> > <div id="first"> > First > </div> > > <div id="second" style="-webkit-user-select:none;-moz-user-select:none"> > Second.. Cannot be selected. > </div> > > <div id="third"> > Third > </div> > </body> > </html> > > If you remove the third div element, the second one is not selected because there is no select-able element in DOM after the 2nd one which is not select-able > > I tried to apply -moz-user-select to test in firefox where it works just fine.
Sanjay
Comment 2 2012-07-01 09:00:10 PDT
Just to clarify.. the problem here is that the 2nd div gets copied when we select all and then copy the content to the clipboard.
Alexey Proskuryakov
Comment 3 2012-07-01 10:57:57 PDT
This is correct behavior per discussion in the original bug. *** This bug has been marked as a duplicate of bug 80159 ***
Sanjay
Comment 4 2012-07-02 02:18:58 PDT
(In reply to comment #3) > This is correct behavior per discussion in the original bug. > > *** This bug has been marked as a duplicate of bug 80159 *** The original bug states that Firefox works same as Safari/Chrome. But that is not true. You can test out the above code on all the three browsers. On Safari/Chrome, the non - select-able div gets copied while it does not get copied in Firefox. The behavior is clearly different.
Ryosuke Niwa
Comment 5 2012-07-02 11:28:31 PDT
(In reply to comment #4) > (In reply to comment #3) > > This is correct behavior per discussion in the original bug. > > > > *** This bug has been marked as a duplicate of bug 80159 *** > > The original bug states that Firefox works same as Safari/Chrome. But that is not true. You can test out the above code on all the three browsers. On Safari/Chrome, the non - select-able div gets copied while it does not get copied in Firefox. The behavior is clearly different. I've re-opened the original bug so please continue the discussion there.
Note You need to log in before you can comment on or make changes to this bug.