Opened 8 years ago

Closed 7 years ago

#17066 closed Bug (fixed)

Table seleciton causes exception on a pasted table in certain scenario

Reported by: Marek Lewandowski Owned by:
Priority: Must have (possibly next milestone) Milestone: CKEditor 4.7.1
Component: General Version: 4.7.0
Keywords: Cc:

Description

This issue is reproducible on our Document Editor demo. I wasn't able to repro it on a regular sample.

Maybe the fact that the editor is placed into a DOM dynamically has something to do?

  1. Go to Document Editor demo.
  2. Make a partial selectiom on the table, say 2x3 cell https://i.imgur.com/lsDMhD2.png
  3. Copy to clipboard.
  4. Move selection into another paragraph.
  5. Paste.
  6. Try to make table seleciton on a pasted table.

Expected

Our custom selection is being made.

Actual

Exception is thrown:

ckeditor.js?oqkjc5:66 Uncaught TypeError: Cannot read property 'ownerDocument' of undefined
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.element.getDocument (ckeditor.js?oqkjc5:66)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.element.getDocumentPosition (ckeditor.js?oqkjc5:108)
    at b (ckeditor.js?oqkjc5:1220)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.document.<anonymous> (ckeditor.js?oqkjc5:1227)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.document.c (ckeditor.js?oqkjc5:11)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.document.window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.event.CKEDITOR.event.fire (ckeditor.js?oqkjc5:13)
    at HTMLDocument.<anonymous> (ckeditor.js?oqkjc5:58)

Additional Information

I was able to reproduce it on Chrome, and Edge. Most likely it's reproducible on other browsers too.

Change History (9)

comment:1 Changed 8 years ago by kkrzton

I got the error on hover over pasted table without selecting. It only happens if table is copied with header row.

comment:2 Changed 8 years ago by kkrzton

I was also unable to reproduce it on regular sample even with identical config and build version.

comment:3 Changed 8 years ago by Marek Lewandowski

@k.krzton it might be related to the fact that that the editor on demo is attached at runtime. Worth checking out.

comment:4 in reply to:  3 Changed 8 years ago by kkrzton

Replying to m.lewandowski:

@k.krzton it might be related to the fact that that the editor on demo is attached at runtime. Worth checking out.

That might be the case, checking now.

comment:5 Changed 8 years ago by kkrzton

It is somehow strange, I run the website locally and used dev version and build version (based on major) with same config and styles and error does not occur then. It occurs only with bundled version. I will check how different are those two builds.

comment:6 Changed 8 years ago by kkrzton

Ok, editor for website is built from the special preset https://github.com/ckeditor/ckeditor-presets/blob/demo/presets/demo-build-config.js on which the error is reproducible.

comment:7 Changed 8 years ago by kkrzton

The minimal set of plugins to reproduce the issue:

config.plugins =
	'table,' +
	'tableresize,' +
	'tableselection,' +
	'toolbar,' +
	'wysiwygarea';

Look like the issue with tablerezise plugin.

comment:8 Changed 8 years ago by Marek Lewandowski

Status: newconfirmed

comment:9 Changed 7 years ago by kkrzton

Resolution: fixed
Status: confirmedclosed
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy