ShadowRoot currently does not have selection attribute. Spec is here. https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#api-shadow-root-selection
Since we don't want to maintain multiple Selection objects, it would be good if we have a proxy object which implements Selection interface to return elements in shadow subtrees.
Let us just add a selection attribute for ShadowDOM. It's OK to return the same thing in window for now.
Created attachment 134741 [details] Patch
Could you elaborate whole plan to have valid SadowRoot.selection? Starting from just adding attribute is fine but we need a big picture to justify it.
Sorry for late response... I'm panning to fix in the following way. (1) Appending ShadowRoot.selection (2) Extending DOMSelection to have TreeScope. Each TreeScope will have its own DOMSelection as a cache. This will be tracked in Bug 82698.
I'll update the ChangeLog to have the above explanation...
Created attachment 136196 [details] Patch
Comment on attachment 136196 [details] Patch Clearing flags on attachment: 136196 Committed r113667: <http://trac.webkit.org/changeset/113667>
All reviewed patches have been landed. Closing bug.