Opened 12 years ago

Closed 12 years ago

#9464 closed Bug (fixed)

[Opera&Framed] Selection stops updating after incorrect blur

Reported by: Piotrek Koszuliński Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.0
Component: Core : Selection Version: 4.0
Keywords: Opera Cc: Hallvord R. M. Steen (Opera Software)

Description (last modified by Piotrek Koszuliński)

  1. Open attached sample and open console (on Opera ctrl+shift+i).
  2. Click on the plain text inside editor, see that focus and selectionChange were logged and the selection path is *body,p*.
  3. Click on the bolded text, see that selectionChange was logged and selection path is *body,p,b*.
  4. Do one of:
    • click below the text (on html element),
    • click on the link inside editor,
    • apply font-size to selected text.
  5. See that blur was logged (not any more happening after #9459 is closed).
  6. Click on normal and bolded text and observe selection path logged on console.
  • Expected: selection path is updated correctly - when selection starts in bolded text it contains 3 elements and in normal 2 elements.
  • Actual: after step 4. selection stops being updated - regardless of the place it's equal to the selection before step 4. and selectionChange event isn't thrown any more.

Attachments (3)

operasel.html (1.2 KB) - added by Piotrek Koszuliński 12 years ago.
comparefocus.html (868 bytes) - added by Piotrek Koszuliński 12 years ago.
operasel.2.html (1.5 KB) - added by Piotrek Koszuliński 12 years ago.

Download all attachments as: .zip

Change History (11)

Changed 12 years ago by Piotrek Koszuliński

Attachment: operasel.html added

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

Component: GeneralCore : Selection

comment:2 Changed 12 years ago by Garry Yao

Keywords: Opera added
Status: newconfirmed

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

Owner: set to Piotrek Koszuliński
Status: confirmedassigned

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

Description: modified (diff)
Summary: [Opera] Selection stops updating after incorrect blur[Opera&Framed] Selection stops updating after incorrect blur

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

Description: modified (diff)

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

Farther investigation showed that this issue is caused by the same Opera's issues as in #9459. However fix for #9459 hasn't helped in this situation, because selection is locked/unlocked in listeners on editable's blur/focus events, so "a level lower".

We've got three broken scenarios:

  1. click below the text (on html element),
  2. click on the link inside editor,
  3. apply font-size to selected text.

Regarding third I'm not sure what's wrong, but much probably independent iframes' threads cause incorrect focus/blur/click events order. This will need further investigation, but in short editable is focused (by us) on click on link inside independent iframe and after that Opera fires focus on this link and blur on editable. So at the end editable is blurred.

For points 1. and 2. I've made a sample revealing what's happening.

  1. Open http://jsfiddle.net/ZFAMh/3/ (or attached comparefocus.html).
  2. Click on text to focus editable (focus is thrown).
  3. Click on link or on the darker border which is an html element.

What does happen on Chrome and Firefox? There's a small difference between them when clicking on html element, but in both scenarios the last thrown event is focus or nothing happens. And that's correct, because after clicking editable is still focused and we can see a blinking cursor.

What does happen on Opera? After clicking on link or html element blur is thrown, but editable still is focused. So this's an incorrect behaviour.

We need to somehow port fix from #9459 to editable level. I think that it should possible to wrap all focus/blur listeners on editable with the same activeness check, especially that we have alredy overwritten element#on() for editable. This way we'll be safe on "lower level", so everything above (including focusManager) will be safe too.

PS. I'm attaching improved operasel.html sample which shows when editable is blurred/focused.

Changed 12 years ago by Piotrek Koszuliński

Attachment: comparefocus.html added

Changed 12 years ago by Piotrek Koszuliński

Attachment: operasel.2.html added

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

Cc: Hallvord R. M. Steen (Opera Software) added

comment:8 Changed 12 years ago by Garry Yao

Resolution: fixed
Status: assignedclosed

I agree with all Piotrek's thesis on this bug, so the fix from #9459 at the editable level should be very safe to fix this bug, landed on master with:

https://github.com/ckeditor/ckeditor-dev/commit/2ab93d297c02f717d8098a690803c14381b38912

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