Search code examples
cssgoogle-chromeuser-experience

Text transformed using the CSS property text-transform:uppercase copying as uppercase in chrome. Is this a new feature or a bug in chrome?


Text transform property did not used to copy as uppercase, however, I've noticed in Chrome Version 78.0.3904.108 (Official Build) (64-bit) on Mac, the text now copies as upper case.

transformed text:

.lowercase {text-transform: lowercase; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }



hr { margin: 2.5em 0; }
<p><strong>text-transform: lowercase;</strong></p>
<p class="lowercase">THIS WILL BE TRANSFORMED TO LOWERCASE.</p>
<hr>
<p><strong>text-transform: uppercase;</strong></p>
<p class="uppercase">this will be transformed to uppercase.</p>
<hr>
<p><strong>text-transform: capitalize; </strong></p>
<p class="capitalize">This will be transformed to capitalize all words, including both parts of this hyphenated word: double-parked.</p>
<p class="capitalize">"These words are in 'quotes'."</p>
<p class="capitalize">This text includes a date: February 4th, 2015.</p>
<p class="capitalize">This text includes an acronym: CSS.</p>

I then tried copying the same transformed text in Firefox 70.0.1 (64-bit) on Mac and it's still got the old behaviour.

Is this a new Chrome feature or an unintended bug?

We rely on this feature to control certain behaviour on our website, is there a way to enforce the old behaviour?


Solution

  • The issue is actually quite old and was filed in the Chromium project back in 2010.

    In 2018 the CSS working group decided:

    The Working Group just discussed text-transform on copy/paste, and agreed to the following resolutions:

    RESOLVED: text-transform doesn't apply to plain text copy paste

    So, the behavior can be treated as a bug and you may vote for a quicker fix. Although the Chromium developers are already aware of the CSS working group decision.