Opened 7 years ago

Last modified 7 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

  1. Open replacebycode sample page
  2. 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);
    
  3. 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.

Change History (1)

comment:1 Changed 7 years ago by Jakub Ś

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