Closed
Bug 77522
Opened 25 years ago
Closed 24 years ago
Newlines in links should be stripped when selecting "Copy Link Location"
Categories
(Core :: DOM: Serializers, defect)
Core
DOM: Serializers
Tracking
()
VERIFIED
FIXED
mozilla1.0
People
(Reporter: bugzilla, Assigned: t_mutreja)
References
Details
(Whiteboard: DUPEME [NC][correctness][paste][has-super-review][needs a=])
Attachments
(2 files, 2 obsolete files)
|
44 bytes,
text/html
|
Details | |
|
940 bytes,
patch
|
asa
:
approval+
|
Details | Diff | Splinter Review |
if you have the following in a webpage:
<a href="http://www.
gemal.dk">gemal.dk</a>
that's a newline inside a link, the newline should be killed/stripped when you
rightclick on the link and selecting "Copy Link Location"
build 20010424 on win2k
| Reporter | ||
Comment 1•25 years ago
|
||
| Reporter | ||
Comment 2•25 years ago
|
||
testcase created. When you move the cursor over the link the status bar says:
"http://www.gemal.dk" but if you rightclick on it and select "Copy Link
Location" and paste it into the "Location" field you only get "http://www."
Comment 3•25 years ago
|
||
confirmed with build 2001042504 on W2K
Updated•25 years ago
|
Keywords: helpwanted
Target Milestone: --- → mozilla1.0
here is the issue with this bug, we generally dont want to change data when we
copy it. pasting is another story, because pasting is always context sensitive.
so I can see wanting to remove the new line when pastinglinks into our app, but
certainly not on the copy. changing status whiteboard to reflect this.
anthonyd
cc'ing pinkerton as he knows a lot about pasting, also, i dont really see how
this is an editor bug.
Whiteboard: [correctness][copy] → [NC][correctness][paste]
Comment 6•25 years ago
|
||
the bug belongs to the presShell DoCopy owner. if all the data isn't being put on
the clipboard, there's nothing the toolkit can do about it.
also another conclusion pink and I cam to was that copying a link location is
not the same thing as copying other text or data. there is no need or
expectation to preserve the content mode/layout. there is no real good reason
why when pasting a link we dont strip out a newline.
anthonyd
Comment 8•25 years ago
|
||
newlines should be stripped on copy; I don't expect to get two lines when copying
a url from the urlbar and pasting it into notepad or wherever.
The URL bar needing to strip newlines on paste is a separate bug.
This bug is probably a serializer bug and should go to the module owner for DOM
to Text Conversion.
However, this particular case is probably that we shouldn't be storing the links
with spaces/cr/lf in them. I believe there is a bug for clicking on these links
(which won't work either) that this should be duplicated against.
dr wrote the Copy Link Location and related methods in the presshell.
Let's see if jst knows the bug I am talking about and can dup this bug.
Assignee: brade → jst
Whiteboard: [NC][correctness][paste] → DUPEME [NC][correctness][paste]
Comment 9•25 years ago
|
||
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1
(you can query for this string to delete spam or retrieve the list of bugs I've
moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
| Assignee | ||
Comment 10•24 years ago
|
||
Attaching the patch for fixing this bug. It checks and removes whitespaces(if
any) in the URL, while copying itself.
Comment 11•24 years ago
|
||
I hope this doesn't remove %20 from the URL's, because a lot of windows URLs
contain whitespace in them (in mozilla they have to be indicated as %20 or
something like that)
Comment 12•24 years ago
|
||
I have the same concern as Fabian. Tanu, can you see what happens with your
patch in the case of links that contain spaces inside them. You might need to
modify your patch such that only newlines and tabs are stripped, not spaces.
Re-assigning this bug to you. Thanks for jumping in on this!
Assignee: jst → tmutreja
Comment 13•24 years ago
|
||
Don't we already have code that deals with stripping whitespace when you click
on a link? Couldn't that code be reused here?
| Assignee | ||
Comment 14•24 years ago
|
||
Updating the fix for removing only tabs, cr and lf.
Updated•24 years ago
|
Keywords: helpwanted → patch
Whiteboard: DUPEME [NC][correctness][paste] → DUPEME [NC][correctness][paste][patch needs r/sr=]
| Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Target Milestone: mozilla1.0.1 → mozilla1.0
Comment 16•24 years ago
|
||
Comment on attachment 64662 [details] [diff] [review]
Modified Patch.
sr=jst if you make |strippedChars| static.
Comment 17•24 years ago
|
||
Comment on attachment 64662 [details] [diff] [review]
Modified Patch.
sr=jst if you make |strippedChars| static.
Attachment #64662 -
Flags: superreview+
| Assignee | ||
Comment 18•24 years ago
|
||
Changed |strippedChars| to be static.
Attachment #64511 -
Attachment is obsolete: true
Attachment #64662 -
Attachment is obsolete: true
| Assignee | ||
Updated•24 years ago
|
Whiteboard: DUPEME [NC][correctness][paste][patch needs r/sr=] → DUPEME [NC][correctness][paste][has-super-review][needs r=/a=]
Comment 19•24 years ago
|
||
Comment on attachment 64662 [details] [diff] [review]
Modified Patch.
r=harishd
Attachment #64662 -
Flags: review+
This
static char strippedChars[] = {'\t','\r','\n'};
could also be written as
static char strippedChars[] = "\t\r\n";
I believe. But no biggie.
| Assignee | ||
Updated•24 years ago
|
Whiteboard: DUPEME [NC][correctness][paste][has-super-review][needs r=/a=] → DUPEME [NC][correctness][paste][has-super-review][needs a=]
Comment 21•24 years ago
|
||
Comment on attachment 72947 [details] [diff] [review]
Including jst's comments...
a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #72947 -
Flags: approval+
Comment 22•24 years ago
|
||
Fixed with checkin
D:\mozilla\layout\html\base\src>cvs commit
cvs commit: Examining .
Checking in nsPresShell.cpp;
/cvsroot/mozilla/layout/html/base/src/nsPresShell.cpp,v <-- nsPresShell.cpp
new revision: 3.517; previous revision: 3.516
done
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
(In reply to comment #20)
> This
>
> static char strippedChars[] = {'\t','\r','\n'};
>
> could also be written as
>
> static char strippedChars[] = "\t\r\n";
>
> I believe. But no biggie.
Actually, it is. See bug 377392.
You need to log in
before you can comment on or make changes to this bug.
Description
•