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

Issue 771903 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug


Participants' hotlists:
Hotlist-1


Sign in to add a comment

.focus() on shadow focusable prevents text selection

Reported by plato...@gmail.com, Oct 5 2017

Issue description

Chrome Version       : 61.0.3163.91
OS Version: OS X 10.12.6
URLs (if applicable) : http://jsbin.com/foxuyesela/edit?html,output
Other browsers tested:
  Add OK or FAIL after other browsers where you have tested this issue:
     Safari 11: OK

What steps will reproduce the problem?
1. Open JSbin: http://jsbin.com/foxuyesela/edit?html,output
2. Try to start selecting some text with mouse on the words “Try to start a selection here”.

What is the expected result?

Mouse text selection works.

What happens instead of that?

Mouse text selection does not work.


Please provide any additional information below. Attach a screenshot if
possible.

This seems to be related with Shadow DOM.

Motivation behind using manual `focus()`: by default with Shadow DOM, mousedown on a slotted element does not focus the focusable shadow slot wrapper, while we need focus on mousedown there for our use case. (I consider this as a feature, since focus does not happen both in Safari and Chrome in this case.)

When trying to workaround the lack of mousedown focus, I call `focus()` manually, and this causes the subject issue.

UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36



 
Cc: vamshi.k...@techmahindra.com
Labels: Needs-Bisect Needs-Feedback Triaged-ET
@Reporter:Tried checking the issue with the given JSbin URL, the issue is reproducible on the reported chrome version 61.0.3163.91, and as it works fine in M50 (50.0.2652.0) , we started bisecting, but the JSbin URL provided by you is not working fine with few chrome versions to check the issue, Could you please provide another JSbin file/Url to confirm the issue.

Thanks!

Comment 2 by plato...@gmail.com, Oct 11 2017

The issue implies using native Shadow DOM v1.

As far as I know, Shadow DOM v1 support was first introduced in Chrome 53. Therefore it does not really make sense to try anything older. The exact behaviour of the demo in the browsers lacking native Shadow DOM v1 support does not matter.

Currently I do not see any errors in the demo itself to fix. I have tried this demo with different native Shadow DOM v1 implementation in Safari 11, it works as expected there.

Project Member

Comment 3 by sheriffbot@chromium.org, Oct 11 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "vamshi.kommuri@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

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

Comment 4 by plato...@gmail.com, Oct 11 2017

Please note that, as of this moment, JSbin seems to be temporarily out of service. It does not even start a new bin for me. This might be a reason why the JSbin demo is not working in some Chrome versions for you as well.
Cc: hayato@chromium.org kochi@chromium.org
Components: Blink>DOM>ShadowDOM
Labels: Needs-Triage-M61
Status: Untriaged (was: Unconfirmed)
Since the test file for this is no longer working to repro the issue and as per Comment#2 this seems to be happening since in Chrome 53 when Shadow DOM v1 support was first introduced. Adding proper component and cc'ing devs @hayato and @kochi for more inputs on this.

Comment 6 by plato...@gmail.com, Oct 12 2017

As JSbin is down, I have created a repro in JSfiddle as well: https://jsfiddle.net/fLuznvv7/1/

Comment 7 by kochi@chromium.org, Oct 13 2017

Components: -Blink>DOM>ShadowDOM Blink>Editing>Selection
Owner: yoichio@chromium.org
Status: Assigned (was: Untriaged)
This seems editing selection issue.

Yoichi, could you take a look?
Cc: yoichio@chromium.org
Labels: -Pri-3 -Needs-Bisect hasbisect M-63 Pri-1
Owner: yosin@chromium.org
Able to reproduce this issue on reported version 61.0.3163.91 and latest Canary 63.0.3238.0 using Win 10, Ubuntu 14.04 and Mac 10.12.6


Bisect Information:
====================
Good build: 60.0.3104.0   -Revision :473014
Bad Build: 60.0.3105.0     -Revision:473393

Unable to perform per-revision bisect on M60, hence providing chromium bisect changelog

You are probably looking for a change made after 473127 (known good), but no later than 473131 (first known bad).
CHANGELOG URL:
  https://chromium.googlesource.com/chromium/src/+log/dac8e43d7961d3bd5d4db36b191aecd64e0979c9..99c24962dc687afd137ce69f7efb0a4ae1367301

Suspecting:
https://codereview.chromium.org/2891693002

@yosin:  Could you please check whether this is caused with respect to your change, if not please help us in assigning it to the right owner.

Thanks!
Labels: OS-Linux OS-Windows

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

Components: Blink>HTML>Focus
Owner: ----
Status: WontFix (was: Assigned)
Mark WontFix since this is expected behavior.

To set focus into distributed element, please add tabindex="0" to distributed
element, in the sample in #c1:
<my-container>
  <div tabindex="0">Slotted element. Try to start a selection here.</div>
_______^^^^^^^^^^^^
</my-container>

In the sample #c1, default event handler of "mousedown" set focus to BODY then
JS timer attempts to set focus to |focusable| and cancel mouse dragging since
active element is moved.

Sign in to add a comment