From 5f1e0224a981e06e06d9611275b5b4b2f685f944 Mon Sep 17 00:00:00 2001 From: Artur Shaikhullin Date: Thu, 7 Dec 2017 17:30:32 +0600 Subject: [PATCH] Pass caret tests --- qutebrowser/browser/commands.py | 1 - qutebrowser/browser/webengine/webenginetab.py | 2 +- qutebrowser/javascript/webengine_caret.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 09da845f0..cb744b23d 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -885,7 +885,6 @@ class CommandDispatcher: message.info("{} {} yanked to {}".format( len(s), "char" if len(s) == 1 else "chars", target)) if not self.yank_object['keep']: - log.procs.debug(self.yank_object['keep']) modeman.leave(self._win_id, KeyMode.caret, "yank selected", maybe=True) self.yank_object = None diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 977e3a2c1..2e300296b 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -284,7 +284,7 @@ class WebEngineCaret(browsertab.AbstractCaret): # WORKAROUND for # https://bugreports.qt.io/browse/QTBUG-53134 self._tab.run_js_async( - 'window.getSelection().toString()', callback) + javascript.assemble('caret', 'getSelection'), callback) def _follow_selected_cb(self, js_elem, tab=False): """Callback for javascript which clicks the selected element. diff --git a/qutebrowser/javascript/webengine_caret.js b/qutebrowser/javascript/webengine_caret.js index d4d7e5a96..7235c9772 100644 --- a/qutebrowser/javascript/webengine_caret.js +++ b/qutebrowser/javascript/webengine_caret.js @@ -1051,7 +1051,7 @@ window._qutebrowser.caret = (function() { // eslint-disable-line max-statements, funcs.moveToEndOfDocument = () => { CaretBrowsing.move("forward", "documentboundary"); - window.scrollTo(0, document.body.scrollHeight); + funcs.moveLeft(); }; funcs.dropSelection = () => {