Is it possible to call caretPositionFromPoint() for shadowRoot? понедельник, 19 октября 2015 г. в 09:13:48 UTC+5, Yoshifumi Inoue:
> Thanks for using shadowDOM. > > To get caret position in shadow tree, you need to use > ShadowRoot.caretPositionFromPoint(x, y) instead of > Document.caretPositionFromPoint(x, y) > http://w3c.github.io/webcomponents/spec/shadow/#the-shadowroot-interface > > However, current Blink doesn't implement caretPositionFromPoint() on > Document and ShadowRoot. Note: caretRangeFromPoint() is replaced by > caretPointFromPoint() in current CSSOM specification. > > Please start following bug in Blink issue tracker to raise priority of > implementing caretPositionFromPoint() > http://crbug.com/388976 > > Thanks! > -yosi > > > > > 2015年10月18日(日) 11:51 <nazar.mo...@gmail.com>: > >> I'm working on Shadow DOM support in TinyMCE (namely, make it working >> under Shadow DOM). >> It is quite big piece of software, but everything seems to be quite good >> so far. >> >> The problem I've faced currently is with `document.caretRangeFromPoint()` >> method called in `drop` event handler after dragging text selection within >> `<p>` element. >> When `div[contenteditable=true]` is under Shadow DOM this method returns >> Range where all relevant properties (commonAncestorContainer, endContainer >> and startContainer) contain direct parent of shadow's host element, while I >> expect text node. >> So, I'm getting: `html > body > form`. >> While I was expecting: `html > body > form > x-editor::shadow > >> div[contenteditable] > p > TEXT_NODE >> TEXT_NODE is where content was dropped, so text from one `<p>` dragged >> and dropped at the end of another. >> >> Is this an expected behavior and how to workaround that if so? >> Chromium 45.0.2454.101. >> > -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscr...@chromium.org. To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/4abf7661-dae8-45d6-8875-0eea2976b7e1n%40chromium.org.