Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1081 closed Bug (fixed)

Restore table with undo deletes body element and causes javascript error

Reported by: jonhg Owned by: martinkou
Priority: Normal Milestone: FCKeditor 2.5 Beta
Component: General Version: SVN (FCKeditor) - Retired
Keywords: Confirmed IE Cc:

Description

Scenario:

  1. Create a table
  2. Move the cursor to the paragraph above the table
  3. Press "del" to delete the table
  4. Press "CTRL-Z" to restore the table
  5. Javascript error because of body element beeing deleted

Tested in Nightly build with IE7

The bug does not seem to apply when the table is deleted as a control object (selected and then deleted)

Change History (5)

comment:1 Changed 9 years ago by martinkou

  • Keywords Confirmed IE added
  • Milestone set to FCKeditor 2.5
  • Version set to SVN

Confirmed on IE, the bug does not occur in Firefox.

comment:2 Changed 9 years ago by martinkou

  • Owner set to martinkou
  • Status changed from new to assigned

comment:3 Changed 9 years ago by martinkou

The error doesn't occur in 2.4.3, and I've traced the cause of the error to the changeset [617]. Before [617], the error does not occur.

comment:4 Changed 9 years ago by martinkou

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed with [713].

The real culprit to the bug was not [617] though, it was the enter key system that was faulty. I found in my investigations that after pressing Delete in step 3, the contents of the <table> tag (i.e. the <tbody>, <tr>, <td> tags) would be brought into the document, and if you move the cursor around just after step 3, you would find there are a few new lines at where the table used to be (these new lines are actually <tr> tags). Deleting one of these new lines would delete the <body> tag, and invoke the error without performing step 4 and step 5.

So the real problem here is that the Delete key handling logic has incorrectly brought the contents of the <table> block into the document, and having a <tbody> inside <body> creates some really weird behaviors. [713] fixes the bug by making the Delete key delete the whole table with its contents.

comment:5 Changed 9 years ago by fredck

Nice job Martin!

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy