You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've initially logged it on w3c/editing#168 but was directed to the Selection API / Clipboard API repos — not sure what the interdependencies are, so I'm logging it here.
I think the Copy action needs some clarification on:
3.1. Copy the selected contents, if any, to the clipboard. Implementations should create alternate text/html and text/plain clipboard formats when content in a web page is selected.
In regards to how the selection translates to HTML content. Case in point, browsers treat a Selection whose Range is set to either a Node (via range.selectNode) or a Node's contents (via range.selectNodeContents) the same way:
Firefox will copy the Node's inner HTML to the clipboard
Chrome and Safari will copy the Node's outer HTML to the clipboard
I believe there needs to be a way for authors to specify if the Node as a whole should be included in the clipboard, or just its content.
The text was updated successfully, but these errors were encountered:
To achieve compatibility across browsers, it should additionally be specified how the selected contents are copied.
For instance, when selecting rows in a table, current browser behavior (Chrome, Firefox) when pasting them to the clipboard is to create a tab between the content of two adjacent cells.
Example: open the following in a browser, select all and copy-paste to a text editor: data:text/html,<table><tr><td>x</td><td>y</td><tr/> <tr><td>a</td> <td>b</td></tr> </table>
However, if the selected elements have the display property block, Chrome and Firefox create line breaks between two adjacent cells.
Example: open the following in a browser, select all and copy-paste to a text editor: data:text/html,<table><tr><td><p>x</td><td><p>y</td><tr/> <tr> <td><p>a</td> <td><p>b</td> </tr> </table>
Having such and potentially other related details specified would help achieving a reasonable and consistent behavior across browsers.
I've initially logged it on w3c/editing#168 but was directed to the Selection API / Clipboard API repos — not sure what the interdependencies are, so I'm logging it here.
I think the Copy action needs some clarification on:
In regards to how the selection translates to HTML content. Case in point, browsers treat a Selection whose Range is set to either a Node (via
range.selectNode
) or a Node's contents (viarange.selectNodeContents
) the same way:I believe there needs to be a way for authors to specify if the Node as a whole should be included in the clipboard, or just its content.
The text was updated successfully, but these errors were encountered: