Merge from main repo master, resolved conflict in webenginetab.py

This commit is contained in:
Joakim Särehag 2018-05-18 13:59:25 +02:00
commit 4966a70709
9 changed files with 52 additions and 11 deletions

View File

@ -36,6 +36,21 @@ Changed
- There's now completion for commands taking a variable count of arguments
(like `:config-cycle`).
v1.3.1 (unreleased)
-------------------
Added
~~~~~
- Work around a bug in Qt 5.11 where only the top/bottom half of the window is used.
Fixed
~~~~~
- Work around an issue in Qt 5.11 where e.g. activating JavaScript per-domain
needed a manual relaod in some cases.
v1.3.0
------

View File

@ -3,7 +3,7 @@
attrs==18.1.0
flake8==3.5.0
flake8-bugbear==18.2.0
flake8-builtins==1.3.1 # rq.filter: != 1.4.0
flake8-builtins==1.4.1 # rq.filter: != 1.4.0
flake8-comprehensions==1.4.1
flake8-copyright==0.2.0
flake8-debugger==3.1.0

View File

@ -5,4 +5,4 @@ packaging==17.1
pyparsing==2.2.0
setuptools==39.1.0
six==1.11.0
wheel==0.31.0
wheel==0.31.1

View File

@ -9,7 +9,7 @@ isort==4.3.4
lazy-object-proxy==1.3.1
mccabe==0.6.1
-e git+https://github.com/PyCQA/pylint.git#egg=pylint
python-dateutil==2.7.2
python-dateutil==2.7.3
./scripts/dev/pylint_checkers
requests==2.18.4
six==1.11.0

View File

@ -9,7 +9,7 @@ isort==4.3.4
lazy-object-proxy==1.3.1
mccabe==0.6.1
pylint==1.8.4
python-dateutil==2.7.2
python-dateutil==2.7.3
./scripts/dev/pylint_checkers
requests==2.18.4
six==1.11.0

View File

@ -11,7 +11,7 @@ fields==5.0.0
Flask==1.0.2
glob2==0.6
hunter==2.0.2
hypothesis==3.56.5
hypothesis==3.56.9
itsdangerous==0.24
# Jinja2==2.10
Mako==1.0.7

View File

@ -1062,6 +1062,21 @@ class WebEngineTab(browsertab.AbstractTab):
def _on_navigation_request(self, navigation):
super()._on_navigation_request(navigation)
if qtutils.version_check('5.11.0', exact=True, compiled=False):
# WORKAROUND for https://bugreports.qt.io/browse/QTBUG-68224
layout = self._widget.layout()
count = layout.count()
if count > 1:
for i in range(count):
item = layout.itemAt(i)
if item is None:
continue
widget = item.widget()
if widget is not self._widget.focusProxy():
log.webview.debug("Removing widget {} (QTBUG-68224)"
.format(widget))
layout.removeWidget(widget)
if navigation.url == QUrl('qute://print'):
command_dispatcher = objreg.get('command-dispatcher',
scope='window',
@ -1072,20 +1087,27 @@ class WebEngineTab(browsertab.AbstractTab):
if not navigation.accepted or not navigation.is_main_frame:
return
needs_reload = {
settings_needing_reload = {
'content.plugins',
'content.javascript.enabled',
'content.javascript.can_access_clipboard',
'content.javascript.can_access_clipboard',
'content.print_element_backgrounds',
'input.spatial_navigation',
'input.spatial_navigation',
}
assert needs_reload.issubset(configdata.DATA)
assert settings_needing_reload.issubset(configdata.DATA)
changed = self.settings.update_for_url(navigation.url)
if (changed & needs_reload and navigation.navigation_type !=
navigation.Type.link_clicked):
reload_needed = changed & settings_needing_reload
# On Qt < 5.11, we don't don't need a reload when type == link_clicked.
# On Qt 5.11.0, we always need a reload.
# TODO on Qt > 5.11.0, we hopefully never need a reload:
# https://codereview.qt-project.org/#/c/229525/1
if not qtutils.version_check('5.11.0', exact=True, compiled=False):
if navigation.navigation_type != navigation.Type.link_clicked:
reload_needed = False
if reload_needed:
# WORKAROUND for https://bugreports.qt.io/browse/QTBUG-66656
self._reload_url = navigation.url

View File

@ -399,6 +399,7 @@ def version():
lines += [
'Frozen: {}'.format(hasattr(sys, 'frozen')),
"Imported from {}".format(importpath),
"Using Python from {}".format(sys.executable),
"Qt library executable path: {}, data path: {}".format(
QLibraryInfo.location(QLibraryInfo.LibraryExecutablesPath),
QLibraryInfo.location(QLibraryInfo.DataPath)

View File

@ -874,6 +874,7 @@ def test_version_output(params, stubs, monkeypatch):
'_git_str': lambda: ('GIT COMMIT' if params.git_commit else None),
'platform.python_implementation': lambda: 'PYTHON IMPLEMENTATION',
'platform.python_version': lambda: 'PYTHON VERSION',
'sys.executable': 'EXECUTABLE PATH',
'PYQT_VERSION_STR': 'PYQT VERSION',
'earlyinit.qt_version': lambda: 'QT VERSION',
'_module_versions': lambda: ['MODULE VERSION 1', 'MODULE VERSION 2'],
@ -897,6 +898,7 @@ def test_version_output(params, stubs, monkeypatch):
'qt': 'QT VERSION',
'frozen': str(params.frozen),
'import_path': import_path,
'python_path': 'EXECUTABLE PATH',
}
if params.with_webkit:
@ -951,6 +953,7 @@ def test_version_output(params, stubs, monkeypatch):
Platform: PLATFORM, ARCHITECTURE{linuxdist}
Frozen: {frozen}
Imported from {import_path}
Using Python from {python_path}
Qt library executable path: QT PATH, data path: QT PATH
{osinfo}
Paths: