ShadowDOM Breaks Selection API
Reported by
milese...@gmail.com,
Apr 19 2017
|
|
Issue descriptionUserAgent: 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. |
|
►
Sign in to add a comment |
|
Comment 1 by yosin@chromium.org
, Apr 20 2017Status: 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.