Opened 6 years ago

Closed 5 years ago

#10857 closed Bug (fixed)

MathJax widget [FF,IE9] - clipboard totally broken

Reported by: Olek Nowodziński Owned by: Piotr Jasiun
Priority: Must have (possibly next milestone) Milestone: CKEditor 4.3
Component: Core : Pasting Version: 4.3 Beta
Keywords: Cc:

Description

  1. Open http://ckeditor4.t/ckeditor/samples/plugins/mathjax/mathjax.html
  2. Select a widget
  3. C-x.
  4. Put caret anywhere you want.
  5. C-v.

FF: empty widget is pasted

IE9: error in console + broken widget:

SCRIPT16389: Unspecified error. 
selection.js, line 1958 character 6

Change History (12)

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

Status: newconfirmed

IE's issue may be caused by #10812. (Update: no, it's not)

FF's by #10841.

Last edited 6 years ago by Piotrek Koszuliński (previous) (diff)

comment:2 Changed 6 years ago by Jakub Ś

Error SCRIPT16389 is also mentioned in #10796. Perhaps fixing one issue will fix another.

Last edited 6 years ago by Jakub Ś (previous) (diff)

comment:3 Changed 6 years ago by Piotrek Koszuliński

Priority: NormalHigh

comment:4 Changed 5 years ago by Piotr Jasiun

Owner: set to Piotr Jasiun
Status: confirmedassigned

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

Replying to Reinmar:

IE's issue may be caused by #10812. (Update: no, it's not)

FF's by #10841.

Nope. It's not.

The problem is more complex, because iframe is removed during copy even in pure contenteditable (without CKE). What I can do is recreate it but to do this I need to have pasted event on widget.

Moreover surrounding span is removed by data processor because it has no content, after firefox removed iframe. The problem is that this span keep TeX in the attribute. I think that data processor should not remove empty elements if they have "data" attributes.

comment:6 Changed 5 years ago by Piotr Jasiun

On IE 9 problem is similar. When you copy iFrame in contenteditable in IE 9 iframe element is not removed but its content is, so you get iFrame without content. One solution can fix both problems (FF and IE) but I need paste event in widget and data processor modification.

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

The iframe is not a problem. You should be able recreate it in widget#init or even inside a data processor (remember that to process non-editable content you have to use special addRules option).

The second problem, with empty span being removed can, most likely, be solved easily too. Just fill that span holding iframe with a zero width space or some element with content and width set to 0px. ZWS will be the best solution if it'll work.

comment:8 Changed 5 years ago by Piotr Jasiun

Widget#ini is not called on FF & IE9 in my case. Maybe widget#paste method would be useful for someone else? It seems to be more elegant solution than adding rules to data processor to recreate iframe.

About second problem: I can create some workaround but maybe keeping elements with data attribute is what we should do in general? And what with special attribute to tell data processor to keep this element, we were talking about couple weeks ago?

comment:9 Changed 5 years ago by Piotr Jasiun

Status: assignedreview

Fixed.

It looks like IE9 have also problem with setting range on iframe, because it was the reason of the problem on that browser. Anyway:

I'm removing iframe on the paste event to have the same situation in all browsers and then insert in init method. I also created an attribute: data-cke-survive to prevent removing empty span element in data processor.

comment:10 Changed 5 years ago by Jakub Ś

Error SCRIPT16389 is also mentioned in #10796, #10858, #10894, #10970.

Last edited 5 years ago by Jakub Ś (previous) (diff)

comment:11 Changed 5 years ago by Piotr Jasiun

Status: reviewassigned

comment:12 Changed 5 years ago by Piotr Jasiun

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