Closed
Bug 1327902
Opened 7 years ago
Closed 7 years ago
Text selection by drag-n-drop is canceled if input is there (on https://vk.com/ )
Categories
(Core :: DOM: Selection, defect)
Tracking
()
RESOLVED
FIXED
mozilla53
People
(Reporter: arni2033, Assigned: MatsPalmgren_bugz)
References
Details
(Keywords: regression, testcase)
Attachments
(3 files)
278 bytes,
text/html
|
Details | |
1.60 KB,
patch
|
smaug
:
review+
jcristau
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
1.91 KB,
patch
|
Details | Diff | Splinter Review |
>>> My Info: Win7_64, Nightly 49, 32bit, ID 20160526082509 STR_1: 1. Copy string "asdf" to clipboard. Open attached "testcase 1" 2. Move mouse between "H" and "e" in string "Hell", hold left mouse button to start selection 3. Move mouse between "l" and "l" in string "Hell", then between "a" and "i" in string "pain" 4.(bonus) Release left mouse button. Press Ctrl+C, click in input, press Ctrl+V, press Ctrl+A STR_2: (original) 1. Copy string "asdf" to clipboard. Open https://vk.com/wall-7736865_418396 2. Move mouse to the bottom of empy area, hold left mouse button to start selection 3. Move mouse to the text above, then to the buttons on the left, then to the text above AR: In step 3 selection stops updating. In Step 4 wrong test is pasted in <input>; text in <input> is highlighted with blue simultaneously with text in the line above. ER: In Step 3 selection should update to contain second line. In Step 4 (only!) highlighted text should be copied to clipboard. Text in <input> shouldn't be highlighted simultaneously with text on page. Notes: 1) See another clone of bug 666618 before you start finding regression window - it may be helpful 2) You can also use "data:" url [1], which is identical to testcase 1. HTML is shown below. > [1] data:text/html,<!DOCTYPE html><style class="created-by-arni2033">.no_select {-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}</style><div>Hello world</div><div class="no_select">full</div><input placeholder="of"><div>pain!</div> data:text/html, <!DOCTYPE html> <style class="created-by-arni2033"> .no_select { -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none } </style> <div>Hello world</div> <div class="no_select">full</div> <input placeholder="of"> <div>pain!</div>
Comment hidden (spam) |
Comment 2•7 years ago
|
||
Narrowed inbound regression window from [28c3f022, 3c7cf3cc] (3 revisions) to [db0f2e93, 3c7cf3cc] (2 revisions) (~1 steps left) Oh noes, no (more) inbound revisions :( Last good revision: db0f2e9327aff428b9258db23ae0508f6a0ad861 First bad revision: 3c7cf3cca248c91c9f674e513ed0a797d3da7374 Pushlog: https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=db0f2e9327aff428b9258db23ae0508f6a0ad861&tochange=3c7cf3cca248c91c9f674e513ed0a797d3da7374 Looks like the following bug has the changes which introduced the regression: https://bugzilla.mozilla.org/show_bug.cgi?id=1216001 Mats, can you take a look at this?
status-firefox50:
--- → affected
status-firefox51:
--- → affected
status-firefox52:
--- → affected
status-firefox53:
--- → affected
Flags: needinfo?(mats)
Keywords: regressionwindow-wanted → regression
Version: Trunk → 47 Branch
Assignee | ||
Comment 3•7 years ago
|
||
So, what happens is nsRange::ExcludeNonSelectableNodes is called with a range spanning from "Hello" to "pain" and it splits it up in two ranges - the second with a start boundary point: <input> / 0. The problem with that is it's *inside* the text control, which is a node with HasIndependentSelection() true. So when we get a call to nsFrameSelection::HandleDrag for the "pain" text frame, we call nsINode::GetSelectionRootContent on that anchor we get a different root compared to the root for the "pain" text node, so we end up calling Selection::Extend with the anon <div> inside text control...
Assignee | ||
Comment 4•7 years ago
|
||
Attachment #8823868 -
Flags: review?(bugs)
Assignee | ||
Comment 5•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=60fc8f6b3c50a0c58ed1bae6389b13f5ad1d12a2
Comment 6•7 years ago
|
||
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0 Build ID 20170104133516 I have tested the try build from comment 5 and the issue is no longer reproducible. Testing was performed on Windows 10 x64, Windows 7 x64, Mac OS 10.11 and Ubuntu 14.04 x64.
Updated•7 years ago
|
Attachment #8823868 -
Flags: review?(bugs) → review+
Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/944f680d7707 Set the range boundary point outside (before) the node if it HasIndependentSelection(). r=smaug https://hg.mozilla.org/integration/mozilla-inbound/rev/f86d0941919c Test selecting over a user-select:none node next to an <input>.
Assignee | ||
Updated•7 years ago
|
Flags: in-testsuite+
Comment 8•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/944f680d7707 https://hg.mozilla.org/mozilla-central/rev/f86d0941919c
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Comment 9•7 years ago
|
||
Ciprian, can you please verify that this is fixed on Nightly? Mats, I'm not sure this is worth backporting to Beta at this point, but what are your thoughts about Aurora at least?
Assignee | ||
Comment 10•7 years ago
|
||
-moz-user-select:none seems like an edge case so probably not worth it for Beta. The patch is low risk though so OK for Aurora IMO.
Flags: needinfo?(mats)
Updated•7 years ago
|
Comment 11•7 years ago
|
||
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0 Build ID 20170109030209 I have retested the issue on the latest Nightly and it is no longer reproducible. As before, testing was performed on Windows 10 x64, Windows 7 x64, Mac OS 10.11 and Ubuntu 14.04 x64.
Flags: needinfo?(ciprian.muresan)
Comment 12•7 years ago
|
||
Comment on attachment 8823868 [details] [diff] [review] Set the range boundary point outside (before) the node if it HasIndependentSelection(). Approval Request Comment [Feature/Bug causing the regression]: bug 1216001 [User impact if declined]: text selection issues in some situations [Is this code covered by automated tests?]: yes [Has the fix been verified in Nightly?]: yes [Needs manual test from QE? If yes, steps to reproduce]: already done [List of other uplifts needed for the feature/fix]: none [Is the change risky?]: not really, just rearranging code [Why is the change risky/not risky?]: see above [String changes made/needed]: none
Attachment #8823868 -
Flags: approval-mozilla-aurora?
Comment 13•7 years ago
|
||
Comment on attachment 8823868 [details] [diff] [review] Set the range boundary point outside (before) the node if it HasIndependentSelection(). fix for text selection with non-selectable nodes, take in aurora52
Attachment #8823868 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 14•7 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-aurora/rev/f0f0bb716505 https://hg.mozilla.org/releases/mozilla-aurora/rev/205212edc09c
You need to log in
before you can comment on or make changes to this bug.
Description
•