Closed Bug 572543 Opened 14 years ago Closed 13 years ago

Copying from XHTML table doesn't add line breaks

Categories

(Core :: DOM: Serializers, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 515464
Tracking Status
blocking2.0 --- -

People

(Reporter: jruderman, Assigned: laurent)

References

Details

Attachments

(1 file)

When I copy from about:memory, I get a yucky blob.  Isn't the to-text serializer supposed to add line breaks based on tables?

	malloc/allocated109,452,688malloc/mapped242,163,712malloc/zone0/committed109,502,512malloc/zone0/allocated241,115,136storage/sqlite32,782,672images/chrome/used/raw0images/chrome/used/uncompressed537,380images/chrome/unused/raw0images/chrome/unused/uncompressed0images/content/used/raw0images/content/used/uncompressed3,037,627images/content/unused/raw0images/content/unused/uncompressed4,096layout/all3,246,057layout/bidi3,358gfx/surface/image3,348,464
It is, but the markup isn't really a table.  If you look at it, each <tr> node in the DOM has an <abbr> child followed by a <td> child.  It renders as a table due to the way CSS anonymous table objects work, but the serializer isn't really sure what to do with this goop.  Should it be?
Whoops, that's missing a <td> around the abbr, isn't it..
(In reply to comment #1)
> It is, but the markup isn't really a table.  If you look at it, each <tr> node
> in the DOM has an <abbr> child followed by a <td> child.  It renders as a table
> due to the way CSS anonymous table objects work, but the serializer isn't
> really sure what to do with this goop.  Should it be?

Maybe it should... If users see something as a table, the serializer better treat it as one!

(In reply to comment #2)
> Whoops, that's missing a <td> around the abbr, isn't it..

Yes, it is.
> If users see something as a table, the serializer better treat it as one!

Does the serializer generally take into account style or frame information?
I have no idea.  I thought that nsPlainTextSerializer is responsible for this, but I couldn't get a breakpoint in any of our serializers hit...
Odd. Can you start with nsHTMLCopyEncoder::EncodeToString and see whether that's hit and what it does?
I could do that, yes.  I'll try to spend some time on this on a weekend, given the assumption that I don't forget about it...
Split the about:memory DOM tree bug into bug 572957.
Summary: Copying about:memory table doesn't add line breaks → Copying from a messy table (with anonymous table frames) doesn't add line breaks
Even with a patch for bug 572957, I still don't get line breaks!  I suspect the problem is that the document is XHTML, and the missing <td> was a distraction.
Hrm.  Indeed, that sucks....
Summary: Copying from a messy table (with anonymous table frames) doesn't add line breaks → Copying from XHTML table doesn't add line breaks
But not enough to block!
blocking2.0: ? → -
It appears that this bug is because of the patch of bug 524975. I had to backout it but I forgot it.
Assignee: nobody → laurent
Depends on: 524975
This reproduces in FireFox 4b12.
Go to about:support, select the Hardware Acceleration table at the bottom, press Ctrl+C, open Notepad, press Ctrl+V - One line of text with no spaces between the cells/new lines between the rows.
Related/duplicated issues -
https://bugzilla.mozilla.org/show_bug.cgi?id=638439
https://bugzilla.mozilla.org/show_bug.cgi?id=137450
https://bugzilla.mozilla.org/show_bug.cgi?id=237546
https://bugzilla.mozilla.org/show_bug.cgi?id=303736
https://bugzilla.mozilla.org/show_bug.cgi?id=515464
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: