Bug 90348
Summary: | -webkit-user-select:none does not work as intended with select All( Ctrl + A) | ||
---|---|---|---|
Product: | WebKit | Reporter: | Sanjay <sanjaylgb> |
Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | ap, rniwa, sanjaylgb |
Priority: | P3 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
Sanjay
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Sanjay
(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
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
This is correct behavior per discussion in the original bug.
*** This bug has been marked as a duplicate of bug 80159 ***
Sanjay
(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
(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.