[w3c/editing] Copying a Selection's "inner html" vs "outer html" (#168)

In current browser implementations, doing:

```js
var sel = window.getSelection();
sel.removeAllRanges();
var r = document.createRange();
// this: 
r.selectNode(somenode);
// or this:
r.selectNodeContents(somenode);
sel.addRange(r);
```

has the same result, whether using `selectNode` or `selectNodeContents`, to what is copied to the clipboard:
* Firefox will put the node's "outer html" to the clipboard's text/html mimetype
* Chrome and Safari will put the node's "inner html" to the clipboard

[See Chrome issue here](https://bugs.chromium.org/p/chromium/issues/detail?id=758485)

I think there needs to be a distinction, allowing developers to decide whether to include the entire node in the clipboard, or just its content.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/168

Received on Thursday, 24 August 2017 07:21:49 UTC