Opened 5 years ago

Closed 5 years ago

#11179 closed Bug (fixed)

editor.destroy() does not cleanup content generated by TableResize plugin for inline editors

Reported by: Teresa Monahan Owned by: Piotr Jasiun
Priority: Normal Milestone: CKEditor 4.3.1
Component: General Version: 4.0 Beta
Keywords: IBM Cc: Satya Minnekanti, Irina, peter

Description

To Reproduce:

  • Copy inline_destroy.html (attached) into a build where the tableresize plugin is available and open it in a browser.
  • Click inside the editor and resize a table column (or hover over the column boundaries so that the resizer icon is displayed).
  • Inspect the HTML for the page and see that the tableresize plugin has added an element, e.g.

{{{<div contenteditable="false" style="position: absolute; cursor: col-resize; opacity: 0; padding: 0px; background-color: rgb(0, 0, 68); background-image: none; border: 0px none; z-index: 10; width: 3px; height: 49px; left: 272px; top: 213.867px; display: none;" unselectable="on" data-cke-temp="1"></div> }}}

  • Click the 'Destroy Editor' button.

Problem: Inspect the HTML for the page again and see that the element added by the tableresize plugin is still present.

If you then click the 'Create Inline Editor' button to recreate the editor, and resize a table column again, the tableresize plugin adds a new element to the DOM. The old element is redundant and should be removed from the DOM when the editor is destroyed - see attached tableresize_destroy.gif.

Attachments (2)

inline_destroy.html (1.3 KB) - added by Teresa Monahan 5 years ago.
tableresize_destroy.gif (18.4 KB) - added by Teresa Monahan 5 years ago.

Download all attachments as: .zip

Change History (10)

Changed 5 years ago by Teresa Monahan

Attachment: inline_destroy.html added

Changed 5 years ago by Teresa Monahan

Attachment: tableresize_destroy.gif added

comment:1 Changed 5 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.3.1

I haven't yet checked this TC, but it seems to be very likely given the changes in 4.3.

comment:2 Changed 5 years ago by Jakub Ś

Status: newconfirmed
Version: 4.3.1 (GitHub - master)4.0 Beta

Problem can be reproduced from CKEditor 4.0 beta

comment:3 Changed 5 years ago by Piotr Jasiun

Owner: set to Piotr Jasiun
Status: confirmedassigned

comment:4 Changed 5 years ago by Piotr Jasiun

Status: assignedreview

I've added code which remove resizer when editor is destroyed. Changes in t/11179 and corresponding test branch.

comment:5 Changed 5 years ago by Piotrek Koszuliński

Status: reviewreview_failed
  1. document.find() could be used in tests instead of checking all divs.
  2. There's a code style issue in tests (missing semicolon after count++).
  3. Tests are not executed in strict mode.
  4. Why do you add stylesheetparser and wysiwygarea plugins in tests?

comment:6 in reply to:  5 Changed 5 years ago by Piotr Jasiun

Status: review_failedreview

Replying to Reinmar:

  1. document.find() could be used in tests instead of checking all divs.

You're right. I thought that attribute selectors are not supported in IE8, but it looks they work pretty well.

  1. Tests are not executed in strict mode.

Added.

  1. Why do you add stylesheetparser and wysiwygarea plugins in tests?

Because these tests does not work in without it.

comment:7 Changed 5 years ago by Frederico Caldeira Knabben

Status: reviewreview_passed

comment:8 Changed 5 years ago by Piotr Jasiun

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