Closed Bug 1555687 Opened 6 years ago Closed 6 years ago

Pasting table into HTMLEditor inserts all cells in one row

Categories

(Core :: DOM: Serializers, defect)

68 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1433073

People

(Reporter: ezh, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

Attached image Example

Since FF66b(?) there is a major regression in copying tables to composion window.

FF copies it as a table to a Notepad:
ACANA Heritage 25 Dog Puppy & Junior 11,4kg 064992500115 45.5000 54.60 64.00 71.00 33
ACANA Heritage 25 Dog Puppy & Junior 17kg 064992500177 53.6500 64.38 93.00 98.00 5
ACANA Heritage 25 Dog Puppy & Junior 2kg 064992500207 14.8000 17.76 21.00 23.00 43

But pastes it fo a form as a row:
ACANA Heritage 25 Dog Puppy & Junior 11,4kg 064992500115 45.5000 54.60 64.00 71.00 33 ACANA Heritage 25 Dog Puppy & Junior 17kg 064992500177 53.6500 64.38 93.00 98.00 5 ACANA Heritage 25 Dog Puppy & Junior 2kg 064992500207 14.8000 17.76 21.00 23.00 43

Reproducing:

  1. https://support.hp.com/ee-en/document/c06190211
    CTRL-select the table

  2. Paste into some WYSIWYG HTML editor

Same Thunderbird bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1555605

Component: General → Editor
Flags: needinfo?(masayuki)
Product: Firefox → Core
Component: Editor → Serializers
Flags: needinfo?(masayuki)

Ah, misunderstood comment 0. Indeed, sounds like editor's.

Component: Serializers → Editor

Alice-san, could you find a regression range? You can paste it into https://d-toybox.com/studio/lib/input_event_viewer.html after checking the radio button labelled as <div contenteditable>.

Flags: needinfo?(alice0775)
Summary: Table does not copies → Pasting table into HTMLEditor is not inserted as all cells in one row
Summary: Pasting table into HTMLEditor is not inserted as all cells in one row → Pasting table into HTMLEditor inserts all cells in one row

Regression window(release)
Last Good: Firefox57
First Bad: Firefox58

Regression window(cached m-c):
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=781485c695e1f07b8782427d556f6570e4a8072f&tochange=0a559782a53a0d27424d3ec0c7f8a942ead597d7
(I do not have inbound cache of that range, so, I cannot do further bisection.)

Suspect: b0a3a621f5c85b5e9a4eb97de77fcb2558ac17c6 Henri Sivonen — Bug 1409951 - Use a stack to end serializer contexts instead of recomputing them. r=smaug

Regression window(beta channel):
https://hg.mozilla.org/releases/mozilla-beta/pushloghtml?fromchange=671706994162518e80a4b9f8125ff8e8c1bc3b1f&tochange=4fba9ec9d4ba8b3a224984f68b3358a85ed60ca6

Flags: needinfo?(alice0775)

What's the issue? I copied parts of the table or both tables at https://support.hp.com/ee-en/document/c06190211 into a TB compose window of TB 68 beta (unofficial) and it works fine. If this regressed into mozilla58, we ran the entire TB 60 cycle with the bug and never noticed it.

(In reply to Jorg K (GMT+2) from comment #5)

What's the issue? I copied parts of the table or both tables at https://support.hp.com/ee-en/document/c06190211 into a TB compose window of TB 68 beta (unofficial) and it works fine.

Really? I see them in one row.

If this regressed into mozilla58, we ran the entire TB 60 cycle with the bug and never noticed it.

Yeah. When you paste it into HTMLEditor even in Firefox, you can see different result from Chrome. So, this is really serious web-compat issue to me.

Thank you, Alice-san, it's a good hint to me!

<html><body>
<!--StartFragment--><table class="table table-bordered table-steps"><tbody valign="top"><tr><td rowspan="1" valign="top" align="left">
<div class="para">
<strong class="bold">Product number</strong>
</div>
</td><td rowspan="1" valign="top" align="left">
<div class="para">5KP01EA</div>
</td></tr><tr><td rowspan="1" valign="top" align="left">
<div class="para">
<strong class="bold">Product name</strong>
</div>
</td><td rowspan="1" valign="top" align="left">
<div class="para">HP Pavilion - 15-cw0013no</div>
</td></tr></tbody></table><!--EndFragment-->
</body>
</html>

This is what the copied table in clipboard. Actually this includes 2 rows.

Attached image screenshot

On Firefox58
Open https://support.hp.com/ee-en/document/c06190211
Ctrl+Click to select cells and Copy to clipboard

On Thunderbird60
Open Compose message window(in HTML format)
Paste

Attached image copy-paste-table.png

Maybe I'm doing something wrong/right, but this is what I see with the first two rows selected and copied/pasted.

Looks like the result of HTMLEditor::ParseFragment() was changed by bug 1409951.

Component: Editor → Serializers
Regressed by: 1409951

(In reply to Jorg K (GMT+2) from comment #9)

Created attachment 9068919 [details]
copy-paste-table.png

Maybe I'm doing something wrong/right, but this is what I see with the first two rows selected and copied/pasted.

Ah, looks like table selection vs. normal selection across table cells.

Sorry, I didn't read comment #0 properly: Ctrl-Select. Never used that.

Per comment #4 and comment #10, this is a regression of bug 1409951. Could you take a look at, Henri? Thank you.

Flags: needinfo?(hsivonen)

Bug 1433073, which this is a duplicate of, has some analysis.

Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(hsivonen)
Resolution: --- → DUPLICATE
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: