New issue
Advanced search Search tips

Issue 713282 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

ShadowDOM Breaks Selection API

Reported by milese...@gmail.com, Apr 19 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3074.0 Safari/537.36

Steps to reproduce the problem:
1. Load test case
2. Type text in reference box
3. Type text in shadow box

What is the expected behavior?
Selection should be reflected in the box just below text entry for both cases.

What went wrong?
Light DOM selection works fine. Shadow DOM selection does not reflect selection or caret position.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 60.0.3074.0  Channel: canary
OS Version: OS X 10.12.4
Flash Version: 

I may be missing something, but no documentation I've seen points to an obvious error on my part that I can see.
 
shadowdom_selection_bug.html
1.7 KB View Download

Comment 1 by yosin@chromium.org, Apr 20 2017

Components: -Blink>Editing Blink>Editing>Selection
Status: WontFix (was: Unconfirmed)
Mark WontFix since this is works as expected.

Please use ShadowRoot#getSelection() when selection is in shadow tree, to get
{anchor,focus}{Node,Offset} for shadow tree.

The Selection object retrieved by window.getSelection() == Document#getSelection(),
returns adjusted positions, e.g. shadow host in main tree.

Sign in to add a comment