Closed Bug 105761 Opened 24 years ago Closed 23 years ago

When using cut/copy and paste on text that is part of a link, the pasted text loses the link

Categories

(Core :: DOM: Editor, defect, P1)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: TucsonTester1, Assigned: mozeditor)

Details

(Keywords: topembed-, Whiteboard: EDITORBASE-; FIXINHAND)

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4) Gecko/20011017 Netscape6/6.2 BuildID: 20011017 If you use cut or copy on text that is part of a link, and then paste that text into composer, the text you have pasted will no longer be a link. This only happens if the text you are copying is only a portion of the linked text. If you copy all text that is part of the original link, then the pasted text will still be linked. Reproducible: Always Steps to Reproduce: 1.Open a blank page in composer 2.Click on Link 3.For Link Text, type in Netscape Website 4.For Link Location, type in http://www.netscape.com and click ok 5.Click on Format and select Discontinue link 6.Hit the enter key 7.With mouse, highlight the word Website 8.Hold down control key and click c to copy 9.Click on the second line so the cursor is there 10.Hold down control and click v to paste Actual Results: The pasted text is normal text, it is not linked to www.netscape.com. I tried this in Netscape 4.7, and it is working as expected. Expected Results: I would expect the pasted text to still be linked to netscape.com If you highlight the entire linked text (Netscape Website) and then paste it, the pasted text will still be a link. But you must copy the entire linked text and paste it for the pasted text to still be a link. One note on reproducing this. Step 5 is not necessary to reproduce the actual bug, but depending on how you edit the page, a link can continue to the next line without you telling it to. In which case pasting text to that line would automatically become part of the link. Which might make it look like the bug was not happening.
win98 2001101803 trunk Unable to reproduce exactly as specified... If I make a link "Netscape Website" and select "Website" and paste, the pasted text will be a link. However, if I select "Websit", "etscape Websit", or the like, the pasted text won't be a link; the first or last character has to be included. Also, at step 5., the "discontinue Link" menu item was not available. Close enough still, marking NEW. (reporter, perhaps your link text ended up as "Netscape Website ", i.e. with a space at the end, as the last character?)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Charles, what do you think -- is the 4.7 behaviour correct, or us?
Assignee: syd → cmanske
If it works in 4.7, it's because we made a special case of this situation. Normally, one would not expect a partial selection to include inline attributes, isn't that right, Joe? Brade, JFrancis: Do we want this behavior?
Assignee: cmanske → brade
-->jfrancis
Assignee: brade → jfrancis
Component: Editor: Composer → Editor: Core
Hardware: PC → All
Whiteboard: EDITORBASE
attaching patch
Status: NEW → ASSIGNED
Whiteboard: EDITORBASE → EDITORBASE; FIXINHAND
Target Milestone: --- → mozilla0.9.9
marking EDITORBASE+ per meeting
Whiteboard: EDITORBASE; FIXINHAND → EDITORBASE+; FIXINHAND
Keywords: nsbeta1+
Comment on attachment 65163 [details] [diff] [review] patch to content/base/src/nsDocumentEncoder.cpp sr=kin@netscape.com
Attachment #65163 - Flags: superreview+
Keywords: topembed
Keywords: topembedtopembed+
099 to 1.0; set pri to 1 for these pushed off EB+ bugs
Priority: -- → P1
Target Milestone: mozilla0.9.9 → mozilla1.0
Whiteboard: EDITORBASE+; FIXINHAND → EDITORBASE-; FIXINHAND
Target Milestone: mozilla1.0 → mozilla1.2alpha
The days of having a half dozen milestones out in front of us to divide bugs between seem to be gone, though I dont know why. Lumping everything together as far out as I can. I'll pull back things that I am working on as I go.
Target Milestone: mozilla1.2alpha → mozilla1.2beta
Target Milestone: mozilla1.2beta → M1
Comment on attachment 65163 [details] [diff] [review] patch to content/base/src/nsDocumentEncoder.cpp r=cmanske Looks like a good idea to me!
Attachment #65163 - Flags: review+
Joe: this looks fine - Check it in!
Keywords: nsbeta1-nsbeta1
Target Milestone: M1 → mozilla1.2alpha
Target Milestone: mozilla1.2alpha → M1
fix landed on trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
using trunk build from 2003040308, works fine. Entered some text, selected a word and made it a link. Selected part of the link text, copied and pasted to the end of the line, the pasted text and link came over just fine.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: