Closed
Bug 35148
Opened 24 years ago
Closed 6 years ago
copying style="text-transform: uppercase;" doesn't preserve transformation when pasting as text
Categories
(Core :: DOM: Serializers, enhancement)
Core
DOM: Serializers
Tracking
()
RESOLVED
WONTFIX
Future
People
(Reporter: jruderman, Unassigned)
References
Details
(Keywords: testcase)
Attachments
(1 file)
250 bytes,
text/html
|
Details |
On <URL:resource:/res/samples/test0.html>, try copying the first few lines of to the "text styles" section. It copies them without applying the text transformation. (Is that intended behavior? IE does it like that too.)
Comment hidden (obsolete) |
Comment 2•24 years ago
|
||
This refers to constructs like the following: <SPAN style="text-transform: capitalize;"> this text was capitalized å è </SPAN> Yes, this would be my bug. We don't guarantee anything about preserving style in copy/paste ... but in this particular case, where style is inline in the span tag, it seems like it would be easy to do. No guarantees, but I'll check in a quick fix if I find one, otherwise helpwanted.
Keywords: helpwanted
Target Milestone: --- → M20
Updated•24 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•24 years ago
|
Status: NEW → ASSIGNED
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment 7•24 years ago
|
||
Are you all *sure* this isn't 'invalid'? In my opinion, it should be.
Comment 8•24 years ago
|
||
I don't think it's invalid -- it would be nice to be able to copy the style, perhaps optionally based on the input flags. But it's also a pie-in-the-sky RFE. Handing off to anthonyd, who is taking over Output bugs.
Assignee: akkana → anthonyd
Status: ASSIGNED → NEW
Reporter | ||
Comment 9•24 years ago
|
||
See also bug 39098, which wants invisible elements to not be copied.
Comment hidden (obsolete) |
Comment 12•22 years ago
|
||
Comment hidden (off-topic) |
Reporter | ||
Updated•16 years ago
|
OS: Windows 98 → All
Hardware: PC → All
Updated•15 years ago
|
QA Contact: tpreston → selection
Comment 15•10 years ago
|
||
STR |
Since we preserve inline styles when pasting in HTML context, I'm clarifying (morphing?) this to be about HTML->Text conversion case: 1. Open the attached testcase https://bugzilla.mozilla.org/attachment.cgi?id=99514 2. Select all, copy 3. Switch to a plain text editor, paste Expected results: "UPPERCASED TEXT" pasted Actual results: "Uppercased text" pasted
Assignee: kinmoz → nobody
Component: Selection → Serializers
Keywords: helpwanted
Priority: P3 → --
Summary: copying style="text-transform: uppercase;" doesn't preserve transformation → copying style="text-transform: uppercase;" doesn't preserve transformation when pasting as text
Comment 16•9 years ago
|
||
I believe the existing behavior is not user-friendly. Users expect that Firefox would preserve the text that they see on the screen. Arguments that web developers could use capitalized text don't always apply. The reason I'm writing here is because I'm trying to put instructions to a Mediawiki based system that should include capitalized username, and I have no other way to do it apart from using styles. If Firefox users cut and paste my instructions to the command line, they would end up running a wrong command. Chrome and other Webkit based browsers do the right thing. This is the fixed bug for Webkit https://bugs.webkit.org/show_bug.cgi?id=3429 Attempts to reverse that behavior have not been met with enthusiasm: https://bugs.webkit.org/show_bug.cgi?id=43202
Comment 17•8 years ago
|
||
I encourage you to retain the existing behavior. The presumption is that the raw text is the correct copy, and that styling it to upper case is just that -- style. When I copy text and paste it into a text editor, it sheds all style, and text case should be part of that. I wrote a thing on this in 2012 and my own frustrations with how WebKit behaves (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 18•8 years ago
|
||
Although text-transform is part of the "style"sheet, it is not stylistic in the same way that say, bold or italics are. Text case is clear semantic information about the plain text, and can even change the grammatical meaning of the sentence. Also, without inspecting the HTML of the document there is no visible difference between 'UPPERCASE' and '<span style="text-transform:uppercase;">uppercase</span>', so the user can't possible expect them to copy as different text.
Comment 19•8 years ago
|
||
Not also that as of FF 45, the Node.innerText property has been implemented which returns upper case text for text-transform:uppercase, as does WebKit/Blink. According to MDN, Node.innerText "approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied to the clipboard." - so the clipboard should behave like Node.innerText.
Updated•8 years ago
|
Keywords: dev-doc-needed
Comment 20•6 years ago
|
||
CSSWG has resolved that text-transform doesn't apply to plain text copy paste: https://github.com/w3c/csswg-drafts/issues/627
Comment 21•6 years ago
|
||
And the spec text has now been changed: https://github.com/w3c/csswg-drafts/pull/3107/files
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: in-testsuite?
Resolution: --- → WONTFIX
Updated•6 years ago
|
Keywords: dev-doc-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•