-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-text] behavior of copy/paste with text-transform #627
Comments
If we’re serious about the separation of content and style, The same is true, however, for |
I don't think it is so much about the separation of content and style, as it about the fact that you cannot preserve style separately from content when going plain text, and therefore having to make compromises. Since they are compromises, it is expected that there will be some tension between various desirable goals: discard as little information/semantics as possible, don't surprise the user, provide the most useful behavior... A general principle is to make the output look similar to the input to avoid surprises and confusion. This suggests that taking the On the other hand, breaking away from that generic principle can be justified by looking in to specific scenarios where a property is used, and see if in practice, it is more useful to discard the property than to preserve it. This is the argument that is being made against
Unless more use cases are found that sway the argument the other way, it seems to me that the conclusion should either be "up the the UA" or "don't preserve text-transform". There are some cases where some users would prefer for it to be preserved, so leaving it up to the UA may be reasonable, but in most cases, the opposite is true, so if we're going to specify the behavior one way, it should be in favor of not preserving. Polling of the CSSWG showed a roughly even split between these two options, with browsers representative mostly preferring "up to the UA", and others mostly prefering "don't preserve". |
My point was that CSS UAs should not mess with characters upon sending something to the OS clipboard, because the receiving end may well be capable of handling all the style information originally expressed in CSS and its user may want to deactivate or change some of it and since the effects of It’s out of scope of CSS what the OS does to copied styled text. It’s also out of scope of CSS what applications that receive the clip from the OS do to the text prior to pasting it in. Basically the same applies if the sending and receiving apps communicate directly with each other – and the C&P operation can of course also happen within a single piece of software. Browsers, however, have to deal with pasting styled content into both, plain and rich text environments. They may employ custom styled-to-rich-text methods and that is where |
We were not discussing what happens to copy-pasting as rich text, but copy-pasting as plain text. |
Perhaps I don’t know how system clipboards actually work, but the UX issue faced here is only in pasting! It should have nothing to do with copying, no matter whether rich text or plain text. A browser should copy styled text verbatim (without character transformations) and the OS or the receiving application can then apply some irreversible changes if they know how and that users expectat this. CSS is the wrong place to “fix” it. I’m trying to show that your “arguments go both ways” bullet points are actually also “not preserving is better”. |
I collected issues we're aware of, from http://crbug.com and our user forum. Given the @gregwhitworth request, this list isn't limited to
The |
On 23 October 2016 at 20:34, Christoph Päper notifications@github.com
E.g. a user may expect uppercase text to be pasted as uppercase, they One idea came to my mind right now. What if we handled the clipboard as h2 { @media clipboard { This would even allow further modifications like e.g. resizing or hiding Sebastian |
Interesting, that's a very creative approach. Supposedly that would only apply to plain-text clipboard, and the rich text version of the clipboard would be unaffected, since by the time you paste it it is no longer in the clipboard, right? I don't know if I like this. I gives control to the author about what may rather be a user preference. But then again it can enable the author to tell separate some use cases ( |
I just saw that my previous example was wrong. It should actually have been: h2 {
text-transform: uppercase;
}
@media clipboard {
h2 {
text-transform: none;
}
}
I thought it would affect both, so the @media clipboard("text/plain") {
h2 {
text-transform: none;
}
}
@media clipboard("text/html") {
h2 {
text-transform: none;
}
} While this approach allows the web author to control the styling of the clipboard data, UAs still need to provide proper defaults. And that's still the hard part. Because a 'clipboard' media type is independent from this discussion, I've filed issue #648 to discuss it separately. Sebastian |
Having a @media clipboard makes me (as an implementor) nervous. It implies that the UA needs to do a complete style resolution/layout on Copy to get the correct data for the clipboard. |
The Working Group just discussed
The full IRC log of that discussion<fantasai> Topic: text-transform on copy/paste<fantasai> https://drafts.csswg.org/css-text-3/issues-lc-2013#issue-108 <dael> github: https://github.com//issues/627 <dael> myles: I've since flip-flopped. Last time I said itext-transform should apply to copy paste, but I've changed. <dael> fantasai: Prop: text-transform doesn't apply to plain text copy paste <dael> fremy: There could only be manual tests. <dael> RESOLVED: text-transform doesn't apply to plain text copy paste <dael> fantasai: If I say :firstline text-transform: uppercase if I copy paste that to a text document. <dael> koji: I have internal feedback that we have different behavior then spec. <dael> fantasai: inner text or html? <dael> koji: Don't remember. <dael> fantasai: I think applying text-transform is seriously problematic. Because you lose information when you copy out that text. <dael> koji: It's not my opinion. I'm trying to find what they define. <dael> myles: Maybe look at the end. <dael> plinss: If they're defining how text-transform works they shouldnt do that. <myles> s/myles: Maybe look at the end.// <dael> florian: They apply to inner text. <dael> koji: It says [reads] <koji> From the HTML spec: If node is a Text node, then for each CSS text box produced by node, in content order, compute the text of the box after application of the CSS 'white-space' processing rules and 'text-transform' rules <dael> TabAtkins: inner text is not the same as inner html. inner text takes weird css already. <dael> tantek: so it's weird legacy and don't build on it. <dael> fantasai: There's many things wrong with that spec text. We shouldn't build on that. <dael> astearns: Given that inner text isn't a precedent should we resolve? <dael> koji: He wanted to object, JS editors use inner text and want to be same as copy behavior. <dael> florian: plain text copy? <dael> koji: They're using plain text. <dael> astearns: I am inclined to unles syou object have us resolve in this way and let editors come back with spec bug or objection in the issue. <dael> astearns: Is that okay? <dael> koji: [nods] <dael> fremy: I don't know what edge is doing but we won't change for what the spec says. I think the spec says what Edge is doing. We try very hard to work. I'm fine resolving because I'm pretty sure we match. <dael> fantasai: Am i putting this in the spec? <dael> astearns: I'm hearing no objections. fremy says he may keep a bug against the text. <dael> fremy: I don't think copy/paste should be in scope of CSS. If you want it in CSS that's fine. <dael> astearns: WE have 2 options. ! is state that text-transform doesn't effect plain copy/paste and other is be silent in spec. <rego> it seems Edge is doing what's resolved (not applying text-transform on copy&paste) :) <dael> koji: Thier opinion is not to define. <dael> astearns: How about a non-normative note that we beileve it should not apply to plain text paste but we're not sure it's web compat. <dael> fremy: We don't apply. <dael> fantasai: This isn't an issue raised from WG and people posted to www-style unhappy that some browsers have this behavior. <dael> koji: For chrome we have a bug saying don't apply. I believe FF has bugs saying apply. <dael> myles: Hearing 2 things. Everyone with opinions believe same on issue. I'm also hearing we don't have juristidction to say it. <dael> astearns: That's my non-normative note. <dael> florian: Let's say it. <dael> astearns: So we should say it. <fantasai> s/to say it/to say it. So we should just say it./ <dael> tantek: We have interop. <dael> astearns: Objections to normative stating that text-transform does not apply to plain text paste. <dael> RESOLVED: normative state that text-transform does not apply to plain text paste. |
…not preserve text-transform, a=testonly Automatic update from web-platform-tests [css-text] plain-text copy & paste does not preserve text-transform This is a test for w3c/csswg-drafts#627 -- Merge pull request #13428 from frivoal/text-627 [css-text] plain-text copy & paste does not preserve text-transform -- wpt-commits: 176d04ddd933ec150424b7f2c923ad6c4519b618, e13446ad8a47fa1643f3afa987d0da950822023b wpt-pr: 13428
…not preserve text-transform, a=testonly Automatic update from web-platform-tests [css-text] plain-text copy & paste does not preserve text-transform This is a test for w3c/csswg-drafts#627 -- Merge pull request #13428 from frivoal/text-627 [css-text] plain-text copy & paste does not preserve text-transform -- wpt-commits: 176d04ddd933ec150424b7f2c923ad6c4519b618, e13446ad8a47fa1643f3afa987d0da950822023b wpt-pr: 13428
…not preserve text-transform, a=testonly Automatic update from web-platform-tests [css-text] plain-text copy & paste does not preserve text-transform This is a test for w3c/csswg-drafts#627 -- Merge pull request #13428 from frivoal/text-627 [css-text] plain-text copy & paste does not preserve text-transform -- wpt-commits: 176d04ddd933ec150424b7f2c923ad6c4519b618, e13446ad8a47fa1643f3afa987d0da950822023b wpt-pr: 13428
…not preserve text-transform, a=testonly Automatic update from web-platform-tests [css-text] plain-text copy & paste does not preserve text-transform This is a test for w3c/csswg-drafts#627 -- Merge pull request #13428 from frivoal/text-627 [css-text] plain-text copy & paste does not preserve text-transform -- wpt-commits: 176d04ddd933ec150424b7f2c923ad6c4519b618, e13446ad8a47fa1643f3afa987d0da950822023b wpt-pr: 13428
…not preserve text-transform, a=testonly Automatic update from web-platform-tests [css-text] plain-text copy & paste does not preserve text-transform This is a test for w3c/csswg-drafts#627 -- Merge pull request #13428 from frivoal/text-627 [css-text] plain-text copy & paste does not preserve text-transform -- wpt-commits: 176d04ddd933ec150424b7f2c923ad6c4519b618, e13446ad8a47fa1643f3afa987d0da950822023b wpt-pr: 13428 UltraBlame original commit: 58591a07b651876435553a897df5d6592ca1e5e5
…not preserve text-transform, a=testonly Automatic update from web-platform-tests [css-text] plain-text copy & paste does not preserve text-transform This is a test for w3c/csswg-drafts#627 -- Merge pull request #13428 from frivoal/text-627 [css-text] plain-text copy & paste does not preserve text-transform -- wpt-commits: 176d04ddd933ec150424b7f2c923ad6c4519b618, e13446ad8a47fa1643f3afa987d0da950822023b wpt-pr: 13428 UltraBlame original commit: 740eefb87a454562ba9572fd09a2b00716527a47
…not preserve text-transform, a=testonly Automatic update from web-platform-tests [css-text] plain-text copy & paste does not preserve text-transform This is a test for w3c/csswg-drafts#627 -- Merge pull request #13428 from frivoal/text-627 [css-text] plain-text copy & paste does not preserve text-transform -- wpt-commits: 176d04ddd933ec150424b7f2c923ad6c4519b618, e13446ad8a47fa1643f3afa987d0da950822023b wpt-pr: 13428 UltraBlame original commit: 58591a07b651876435553a897df5d6592ca1e5e5
…not preserve text-transform, a=testonly Automatic update from web-platform-tests [css-text] plain-text copy & paste does not preserve text-transform This is a test for w3c/csswg-drafts#627 -- Merge pull request #13428 from frivoal/text-627 [css-text] plain-text copy & paste does not preserve text-transform -- wpt-commits: 176d04ddd933ec150424b7f2c923ad6c4519b618, e13446ad8a47fa1643f3afa987d0da950822023b wpt-pr: 13428 UltraBlame original commit: 740eefb87a454562ba9572fd09a2b00716527a47
…not preserve text-transform, a=testonly Automatic update from web-platform-tests [css-text] plain-text copy & paste does not preserve text-transform This is a test for w3c/csswg-drafts#627 -- Merge pull request #13428 from frivoal/text-627 [css-text] plain-text copy & paste does not preserve text-transform -- wpt-commits: 176d04ddd933ec150424b7f2c923ad6c4519b618, e13446ad8a47fa1643f3afa987d0da950822023b wpt-pr: 13428 UltraBlame original commit: 58591a07b651876435553a897df5d6592ca1e5e5
…not preserve text-transform, a=testonly Automatic update from web-platform-tests [css-text] plain-text copy & paste does not preserve text-transform This is a test for w3c/csswg-drafts#627 -- Merge pull request #13428 from frivoal/text-627 [css-text] plain-text copy & paste does not preserve text-transform -- wpt-commits: 176d04ddd933ec150424b7f2c923ad6c4519b618, e13446ad8a47fa1643f3afa987d0da950822023b wpt-pr: 13428 UltraBlame original commit: 740eefb87a454562ba9572fd09a2b00716527a47
This is issue 108 in the disposition of comments. There's a www-style thread. Flattened version here.
There are several browser bugs:
Webkit: https://bugs.webkit.org/show_bug.cgi?id=43202
Webkit: https://bugs.webkit.org/show_bug.cgi?id=3429
Mozilla : https://bugzilla.mozilla.org/show_bug.cgi?id=35148
Consensus has eluded us over at least sixteen years. On the call yesterday, we decided to gather more information from the larger community on what to do.
The text was updated successfully, but these errors were encountered: