[Opera&Framed] Selection stops updating after incorrect blur
- Open attached sample and open console (on Opera ctrl+shift+i).
- Click on the plain text inside editor, see that focus and selectionChange were logged and the selection path is *body,p*.
- Click on the bolded text, see that selectionChange was logged and selection path is *body,p,b*.
- Do one of:
- click below the text (on html element),
- click on the link inside editor,
- apply font-size to selected text.
- See that blur was logged (not any more happening after #9459 is closed).
- 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.
Change History (11)
Component: |
General →
Core : Selection
|
Keywords: |
Opera added
|
Status: |
new →
confirmed
|
Owner: |
set to Piotrek Koszuliński
|
Status: |
confirmed →
assigned
|
Description: |
modified (diff)
|
Summary: |
[Opera] Selection stops updating after incorrect blur →
[Opera&Framed] Selection stops updating after incorrect blur
|
Description: |
modified (diff)
|
Cc: |
Hallvord R. M. Steen (Opera Software) added
|
Resolution: |
→ fixed
|
Status: |
assigned →
closed
|
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:
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.
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.