Bug 1967510 Comment 11 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Edgar Chen [:edgar] from comment #7)
> Okay, although the content in system clipboard is different, but Gecko still returns an empty string for `getData('text/html');`, so it looks like the widget code is handling the conversion. From the Web API point of view, our behavior is actually the same as Safari’s.

Oh, this is macOS-only behavior, since only macOS return the data in clipboard cache; other platforms return whatever data is currently in the system clipboard.

So there are two things here,
1). We always wrap string with HTML tags for HTML type when copying, even if the string is empty.
2). Other browser's editors fall back to using `text/plain` data if `text/html` is an empty string.
(In reply to Edgar Chen [:edgar] from comment #7)
> Okay, although the content in system clipboard is different, but Gecko still returns an empty string for `getData('text/html');`, so it looks like the widget code is handling the conversion. From the Web API point of view, our behavior is actually the same as Safari’s.

Oh, this is macOS-only behavior, since only macOS uses the data from clipboard cache; other platforms return whatever data is currently in the system clipboard.

So there are two things here,
1). We always wrap string with HTML tags for HTML type when copying, even if the string is empty.
2). Other browser's editors fall back to using `text/plain` data if `text/html` is an empty string.

Back to Bug 1967510 Comment 11