[csswg-drafts] [css-text-4] text-autospace: what gets copied? (#8511)

fantasai has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-text-4] text-autospace: what gets copied? ==
@r12a wrote in https://github.com/w3c/csswg-drafts/issues/4246#issuecomment-1415841181 :

> Suppose a piece of Japanese text and a piece of French text contains some sentences where ascii spaces are used to create spacing and other sentences where no such space characters are used. Then a content author applied auto-space, let's say for arguments sake with replace switched on. Then a reader copies the text containing gaps. What ends up on the clipboard?
> 
> I'm assuming that the clipboard would contain space characters where they were originally present in the text, but not retain any gaps where the separation was achieved only through applying CSS autospace.
> 
> (In other words, if you copy several paragraphs in French where the original author used autospace to introduce a gap before/after punctuation, then after pasting the text would need to be autospaced or manually edited to reintroduce the gaps.)

We have two types of autospacing:
* inserts gaps that don't correspond to any particular character (inter-script values)
* inserts special spaces (`punctuation` value)

Also, in both cases, the `replace` keyword can remove U+0020 from the text.

In general, CSS doesn't alter the text that gets copied (e.g. `text-transform` is not applied), but we do make at least one exception:
* white space collapsing Phase 1 is applied in order to remove source code formatting characters https://www.w3.org/TR/css-text-3/#plaintext

There's also a bit of an open question on whether the `content` property should affect copy/paste. It thought we'd discussed this, but can't find it...

It's pretty clear to me that the first type of autospacing doesn't insert anything into the copied text. However, for the removal of U+0020 or insertion of nbsp and narrow no-break space, etc, are these copied into the paste buffer?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8511 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 28 February 2023 22:31:23 UTC