Skip to content

Clipboard API for text/html serialization and associated style attributes. #246

@karlcow

Description

@karlcow

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions