Ticket #8022 (closed Bug: wontfix)

Opened 3 years ago

Last modified 19 months ago

Paste of relative path image with baseHref set results in wrong urls in IE

Reported by: fbingha Owned by:
Priority: Normal Milestone:
Component: General Version: 3.1
Keywords: CantFix Cc:

Description (last modified by j.swiderski) (diff)

This doesn't ever seem to work in FF, but it does in IE with baseHref is not defined.

  1. Set config.baseHref
  2. Visit a website that images set via relative urls, e.g. <img src="../somethingimage.png" />
  3. Right-click an image, select "Copy".
  4. Go to editor and paste image.
  5. Observe that image is broken and inspection of the image shows that the img src now includes the baseHref that was set with config.baseHref.

Make the same action with baseHref not set and the image displays as it contains the full url to the image from which it was copied. Even though the source image contained a relative path, the paste action results in the full URL being used unless baseHref is set.


According comment_5 this is a won't fix and can't fix

Attachments

template_test.html (478 bytes) - added by j.swiderski 19 months ago.

Change History

comment:1 Changed 3 years ago by j.swiderski

  • Status changed from new to confirmed
  • Version set to 3.1

According to http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.baseHref this attribute means: "The base href URL used to resolve relative and absolute URLs in the editor content."

The browser behavior is inconsistent with this description.

  1. IE - If you copy image with absolute path than this path is used. If you copy image with relative path than this path is joined with baseHref value. It has been working like this for IE from CKEditor 3.1
  1. FF4 - uses data: for pasted image.
  2. FF3.6 - uses file: for pasted image.
  3. Chrome - ignores this attribute and always pastes whole URL
  4. Opera and Safari- you can't paste an image like this.
Last edited 2 years ago by j.swiderski (previous) (diff)

comment:2 Changed 3 years ago by fbingha

"The base href URL used to resolve relative and absolute URLs in the editor content."

You seem to imply that the correct behavior here would be for all browsers to behave as IE is behaving.

The baseHref setting should not apply in this context. When there is no baseHref, the full foreign url is used but when there is a baseHref set, that url is thrown away and we use baseHref, breaking the image? The code is doing this per design?

comment:3 Changed 3 years ago by j.swiderski

Could you tell me how in your opinion this option should work?

Last edited 19 months ago by j.swiderski (previous) (diff)

comment:4 Changed 3 years ago by fbingha

If nothing is known about a relative URL, then yes, of course, base href should be used, if set. If the full URL is known, which IE seems to know in this case, then the full URL should be used. There is no benefit to replacing it with the base href in this context. I asked if this decision was being made by CKEditor or if it was being done by IE.

Changed 19 months ago by j.swiderski

comment:5 Changed 19 months ago by j.swiderski

  1. Open template test in IE browser.
  2. Go to http://refcardz.dzone.com/refcardz/getting-started-java-gui and copy author image with CRTL+C
  3. Paste it into editable section with CRTL+V - Image got pasted
  4. Uncomment base tag in template and reload the page
  5. Try to copy/paste image once more - Image is not pasted because URL is broken

Looks like IE is breaking the URL.

comment:6 Changed 19 months ago by j.swiderski

  • Description modified (diff)

comment:7 Changed 19 months ago by j.swiderski

  • Keywords CantFix added
  • Status changed from confirmed to closed
  • Resolution set to wontfix

Taking comment_5 into account I;m closing this ticket as it can't be fixed.

Editor receives post processed data and there is no way to figure out correct URL.

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