[文本转换属性以前没有以大写形式复制,但是,我在Mac上的Chrome版本78.0.3904.108(正式版本)(64位)中注意到,文本现在以大写形式复制。
已转换的文本:
.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>
然后我尝试在Mac上的Firefox 70.0.1(64位)中复制相同的转换后的文本,但仍然有旧的行为。
这是Chrome的新功能还是意外的错误?
我们依靠此功能来控制我们网站上的某些行为,有没有办法强制执行旧的行为?
这个问题实际上已经很老了,早在2010年filed in the Chromium project。
2018年the CSS working group decided:
工作组刚刚讨论了有关复制/粘贴的文本转换,并同意以下决议:
RESOLVED: text-transform doesn't apply to plain text copy paste
因此,该行为可以视为错误,您可以投票支持更快速的修复。尽管Chromium开发人员已经知道CSS工作组的决定。