|Summary:||text-transform shouldn’t apply when copying text|
|Product:||WebKit||Reporter:||Mathias Bynens <mathias>|
|Severity:||Normal||CC:||ap, aroselli, beidson, code, dauwhe, info, johanneswilm, jwieczorek, kojiishi, mathias, mmaxfield, paulirish, pioupioum, proski, webkit-bug-importer, wraithkenny, xfq.free, zzeligg|
|Version:||528+ (Nightly build)|
Description Mathias Bynens 2010-07-29 11:13:28 PDT
As demonstrated in the test case, when copying text that is uppercased or lowercased through CSS, the text actually gets copied the way it looks after the CSS is applied. All other browsers I tested this in (latest stable releases of Opera, Firefox and IE) just copy the text as written in the HTML source, which makes more sense IMHO.
Comment 2 Jakub Wieczorek 2010-07-29 13:10:37 PDT
This should be fairly simple to fix. Looks like RenderText::textWithoutTranscoding() should not include the text transform. That function is only used in TextIterator so there shouldn't be any side effects of such a change.
Comment 3 Jakub Wieczorek 2010-07-29 13:23:37 PDT
(In reply to comment #2) > This should be fairly simple to fix. Looks like RenderText::textWithoutTranscoding() should not include the text transform. That function is only used in TextIterator so there shouldn't be any side effects of such a change. Actually, it's a bit more complex than I thought.
Comment 4 Alexey Proskuryakov 2012-11-07 16:11:53 PST
*** Bug 101478 has been marked as a duplicate of this bug. ***
Comment 5 Alexey Proskuryakov 2012-11-07 16:13:12 PST
This behavior is intentional per bug 3429. It's not obvious to me which behavior is really preferable.
Comment 6 Ken Newman 2012-11-09 07:29:57 PST
From a web developer's point of view, when I use a text-transform in CSS (as opposed to changing the text of the html source) the intent is pretty clear. I think an approach similar to the copying of color would be more appropriate then modifying the content itself: Copy the style information, and if pasted into a program that understands that data, let it apply its style.
Comment 7 Alexey Proskuryakov 2012-11-09 10:10:45 PST
I prefer to look at this from user's point of view. When I copy text that looks like "ABC", I expect pasted text to look like "ABC". Any other result would be surprising and impossible for me as a user to explain. Unlike color, font family etc, there is no way to preserve text-transform in pasteboard for receiving application to make its own decision. Capitalization is more likely to have semantic meaning than color, so I think that it's correct that platforms don't treat it as part of style.
Comment 8 Ken Newman 2012-11-12 08:55:08 PST
I am also a user. I don't like my browsers altering content to preserve style. I find it surprising and disappointing. From a user point of view, the not-impossible explanation is, "Oh, I guess the shoutiness was just an effect." I won't underestimate the users intelligence or ability to learn from experience... unless of course you nerf their experience. Yes, letter case isn't always style; sometimes it is content. But in those cases I don't use text-transform, and no one should. The only time I (and every other developer I know) ever uses text-transform, is to explicitly declare that the case is ONLY style. I just test the clipboard using the Mac version of Firefox and Mac Mail as the pasting program. The sample text had various variations of text-transfrom, and also font-weight as a control group. I pasted the sample text into the "subject line" and the text appeared without font-weight and without text-transform applied. I then pasted into the message body, and the styles including text-transform where applied. This to me seems the proper behavior. Information regarding text-transform was presented, the pasting program (Mail) decided whether or not to apply the style in different contexts. This shows that the clipboard is capable of preserving this information separately. It's been done.
Comment 9 Alexey Proskuryakov 2012-11-12 12:01:34 PST
> I won't underestimate the users intelligence or ability to learn from experience. Again, there would be no way to know at copying time whether the case would be preserved or not. I appreciate that this is not the case for you when you are copying text from a website you designed yourself, or when you are frequently copying text from the same site, but it's hardly the common case. What a user would be able to learn from experience in normal scenario is that text copying works erratically, and the computer cannot be trusted. > This shows that the clipboard is capable of preserving this information separately. It's been done. This is not something to argue about. If you want to study the inner workings of pasteboard, empirical testing will likely be confusing. You can read Apple's documentation about pasteboard flavors, and/or use an application like Pasteboad Peeker or Pasteboard Inspector to see what is actually inside a pasteboard. FWIW, I cannot replicate your results with OS X 10.8.2 and my own test case, but I don't think that this is important in the context of this bug.
Comment 10 Mathias Bynens 2013-02-26 08:55:45 PST
Eric Bidelman just posted a tweet in all caps because of this bug. https://twitter.com/ebidel/status/306437191956045825 $priority++;
Comment 11 Ken Newman 2013-02-26 17:42:39 PST
(In reply to comment #9) > > I won't underestimate the users intelligence or ability to learn from experience. > > Again, there would be no way to know at copying time whether the case would be preserved or not. I appreciate that this is not the case for you when you are copying text from a website you designed yourself, or when you are frequently copying text from the same site, but it's hardly the common case. I "appreciate" the tone of your response which is condescending. > What a user would be able to learn from experience in normal scenario is that text copying works erratically, and the computer cannot be trusted. > > > This shows that the clipboard is capable of preserving this information separately. It's been done. > > This is not something to argue about. If you want to study the inner workings of pasteboard, empirical testing will likely be confusing. You can read Apple's documentation about pasteboard flavors, and/or use an application like Pasteboad Peeker or Pasteboard Inspector to see what is actually inside a pasteboard. A popular browser figured out how to not alter the content while preserving the styles for pasting. > FWIW, I cannot replicate your results with OS X 10.8.2 and my own test case, but I don't think that this is important in the context of this bug. If you weren't able to replicate my results, try downloading FireFox first. Pasting text-transfromed text into the body of Mac Mail (for example) should appear transformed, and pasting it into the subject line shouldn't.
Comment 12 Charles Bedard 2014-11-14 12:29:02 PST
Stating that users would be confused to the point they won't trust the computer is quite exaggerated. Especially if (all?) other browsers do not behave like that. I actually ended up reading about this issue here because one of my users was complaining of the odd behavior of Webkit when they pasted text-transformed text and asked me if it was possible to have it behave like Internet Explorer and FireFox. I guess user confusion happens no matter what, so it shouldn't be the deciding factor here. If you look at any other CSS property, absolutely none persists within the context of plain text (it's the whole idea behind CSS). Of course, if you paste in a Rich text or HTML context, then CSS formatting should be applied. Clipboard/Pasteboard functionaly has been designed so that data can be represented in different formats. This is precisely what "Paste matching style" on MacOS and "Paste Special..." on Windows do. So I will have to agree with others on this issue and ask that the actual source text (before transformation) be the text copied to the clipboard **when plain text is expected**. It is the destination context which chooses the representation it prefers. The source should not impose a given text transformation.
Comment 13 Pavel Roskin 2015-12-02 23:20:45 PST
Please keep the existing behavior. The website contents comes from different sources. The text author doesn't always have full control over the whole HTML that is served to the user. I'm using a Mediawiki based system at work, and the only way to show the uppercase version of the username is to use text-transform. It is used in step-by-step instructions, and I want users to copy and paste commands to the command line and run them without editing. Chrome users can do it. Firefox users end up with a wrong command (lowercase username). So I decided to report a bug to Firefox (there is one already: https://bugzilla.mozilla.org/show_bug.cgi?id=35148) and found it quite surprising that somebody is questioning the WebKit behavior. Removing all styles is not what users expect. They cannot see all styles on the screen. They can see font variation, color or indentation. But they cannot see if an upper-case letter on the screen was lower-case in the source. If the user decides to copy and paste text, they expect an accurate translation of the screen text to plain text (if the paste target wants plain text). Changing case silently is very unfriendly to the user.
Comment 14 Adrian Roselli 2016-07-07 18:38:37 PDT
Curious if this bug will be addressed. Ideally I'd like to bring it in line with other browsers (IE, Edge, Firefox) and have it copy the unstyled text as it appears in the page source. The presumption is that the raw text is the correct copy, and that styling it to upper case is just that -- style. I wrote a thing on this in 2012 and my own frustrations (and testing examples): http://adrianroselli.com/2012/06/copying-content-styled-with-text.html I also find (anecdotal, I know) that many people who choose to style text as all-caps do so with a corresponding typeface that mitigates the visual harshness or intensity. Copying text with the all-caps style and pasting it into another context, especially lacking a specified typeface, can result in a change in perceived meaning.
Comment 16 Johannes Wilm 2016-10-26 16:02:08 PDT
In today's CSSWG call this was mentioned as an issue and it was agreed that this is a bug (see first https://logs.csswg.org/irc.w3.org/css/2016-10-26/#e736063 ) Also, 4 of 5 JS editor projects see this is a bug that needs to be resolved, see: https://lists.w3.org/Archives/Public/www-style/2016Oct/0124.html (The 5th editor is Ok with data loss when copy/pasting between applications; it uses it's own copy/paste mechanism internally) The same bug has been filed with Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=325231 Further discussion to happen here: https://lists.w3.org/Archives/Public/www-style/2016Oct/0128.html
Comment 17 Sylvain Gamel 2016-11-24 04:39:58 PST
This issie also impact accessibility of web pages. For example, if you get a button "Add to Cart" that is rendered uppercase, then VoiceOver will also spell-out the "Add" word as "A D D". This behavior is quite confusing for blind users and those using screenreaders. You can check the following example with Voice Over enabled on macOS. https://jsfiddle.net/sgamel/qyp5avne/
Comment 18 Alexey Proskuryakov 2016-11-25 00:31:36 PST
If something similar happens with VoiceOver, please file a new bug. That's not the same as pasteboard support.
Comment 19 Anselm Hannemann 2017-03-03 00:05:21 PST
So, is there any conclusion here if this is going to be addressed or not? It’s still marked as "NEW" 7 years after it’s been created. Since the W3C seems to have agreed on this being a false implementation, I’d love to see this fixed at some point, if that helps to motivate some of the WebKit developers here (and I’m happy to buy you a virtual coffee for it). :)
Comment 20 Alexey Proskuryakov 2017-03-03 00:13:40 PST
Anselm, could you please elaborate on your specific scenario where this behavior was undesirable?
Comment 21 Anselm Hannemann 2017-03-03 00:26:16 PST
(In reply to comment #20) > Anselm, could you please elaborate on your specific scenario where this > behavior was undesirable? Of course. To be honest, this applies to every single copy I made in the past years from a web page but let’s focus on the main issue I have with the current behaviour: Open a page that applies text-transform: uppercase to i.e. the author’s name, now copy the text and paste it into another document. You now have a transformed uppercase name in your new document. For me this is never the desired format, so I now need to retype manually the name (which can sometimes be quite challenging) to achieve what is a simple copy/paste action in any other browser despite Chrome and Safari.
Comment 22 Myles C. Maxfield 2017-03-03 14:03:36 PST
We just resolved a few months ago in the CSSWG that text-transform shouldn't apply when copying text.
Comment 23 Koji Ishii 2017-03-05 22:30:19 PST
IIRC, CSS WG didn't, did it?
Comment 24 Koji Ishii 2017-03-08 01:59:11 PST
To give some more context on our discussion in Blink. All people who paste to HTML source files want text-transform not applied, which makes sense. Other people want it applied, which also makes sense. Either way we go, someone will probably file a bug. Here's Gecko bug requesting to apply text-transform: https://bugzilla.mozilla.org/show_bug.cgi?id=35148 I think these two are different use cases and better to support both, but we haven't come to the conclusion yet.
Comment 25 Myles C. Maxfield 2017-03-15 15:46:33 PDT
Here are the relevant threads I can find about it in the W3C: https://lists.w3.org/Archives/Public/www-style/2016Oct/0115.html https://lists.w3.org/Archives/Public/www-style/2016Oct/0130.html The last one states: - RESOLVED: Rich text copy/paste is undefined in text level 3. - Originally the group resolved that plain text copied to the clipboard must (or should) not be affected by text-transform in text 3, but there was an objection from koji so the group will revisit next week. ... but we either didn't revisit it "next" week, or I can't find where we revisited it.
Comment 26 Fuqiao Xue 2018-04-24 01:03:51 PDT
IIUC CSSWG has resolved that text-transform doesn't apply to plain text copy paste now: https://github.com/w3c/csswg-drafts/issues/627
Comment 27 Koji Ishii 2019-04-04 20:02:04 PDT
My formal objection still stands though.