Open Bug 1841058 Opened 2 years ago Updated 25 days ago

Ensure each platform behave consistently on setting clipboard with empty transferable or empty string

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect, P3)

defect

Tracking

()

People

(Reporter: edgar, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: webcompat:platform-bug)

  • Check each platform's behavior.
  • Write a test for this case.
Summary: Ensure each platform behave consistently on setting clipboard with empty transferable → Ensure each platform behave consistently on setting clipboard with empty transferable or empty string
See Also: → 1852783
Blocks: 1967510

We also discovered a compatibility issue with the text/html type: we always wrap text/html data in HTML tags when copying, even if the data is an empty string. In contrast, Chrome ignores the empty string entirely, and Safari simply writes the empty string to the clipboard without wrapping it. (See bug 1967510 comment 11 for details.)

Since we don't ignore empty strings for the text/plain type, I think it makes more sense not to ignore them for the text/html type either, for consistency. Instead, we should follow Safari's behavior and write the empty string without wrapping it in HTML tags.

You need to log in before you can comment on or make changes to this bug.