Opened 7 years ago

Closed 7 years ago

#9522 closed Bug (fixed)

[Opera] Pasting by paste dialog inserts bogus <br>

Reported by: Piotrek Koszuliński Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.0
Component: Core : Pasting Version: 4.0
Keywords: Opera Cc:

Description

  1. Open any sample.
  2. Focus editor.
  3. Click any of 'paste' buttons.
  • Expected: Dialog opened, content not changed.
  • Actual: Dialog opened, <br> inserted.

We had this issue before and it was caused by <br> filling empty <body> which *was* used as a pastebin.

Change History (6)

comment:1 Changed 7 years ago by Garry Yao

Keywords: Opera added
Status: newconfirmed

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

Owner: set to Piotrek Koszuliński
Status: confirmedassigned

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

As I thought, Opera is filling empty pastebin (div) with <br>, what looks like pasted <br> (there's no way to distinguish whether it's pasted or not).

This is regression after https://github.com/ckeditor/ckeditor-dev/commit/a5b99a5, but I wouldn't focus on fixing selection, because we'll just waste time there possibly breaking something more important.

It may be possible to prevent Opera from appending this bogus <br> by some special combination of pastebin tag name and styles, but it may not be stable like in this case, so I haven't checked this way.

I've got few other ideas, but I'm not fully convinced to at least one of them:

  1. We're always trying to get clipboard data directly (plugin.js:767), even on nonIEs and without native trigger. In 99% cases it doesn't work and we may skip this step. We would fix this issue, however there still will be the same, wrong behaviour when pasting from empty clipboard (which I ignore). Although, I remember that there was a reason for trying to access clipboard directly. What is it? Browsers' addons?
  2. We may ignore on Opera pasted single <br>. It's not possible to copy it on Opera (although it's possible to copy it from e.g. Chrome). This is drastic solution :).
  3. I checked that we can set initial content of pastebin to some unique text and stop paste process if it wasn't replaced by pasted content. This seems to fix all cases, but I'm reluctant to complicate clipboard implementation more.
  4. It maybe possible to verify what happened by checking selection, but that's even more complicated than 3.

I'm for 1. if there's no hidden reason for keeping that code. If there is a reason, then 3.

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

Status: assignedreview

Fred came out with idea that manually appending bogus may help... And it helped. What's more - for all known issues :).

comment:5 Changed 7 years ago by Garry Yao

Status: reviewreview_passed

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

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