Closed Bug 97625 Opened 25 years ago Closed 23 years ago

drag&drop of partial tables can produce invalid html

Categories

(SeaMonkey :: Composer, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.5alpha

People

(Reporter: TucsonTester2, Assigned: KaiE)

References

Details

(Keywords: topembed+, Whiteboard: EDITORBASE+, correctness,edt_x3,edt_b3,edt_c3, fixinhand, patch in 183582)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.3+) Gecko/20010828 Netscape6/6.1b1 BuildID: 20010828 If a table has no defined width and is dragged into another table the table is copied. Reproducible: Sometimes Steps to Reproduce: 1.Open Composer 2.Insert a 2x2 table and delete the width and leave it blank 3.Put some text in each cell 4.Click out of the table and place the cursor on the line below 5.Hit enter one time and insert another 2x2 table and delete the width6.Highlight the first table you made and drag it into the left cell in the second row Actual Results: Table was dragged into the cell but it was a copy of the table. The first copy was still above the table where it was created. Expected Results: I expect that the table would not be copied into the table. Instead the table should be moved into to the table.
This is reproducible everytime. When I dragged a table into another table it was copied instead of moved. The table was only copied if I dragged it into a cell just outside of the table border. This only works if it is dragged to the left or the right sides of the borders, it does not work above or below them. Steps to Reproduce: 1.Open Composer 2.Insert a default 2x2 100% width table using the table button on the toolbar 3.Insert a table below the first one 4.Right Click the first table and go to select and choose table 5.Drag the table into the top left cell of the second table. Make sure the pointer is just outside of the left table border. 6.Release the mouse button You will notice that the table was copied and not moved. If you look at the html source it will actually show the table was copied as well. What I expect to happen is that the table will be moved and not copied, regardless of where I have the arrow. If it supposed to be moved above or below the table then that should happen as well, instead of the copying problem.
Summary: Table with no defined width is copied if dragged into another table → Table dragged into a cell is copied instead of moved
--> charley
Assignee: brade → cmanske
Summary: Table dragged into a cell is copied instead of moved → Objects (images, tables, text, etc.) dragged into a cell are copied instead of moved
-->brade (d&d)
Assignee: cmanske → brade
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Objects (images, tables, text, etc.) dragged into a cell are copied instead of moved → Objects (images, tables, text, etc.) dragged into cell are copied instead of moved
spam composer change
Component: Editor: Core → Editor: Composer
Whiteboard: EDITORBASE
I don't see any problems if I select the whole table and then drag/drop. The problem I do see is that if the selection starts in a text node inside a table, we delete the text nodes but never any of the table structure. I expect to see wholy contained <td> to be deleted. The other (more serious) problem I see is (possibly in nsHTMLDataTransfer.cpp?) where we insert <tr> directly into a <td>. This asserts a few times and eventually creates a document with invalid html. Also, this can't be undone. Note: if there is a character in the table cell where you drop, you won't see the problem (a table gets inserted properly and undo works). Reassign to jfrancis for input/fix.
Assignee: brade → jfrancis
Whiteboard: EDITORBASE → EDITORBASE, correctness
Kathy, I didn't write any of the d&d code at either end, so I could use some advice. I know that the drop code does not do the things I do in the paste code. That's what causes the drop to generate illegal html. But I don't even know where the drag code lives. Where is the code that should drive the deletion of the table in the example above? Does anyone still own it? If I describe the kind of things that need to happen there is there anyone around to do it? assigning to brade for the moment to make sure she see's my questions.
Assignee: jfrancis → brade
Target Milestone: --- → mozilla0.9.8
changing summary to accurately reflect severity of this bug (please file other issues as new bugs if you can still reproduce them; sorry for any inconvenience) Drag&Drop code is in nsHTMLDataTransfer.cpp. In particular, InsertFromDrop should handle the deletion of the table with DeleteSelection() call (but maybe the variables aren't set up correctly if the table is selected (does selection appear collapsed if a table is selected?) At the end of InsertFromDrop, you'll see that InsertFromTransferable is called. At this point, drop and paste should be the same: InsertFromTransferable calls InsertHTMLWithContext() for html flavors. InsertHTMLWithContext calls InsertHTMLWithCharsetAndContext()... Let me know if you want me to investigate this a bit more (reassign back to me). -->jfrancis
Assignee: brade → jfrancis
Summary: Objects (images, tables, text, etc.) dragged into cell are copied instead of moved → drag&drop of partial tables can produce invalid html
pushing off 098 to 099
Target Milestone: mozilla0.9.8 → mozilla0.9.9
minusing, doesn't seem common usage to us.
Whiteboard: EDITORBASE, correctness → EDITORBASE-, correctness
setting milestones based on reprioritization of buglist
Target Milestone: mozilla0.9.9 → mozilla1.0.1
The trunk is the wave of the future!
Target Milestone: mozilla1.0.1 → mozilla1.1beta
The days of having a half dozen milestones out in front of us to divide bugs between seem to be gone, though I dont know why. Lumping everything together as far out as I can. I'll pull back things that I am working on as I go.
Target Milestone: mozilla1.1beta → mozilla1.2beta
migrating milestones now that there are more available. i'll pull these back as I work on them
Target Milestone: mozilla1.2beta → mozilla1.4beta
QA Contact: sujay → beppe
Whiteboard: EDITORBASE-, correctness → EDITORBASE+, correctness
EDITORBASE+ topembed+ normalization
Keywords: topembed+
Whiteboard: EDITORBASE+, correctness → EDITORBASE+, correctness,edt_x3,edt_b3,edt_c3
This is fixed by patch in 183582.
Status: NEW → ASSIGNED
Whiteboard: EDITORBASE+, correctness,edt_x3,edt_b3,edt_c3 → EDITORBASE+, correctness,edt_x3,edt_b3,edt_c3, fixinhand, patch in 183582
Depends on: 183582
reassign to kaie@netscape.com since it would be fixed by bug 183582
Assignee: jfrancis → kaie
Status: ASSIGNED → NEW
Target Milestone: mozilla1.4beta → mozilla1.5alpha
Marking fixed, because bug 183582 got fixed. Please reopen if you still see the problem.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.