Last Comment Bug 198391 - Copy in view source window inserts not existing empty lines
: Copy in view source window inserts not existing empty lines
Status: RESOLVED FIXED
[fixed by bug 695640]
:
Product: Core
Classification: Components
Component: Serializers (show other bugs)
: Trunk
: x86 All
: -- normal with 7 votes (vote)
: mozilla11
Assigned To: Nobody; OK to take it and work on it
:
: Andrew Overholt [:overholt]
Mentors:
http://www.batory.org.pl/english/hist...
: 198648 312159 356648 396889 495950 649613 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-03-20 06:33 PST by Tomasz Ostrowski
Modified: 2012-01-02 01:57 PST (History)
14 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
inserts new line after every occurrence of "gazeebo" (4.82 KB, text/html)
2003-10-26 08:10 PST, Tom Hatta
no flags Details

Description Tomasz Ostrowski 2003-03-20 06:33:41 PST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

When I copy the source of a page in view source window often I got additional
empty lines when I paste it. It does not matter whether I select all source with
<ctrl-a>, copy it by using <ctrl-c> and paste with <ctrl-v> in textarea in
another window of Mozilla or select a fragment by mouse and paste with
middle-click to another application - both generate this empty lines and both in
the same place.

In the URL I gave for example a line is generated before:
        <p>
        In the 14 years of its existence, the Stefan Batory Foundation has


Reproducible: Always

Steps to Reproduce:
1. Open page: http://www.batory.org.pl/english/history.html
2. View its source
3. Copy the source
4. Paste to another application or any textarea
Actual Results:  
(...)
cross-border projects.  The programs organized in the past 14 years
attracted thousands of influential leaders and opinion makers from CEE,
Baltic and Balkan countries, Caucasus and Central Asia.
   
   
<p>
In the 14 years of its existence, the Stefan Batory Foundation has   
distributed 15,000 grants and scholarships, spending a total of US$80
(...)


Expected Results:  
(...)
cross-border projects.  The programs organized in the past 14 years
attracted thousands of influential leaders and opinion makers from CEE,
Baltic and Balkan countries, Caucasus and Central Asia.

<p>
In the 14 years of its existence, the Stefan Batory Foundation has   
distributed 15,000 grants and scholarships, spending a total of US$80
(...)
Comment 1 Boris Zbarsky [:bz] (still a bit busy) 2003-03-20 08:42:31 PST
Not a viewsource issue....
Comment 2 Bernie Zimmermann 2003-07-20 16:45:23 PDT
I have seen this same issue in Mozilla 1.4 on Windows XP.  If I view the source
of a web page in Mozilla there are all kinds of blank lines thrown in in random
places.  When I view the same source in IE the extra lines are not there.  I'm
curious to know what is causing this.
Comment 3 Tom Hatta 2003-10-26 08:10:26 PST
Created attachment 134172 [details]
inserts new line after every occurrence of "gazeebo"

While the source looks fine in mozilla's source viewer, if you copy/paste it
into another text editor, you will notice that there is an extra new line
inserted after every occurrence of "gazeebo."
Comment 4 Tom Hatta 2003-10-26 08:20:02 PST
> if you copy/paste it into another text editor...

Sorry, I should have been more explicit. I meant to say: "if you copy and paste
all of the html source from Mozilla's source viewer into another text
editor(e.g. Notepad)..."
Comment 5 Bernie Zimmermann 2003-10-26 09:23:33 PST
Tom,

Are you suggesting that you have found the problem, or did you create the
modified testcase after seeing the problem (i.e. changing badger to gazeebo
before any newlines you saw)?  If you have an idea of what's causing the
problem, you should let us know.

Otherwise, the only thing I can surmise from the testcase you provided is that a
newline is being generated after every 18th line of the source.  However, when I
copy and paste the source of another website, it isn't so consistent and seems
more random.  Hmm...
Comment 6 Tom Hatta 2003-10-27 00:50:14 PST
It seems to be the ampersands that are messing it up. Probably related to # 198648.
Comment 7 Lapo Luchini 2004-12-09 06:00:11 PST
I see the same problem on this page:
http://tjl73.altervista.org/xface_PGP.html
The source is signed with an OpenPGP clear signature, but to verify it I must
save&verify, because viewing source, copyting, and verifying the clipboard
content leads to a "BAD sigunature message.
It seems that some empty lines appear sometimes before a <TD> tag.
Comment 8 Masayuki Nakano [:masayuki] (Mozilla Japan) 2005-11-19 23:06:15 PST
*** Bug 312159 has been marked as a duplicate of this bug. ***
Comment 9 Masayuki Nakano [:masayuki] (Mozilla Japan) 2005-11-19 23:08:00 PST
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051119 Firefox/1.6a1

I can repro on Win too.
Comment 10 WADA 2005-11-22 12:21:22 PST
Additional new-line by "Copy&Paste" from "View Page Source" screen is a result of "[CRLF]</pre>" of internal HTML data in "View Page Source" display in many cases.

Try next steps.
 (1) "View Page Source" at this bug's display.
 (2) At "View Page Source" screen
     ( chrome://navigator/content/viewSource.xul?url=https%3A ... %3D198391 )
     - "Select All" thru context menu
     - "View Selection Source" thru context menu
 (3) At "View Selection Source" screen
     ( chrome://navigator/content/viewPartialSource.xul?url=view-source ... )
     You will see '<pre id="line1">...' line and '</pre><id="line15">...' line.

Display of '</pre><id="line15">...' line at step (3) means that the internal HTML data at step (2) is '[CRLF]</pre><id="line15">'.
Because "Copy&Paste" at "View Page Source" screen is extracting of text data of     this HTML, additional new-line appears when 'Copy&Paste'ed at step (2), although displayed screen at step (2) is same as original source text display including line-break.
This additional new-line can be avoided by removing [CRLF] just before '</pre>'.     
Comment 11 Wayne Mery (:wsmwk, NI for questions) 2006-07-18 12:17:26 PDT
*** Bug 198648 has been marked as a duplicate of this bug. ***
Comment 12 :Mook 2006-10-14 03:03:30 PDT
*** Bug 356648 has been marked as a duplicate of this bug. ***
Comment 13 Takeshi Kurosawa 2008-05-24 09:27:16 PDT
*** Bug 396889 has been marked as a duplicate of this bug. ***
Comment 14 Jo Hermans 2009-06-03 01:45:38 PDT
*** Bug 495950 has been marked as a duplicate of this bug. ***
Comment 15 Marat Tanalin | tanalin.com 2012-01-01 11:14:51 PST
It seems this bug is fixed in Firefox 11.0a1 version 2011-12-02-03-10-55-mozilla-central.

Probably fixed during fixing bug 482921, namely changeset 06eab34f121a:
https://hg.mozilla.org/mozilla-central/rev/06eab34f121a
Comment 16 Henri Sivonen (:hsivonen) 2012-01-01 23:45:30 PST
*** Bug 649613 has been marked as a duplicate of this bug. ***
Comment 17 Henri Sivonen (:hsivonen) 2012-01-01 23:48:07 PST
I believe this was fixed by bug 695640.

Note You need to log in before you can comment on or make changes to this bug.