Opened 13 years ago
Last modified 13 years ago
#8169 confirmed Bug
Webkit editor doesn't scroll without focus.
Reported by: | Jakub Ś | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.0.2 |
Keywords: | Webkit | Cc: |
Description
Issue found when reproducing #7635
- Open replacebycode sample page
- Paste the following code
var doScroll = function(collapseToStart) { var e = CKEDITOR.instances.editor1; var d = e.document; var r = new CKEDITOR.dom.range(d); r.selectNodeContents(d.getBody()); r.collapse(collapseToStart); r.select(); e.focus(); e.getSelection().scrollIntoView(); }; var scrollToTop = function() { doScroll(true); }; var scrollToBottom = function() { doScroll(false); }; setTimeout(scrollToBottom, 2000); setTimeout(scrollToTop, 3000); setTimeout(scrollToBottom, 4000);
- Open page in Webkit
Result: You will see that editor only scrolls down once when it has no focus. If it has focus it scrolls down-up-down.
Now add extra setTimeout function
setTimeout(scrollToTop, 1500); setTimeout(scrollToBottom, 2000); setTimeout(scrollToTop, 3000); setTimeout(scrollToBottom, 4000);
If editor has no focus it scrolls down-up-down. If it has focus it scrolls up-down-up-down.
If there would be only one setTimeout function, you wouldn’t see any scrolling.
Webkit uses first function call to gain focus.