Open Bug 576431 Opened 10 years ago Updated 10 years ago

line breaks from HTML source appear in selection (when pasted) for application/xhtml+xml

Categories

(Core :: DOM: Selection, defect)

defect
Not set
normal

Tracking

()

UNCONFIRMED

People

(Reporter: vincent-moz, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6

When one selects text from some web pages, copy it, and paste it in a terminal or text editor (e.g. Emacs), extraneous line breaks appear. These line breaks come from the HTML source. This behavior is incorrect because line breaks in text from HTML source are interpreted as normal white space for rendering.

Reproducible: Always

Steps to Reproduce:
1. Open the above URL.
2. Select all the text.
3. Paste the selection in a terminal or text editor (such as Emacs).
Actual Results:  
The pasted text is:

Paragraph with
two line breaks in
the HTML source.


Paragraph without line breaks in the HTML source.

Expected Results:  
The pasted text should be:

Paragraph with two line breaks in the HTML source.

Paragraph without line breaks in the HTML source.

This is the first time I see such a problem. Maybe a regression.

This problem doesn't occur on all the pages with line breaks, but when it occurs, it occurs every time.
Here's the testcase as an attachment.
Attachment #455601 - Attachment mime type: text/html → application/xhtml+xml
I now understand why the problem doesn't always occur: it occurs when the page is served as application/xhtml+xml, but not when it is served as text/html.
Summary: line breaks from HTML source appear in selection (when pasted) → line breaks from HTML source appear in selection (when pasted) for application/xhtml+xml
Same problem with Iceweasel (Debian's Firefox) 3.5.10 under Linux (Debian).
OS: Mac OS X → All
Hardware: PowerPC → All
You need to log in before you can comment on or make changes to this bug.