Repository: qutebrowser/qutebrowser

Issue:
webelem.Error when using :follow-selected with element out of view
- Go to qute://help/commands.html
- Select a link (blue selection)
- Scroll it out of view
- Press enter

cc @jgkamat 

```
08:20:52 DEBUG    commands   command:run:491 command called: follow-selected
08:20:52 DEBUG    commands   command:run:506 Calling qutebrowser.browser.commands.CommandDispatcher.follow_selected(<qutebrowser.browser.commands.CommandDispatcher>, tab=False)
08:20:52 DEBUG    modes      modeman:_handle_keypress:199 match: 2, forward_unbound_keys: auto, passthrough: False, is_non_alnum: True, dry_run: False --> filter: True (focused: <PyQt5.QtWidgets.QWidget object at 0x7fd2640f1d38>)
08:20:52 DEBUG    webview    webenginetab:_follow_selected_cb:362 Found link in selection, clicking. ClickTarget ClickTarget.normal, elem adblock-update
08:20:52 DEBUG    webelem    webelem:click:405 Clicking <qutebrowser.browser.webengine.webengineelem.WebEngineElement html='<a href="#adblock-update">adblock-update</a>'> with click_target ClickTarget.normal, force_event False
08:20:52 DEBUG    webelem    webelem:is_editable:249 Checking if element is editable: <qutebrowser.browser.webengine.webengineelem.WebEngineElement html='<a href="#adblock-update">adblock-update</a>'>
08:20:52 ERROR    misc       crashsignal:exception_hook:214 Uncaught exception
Traceback (most recent call last):
  File "/home/florian/proj/qutebrowser/git/qutebrowser/browser/webengine/webenginetab.py", line 380, in <lambda>
    self._follow_selected_cb(jsret, tab))
  File "/home/florian/proj/qutebrowser/git/qutebrowser/browser/webengine/webenginetab.py", line 363, in _follow_selected_cb
    elem.click(click_type)
  File "/home/florian/proj/qutebrowser/git/qutebrowser/browser/webelem.py", line 422, in click
    self._click_fake_event(click_target)
  File "/home/florian/proj/qutebrowser/git/qutebrowser/browser/webelem.py", line 336, in _click_fake_event
    pos = self._mouse_pos()
  File "/home/florian/proj/qutebrowser/git/qutebrowser/browser/webelem.py", line 327, in _mouse_pos
    raise Error("Element position is out of view!")
qutebrowser.browser.webelem.Error: Element position is out of view!
```


Discussion:

Resolving patch:
diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py
--- a/qutebrowser/browser/webengine/webenginetab.py
+++ b/qutebrowser/browser/webengine/webenginetab.py
@@ -33,7 +33,7 @@
 from PyQt5.QtWebEngineWidgets import QWebEnginePage, QWebEngineScript
 
 from qutebrowser.config import configdata, config
-from qutebrowser.browser import browsertab, mouse, shared
+from qutebrowser.browser import browsertab, mouse, shared, webelem
 from qutebrowser.browser.webengine import (webview, webengineelem, tabhistory,
                                            interceptor, webenginequtescheme,
                                            cookies, webenginedownloads,
@@ -360,7 +360,11 @@ def _follow_selected_cb(self, js_elem, tab=False):
         if elem.is_link():
             log.webview.debug("Found link in selection, clicking. ClickTarget "
                               "{}, elem {}".format(click_type, elem))
-            elem.click(click_type)
+            try:
+                elem.click(click_type)
+            except webelem.Error as e:
+                message.error(str(e))
+                return
 
     def follow_selected(self, *, tab=False):
         if self._tab.search.search_displayed:


Test patch: