Opened 11 years ago

Closed 10 years ago

#12038 closed Bug (invalid)

Method insertElement should be aware of Blink bug

Reported by: Jakub Ś Owned by:
Priority: Normal Milestone:
Component: General Version: 4.0
Keywords: Blink Cc:

Description

Currently when you have image with relative path in contenteditable element and decide to copy paste it you will see image path being converted to absolute one. Some users may not like it.

This is not a problem in CKEditor most of the times when you copy paste images that are in editor. CKEditor uses data-cke-saved-src custom attribute which deals with this Blink bug. There is however one specific case.

  1. Use below code to insert image into editor
    var value = "<img src ="../ball.jpg" style="width:100px" />';
    var element = CKEDITOR.dom.element.createFromHtml(value);
    editor.insertElement( element );
    
  2. Copy/paste image next to existing one.
  3. Get editor data.

Result: Path is src attribute is changed because data-cke-saved-src is not used in this case.

Proposed solution: Insert element could be made aware of this issue and insert data-cke-saved-src when it deals with images on Blink browsers.

Change History (2)

comment:1 Changed 11 years ago by Jakub Ś

Status: newconfirmed

comment:2 Changed 10 years ago by Piotrek Koszuliński

Resolution: invalid
Status: confirmedclosed

This can be done, but this is not what insertElement should do. There's a pretty big difference between insertHtml and insertElement that the former uses the HTML data processor, while the latter does not, because it cannot. HTML data processor works on HTML strings so it would require ugly hacks to use it inside insertElement. And all those filters like converting src to data-cke-saved-src are implemented as HTML DP's filters.

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