[w3c/clipboard-apis] Clipboard API for text/html serialization and associated style attributes. (Issue #246)

karlcow created an issue (w3c/clipboard-apis#246)

This is a sibling bug of #233 
When copying a piece of html from a Webpage, browsers have different strategies with regards to the CSS serialization values.

* Firefox has the most simplistic style of all.
* Chrome and Safari have similar data for the text/html representations with a couple of differences in terms of CSS.

For example, 
* Chrome carries `background-color` and `color` defined on parents elements. 
* Safari carries only `color`
* Firefox none of these two.

This leads to different rendering when it is time to paste the content in html document which are capturing onPaste for rich editing. 

For example in a scenario where the copy is done on a website with a dark mode where the color will be light and the background dark, Chrome will copy the text with its background which will be displayed as black box with a light text for each paragraphs. You can try in Yahoo! Mail for example, while Safari will copy only the light color text. And Firefox will just take the style of the mail environment. 

Should the minimal CSS properties to be serialized during the copy operation be defined. It could be a list: these properties should be present in the HTML serialization. Or the more extreme case that would be "do not copy any of these properties".

The choice has impact on readability and accessibility.  


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

Message ID: <w3c/clipboard-apis/issues/246@github.com>

Received on Thursday, 20 November 2025 06:17:45 UTC