diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 353bd3d00..598207bfb 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -137,6 +137,7 @@ Fixed fixed. - Scrolling to an anchor in a background tab now works correctly, and javascript gets the correct window size for background tabs. +- `:scroll-page` with `--bottom-navigate` now works correctly on QtWebEngine v0.10.1 ------- diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 8acd0eda0..0a4c2dfc7 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -20,6 +20,7 @@ """Wrapper over a QWebEngineView.""" import os +import math import functools import sip @@ -342,7 +343,7 @@ class WebEngineScroller(browsertab.AbstractScroller): else: perc_y = min(100, round(100 / dy * jsret['px']['y'])) - self._at_bottom = dy >= jsret['px']['y'] + self._at_bottom = math.ceil(jsret['px']['y']) >= dy self._pos_perc = perc_x, perc_y self.perc_changed.emit(*self._pos_perc) diff --git a/tests/end2end/features/scroll.feature b/tests/end2end/features/scroll.feature index a69b6ffae..28658e1e6 100644 --- a/tests/end2end/features/scroll.feature +++ b/tests/end2end/features/scroll.feature @@ -292,6 +292,13 @@ Feature: Scrolling And I run :scroll-page --bottom-navigate next 0 1 Then data/hello2.txt should be loaded + Scenario: :scroll-page with --bottom-navigate when not at the bottom + When I run :scroll-px 0 10 + And I wait until the scroll position changed + And I run :scroll-page --bottom-navigate next 0 1 + Then the following tabs should be open: + - data/scroll/simple.html + Scenario: :scroll-page with --top-navigate When I run :scroll-page --top-navigate prev 0 -1 Then data/hello3.txt should be loaded