New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 771573 link

Starred by 4 users

Regression: Unable to drag links with user-select: text

Reported by db...@etouch.net, Oct 4 2017

Issue description

Chrome Version: 62.0.3202.45 Revision ca262a4fff487c2dbe6f28f66c7f6f5806462ee3-refs/branch-heads/3202@{#573}(32/64 bit)
OS: Windows(7,8,10), Mac(10.12.6), Linux(14.1) 

What steps will reproduce the problem?
(1) Launch chrome, navigate to chrome://settings and type random text in search field.
(2) Try to drag 'Google Chrome help' link on 'No search results found' and observe

Actual: Unable to drag 'Google Chrome help' instead text gets selected.

Expected: 'Google Chrome help' link should get drag.

This is a regression issue, broken in 'M-62', below is bisect info:

Good Build: 62.0.3166.0
Bad Build: 62.0.3168.0

You are probably looking for a change made after 489362 (known good), but no later than 489363 (first known bad).

CHANGELOG URL:
https://chromium.googlesource.com/chromium/src/+log/17684e9d8dd252a678cc17989303eaf027cbb61a..7a66627f0f0a681fcf3111a9bb0f01a8e0790186

Suspect: https://chromium.googlesource.com/chromium/src/+/7a66627f0f0a681fcf3111a9bb0f01a8e0790186

 
Actual_Drag.mov
2.5 MB Download
Expected_Drag.mov
2.7 MB Download
Labels: -M-63 ReleaseBlock-Stable M-62
tagging with blocker label, please undo if not the case.

Comment 2 by hu...@vewd.com, Oct 4 2017

Cc: eirage@chromium.org yosin@chromium.org
Minimal repro:
 <div style="user-select: text">
 Here comes <a href="www">a link text</a> in the middle of user-select: text.
 </div>

Workaround: 
 <div style="user-select: auto">
 ...
 </div>

It happens because of the logic in Node::CanStartSelection(). From users' perspective, I think it makes sense that "selectability" trumps "draggability". Does the spec say anything about this? 
Cc: yoichio@chromium.org
Owner: ----

Comment 4 by hu...@vewd.com, Oct 5 2017

Cc: tkent@chromium.org
Summary: Regression: Unable to drag links with user-select: text (was: Regression: Unable to drag 'Google Chrome help' link in chrome://settings)
Cc: -hu...@opera.com nainar@chromium.org
Owner: hu...@vewd.com
Could someone from reviewer's list (cc'ed) answer c#2?

Comment 6 by hu...@vewd.com, Oct 6 2017

Status: Started (was: Assigned)
I made an attempt to solve this at https://chromium-review.googlesource.com/c/chromium/src/+/705234 .
Pada 5 Okt 2017 16:00, "hu… via monorail" <
monorail+v2.583525691@chromium.org> menulis:

Comment 8 by hu...@vewd.com, Oct 9 2017

Cc: friv...@gmail.com
Cc: meade@chromium.org
meade@, ccing you in on a regression. I can't find a spec reference to answer c#2. could you TAL? The change in in c#6 sounds simple enough. 

Comment 10 by hu...@vewd.com, Oct 9 2017

Components: -UI>Settings Blink>DataTransfer
Cc: tabatkins@chromium.org
ccing Tab for the spec question in c#2

Comment 12 by yosin@chromium.org, Oct 10 2017

According to the spec[1], user-select CSS property should not affect draggability
of node.

It seems current implementation is somewhat ad-hoc.


[1] https://html.spec.whatwg.org/multipage/dnd.html#drag-and-drop-processing-model

Comment 13 by yosin@chromium.org, Oct 10 2017

Components: -Blink>DataTransfer Blink>Editing>Selection
Labels: -Pri-1 -ReleaseBlock-Stable Pri-3
Lower to Pri-3 and remove release-blocker label since dragging link to search
field is frequent user scenario.

Comment 14 by hu...@vewd.com, Oct 10 2017

Labels: -Pri-3 Pri-2
I think it's fairly common to drag links to the "tab bar" (an alternative to right click and "Open link in new tab"). Imagine your keyboard disconnected and your mouse's right button broken... I'd say this is at least Pri-2.
I would agree with Hugo here. I am sure there are accessibility implications of this change as well. 

Comment 16 by hu...@vewd.com, Oct 10 2017

Labels: Merge-Request-62
Added Merge-Request-62 for https://chromium-review.googlesource.com/c/chromium/src/+/705234. I prefer to not let this glitch slip into M-62.
Project Member

Comment 17 by sheriffbot@chromium.org, Oct 10 2017

Labels: -Merge-Request-62 Merge-Review-62 Hotlist-Merge-Review
This bug requires manual review: We are only 6 days from stable.
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), bhthompson@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-62 Merge-Rejected-62
My recommendation is to wait until M63. Since this hasn't been tested in canary yet and our last M62 Beta release is scheduled for tomorrow, this doesn't meet the requirements for merge to Beta branch. This is also not considered a release blocker. Rejecting merge to M62. If you think otherwise, please provide a detailed explanation of why this is critical. 
Project Member

Comment 19 by bugdroid1@chromium.org, Oct 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2e2c1dd03e4aa24a1e606c287b0680911408ae88

commit 2e2c1dd03e4aa24a1e606c287b0680911408ae88
Author: Hugo Holgersson <hugoh@vewd.com>
Date: Fri Oct 13 09:42:17 2017

Make links draggable despite 'user-select: text' styling

Problem:
 When a Text node, "hey" is within a link that is within
 |user-select: text|,

 <div style="user-select: text"><a href="">hey</a></div>

 The link text, "hey" should be draggable despite any
 user-select styling.

Background:
 The bug surfaced because Node::CanStartSelection
 returns true for any node that is within a
 |user-select: text| sub tree. That made
 DragController::DraggableNode make the wrong decision
 (it returned nullptr for start_node = "hey").

Solution:
 With a new helper, SelectTextInsteadOfDrag we check if
 a dragged node is a selectable and undraggable Text node.

Note:
 There can only be one Text node in the ancestor chain
 (because Text nodes cannot have children) so
 SelectTextInsteadOfDrag will only be called once.

Bug:  771573 
Change-Id: Id482cf0888cd428d0bc9a12bff535743c7138df8
Reviewed-on: https://chromium-review.googlesource.com/705234
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Hugo Holgersson <hugoh@vewd.com>
Cr-Commit-Position: refs/heads/master@{#508658}
[add] https://crrev.com/2e2c1dd03e4aa24a1e606c287b0680911408ae88/third_party/WebKit/LayoutTests/editing/selection/mouse/drags_within_user-select_combos.html
[modify] https://crrev.com/2e2c1dd03e4aa24a1e606c287b0680911408ae88/third_party/WebKit/Source/core/page/DragController.cpp

Comment 20 by hu...@vewd.com, Oct 16 2017

Labels: Merge-Request-63

Comment 21 by hu...@vewd.com, Oct 17 2017

Status: Fixed (was: Started)
Project Member

Comment 22 by sheriffbot@chromium.org, Oct 17 2017

Labels: -Merge-Request-63 Hotlist-Merge-Approved Merge-Approved-63
Your change meets the bar and is auto-approved for M63. Please go ahead and merge the CL to branch 3239 manually. Please contact milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), gkihumba@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 23 by bugdroid1@chromium.org, Oct 17 2017

Labels: -merge-approved-63 merge-merged-3239
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e468a76f7ac58cb8b8050862164f6020aaf0d792

commit e468a76f7ac58cb8b8050862164f6020aaf0d792
Author: Hugo Holgersson <hugoh@vewd.com>
Date: Tue Oct 17 21:34:53 2017

Make links draggable despite 'user-select: text' styling

Problem:
 When a Text node, "hey" is within a link that is within
 |user-select: text|,

 <div style="user-select: text"><a href="">hey</a></div>

 The link text, "hey" should be draggable despite any
 user-select styling.

Background:
 The bug surfaced because Node::CanStartSelection
 returns true for any node that is within a
 |user-select: text| sub tree. That made
 DragController::DraggableNode make the wrong decision
 (it returned nullptr for start_node = "hey").

Solution:
 With a new helper, SelectTextInsteadOfDrag we check if
 a dragged node is a selectable and undraggable Text node.

Note:
 There can only be one Text node in the ancestor chain
 (because Text nodes cannot have children) so
 SelectTextInsteadOfDrag will only be called once.

TBR=pdr@chromium.org

(cherry picked from commit 2e2c1dd03e4aa24a1e606c287b0680911408ae88)

Bug:  771573 
Change-Id: Id482cf0888cd428d0bc9a12bff535743c7138df8
Reviewed-on: https://chromium-review.googlesource.com/705234
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Hugo Holgersson <hugoh@vewd.com>
Cr-Original-Commit-Position: refs/heads/master@{#508658}
Reviewed-on: https://chromium-review.googlesource.com/723284
Reviewed-by: Hugo Holgersson <hugoh@vewd.com>
Cr-Commit-Position: refs/branch-heads/3239@{#37}
Cr-Branched-From: adb61db19020ed8ecee5e91b1a0ea4c924ae2988-refs/heads/master@{#508578}
[add] https://crrev.com/e468a76f7ac58cb8b8050862164f6020aaf0d792/third_party/WebKit/LayoutTests/editing/selection/mouse/drags_within_user-select_combos.html
[modify] https://crrev.com/e468a76f7ac58cb8b8050862164f6020aaf0d792/third_party/WebKit/Source/core/page/DragController.cpp

Comment 24 by yosin@chromium.org, Oct 25 2017

Cc: hu...@vewd.com pdr@chromium.org dtapu...@chromium.org susanjuniab@chromium.org
 Issue 777638  has been merged into this issue.

Comment 25 by yosin@chromium.org, Oct 25 2017

NextAction: 2017-11-01
Observing feedbacks for M62-stable, released on October 24, if there are lots of
feedbacks, we want to merge into M62.
The NextAction date has arrived: 2017-11-01

Sign in to add a comment