diff options
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | configure.json | 15 | ||||
-rw-r--r-- | configure.pri | 12 | ||||
-rw-r--r-- | src/core/config/windows.pri | 12 | ||||
-rw-r--r-- | src/core/gyp_run.pro | 24 | ||||
-rw-r--r-- | src/core/web_engine_settings.cpp | 2 | ||||
-rw-r--r-- | src/core/web_engine_settings.h | 3 | ||||
-rw-r--r-- | src/webengine/api/qquickwebenginesettings.cpp | 23 | ||||
-rw-r--r-- | src/webengine/api/qquickwebenginesettings_p.h | 4 | ||||
-rw-r--r-- | src/webengine/plugin/plugin.cpp | 1 | ||||
-rw-r--r-- | src/webenginewidgets/api/qwebenginesettings.cpp | 2 | ||||
-rw-r--r-- | src/webenginewidgets/api/qwebenginesettings.h | 3 | ||||
-rw-r--r-- | src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc | 6 | ||||
-rw-r--r-- | tools/qmake/mkspecs/features/functions.prf | 26 |
14 files changed, 111 insertions, 24 deletions
diff --git a/.qmake.conf b/.qmake.conf index 73dc70b08..a988f0fac 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -7,4 +7,4 @@ QTWEBENGINE_OUT_ROOT = $$shadowed($$PWD) load(qt_build_config) CONFIG += warning_clean -MODULE_VERSION = 5.8.0 +MODULE_VERSION = 5.9.0 diff --git a/configure.json b/configure.json index 63abd1dba..66d568de9 100644 --- a/configure.json +++ b/configure.json @@ -8,6 +8,13 @@ } }, + "tests" : { + "ninja": { + "label": "system ninja", + "type": "detectNinja" + } + }, + "features": { "proprietary-codecs": { "label": "Proprietary Codecs", @@ -19,6 +26,11 @@ "label": "Spellchecker", "purpose": "Enables the use of Chromium's spellchecker", "output": [ "privateFeature" ] + }, + "system-ninja": { + "label": "Using system ninja", + "condition": "tests.ninja", + "output": [ "privateFeature" ] } }, @@ -27,7 +39,8 @@ "section": "Qt WebEngine", "entries": [ "proprietary-codecs", - "spellchecker" + "spellchecker", + "system-ninja" ] } ] diff --git a/configure.pri b/configure.pri new file mode 100644 index 000000000..dee7847b7 --- /dev/null +++ b/configure.pri @@ -0,0 +1,12 @@ + +defineTest(qtConfTest_detectNinja) { + ninja = $$qtConfFindInPath("ninja") + !isEmpty(ninja) { + qtLog("Found ninja from path: $$ninja") + qtRunLoggedCommand("$$ninja --version", version)|return(false) + contains(version, "1.*"): return(true) + qtLog("Ninja version too old") + } + qtLog("Building own ninja") + return(false) +} diff --git a/src/core/config/windows.pri b/src/core/config/windows.pri index 7f87e885d..a1c116ff8 100644 --- a/src/core/config/windows.pri +++ b/src/core/config/windows.pri @@ -21,10 +21,18 @@ GYP_ARGS += "-D perl_exe=\"perl.exe\" -D bison_exe=\"bison.exe\" -D gperf_exe=\" GYP_ARGS += "--no-parallel" qtConfig(angle) { + #FIXME: Expect LIBQTANGLE_NAME to be always set + #FIXME: Replace qt_egl_library and qt_glesv2_library into qt_angle_library + LIB_EGL=libEGL + LIB_GLESV2=libGLESv2 + !isEmpty(LIBQTANGLE_NAME) { + LIB_EGL=$$LIBQTANGLE_NAME + LIB_GLESV2=$$LIBQTANGLE_NAME + } CONFIG(release, debug|release) { - GYP_ARGS += "-D qt_egl_library=\"libEGL.lib\" -D qt_glesv2_library=\"libGLESv2.lib\"" + GYP_ARGS += "-D qt_egl_library=\"$${LIB_EGL}.lib\" -D qt_glesv2_library=\"$${LIB_GLESV2}.lib\"" } else { - GYP_ARGS += "-D qt_egl_library=\"libEGLd.lib\" -D qt_glesv2_library=\"libGLESv2d.lib\"" + GYP_ARGS += "-D qt_egl_library=\"$${LIB_EGL}d.lib\" -D qt_glesv2_library=\"$${LIB_GLESV2}d.lib\"" } GYP_ARGS += "-D qt_gl=\"angle\"" } else { diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro index 1850447e7..7ab8cbb13 100644 --- a/src/core/gyp_run.pro +++ b/src/core/gyp_run.pro @@ -2,6 +2,11 @@ # 1) invoking gyp through the gyp_qtwebengine script, which in turn makes use of the generated gypi include files # 2) produce a Makefile that will run ninja, and take care of actually building everything. +isQtMinimum(5, 8) { + include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) + QT_FOR_CONFIG += webengine-private +} + TEMPLATE = aux cross_compile { @@ -148,13 +153,24 @@ for (config, GYP_CONFIG): GYP_ARGS += "-D $$config" } build_pass|!debug_and_release { - ninja.target = invoke_ninja - ninja.commands = $$findOrBuildNinja() \$\(NINJAFLAGS\) -C "$$OUT_PWD/$$getConfigDir()" - QMAKE_EXTRA_TARGETS += ninja + + ninja_binary = ninja + runninja.target = run_ninja + + !qtConfig(system-ninja) { + ninja_binary = $$shell_quote($$shell_path($$ninjaPath())) + buildninja.target = build_ninja + buildninja.commands = $$buildNinja() + QMAKE_EXTRA_TARGETS += buildninja + runninja.depends = buildninja + } + + runninja.commands = $$ninja_binary \$\(NINJAFLAGS\) -C $$shell_quote($$OUT_PWD/$$getConfigDir()) + QMAKE_EXTRA_TARGETS += runninja build_pass:build_all: default_target.target = all else: default_target.target = first - default_target.depends = ninja + default_target.depends = runninja QMAKE_EXTRA_TARGETS += default_target } else { diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp index c17177745..57813a82f 100644 --- a/src/core/web_engine_settings.cpp +++ b/src/core/web_engine_settings.cpp @@ -242,6 +242,7 @@ void WebEngineSettings::initDefaults(bool offTheRecord) s_defaultAttributes.insert(FocusOnNavigationEnabled, true); s_defaultAttributes.insert(PrintElementBackgrounds, true); s_defaultAttributes.insert(AllowRunningInsecureContent, allowRunningInsecureContent); + s_defaultAttributes.insert(AllowGeolocationOnInsecureOrigins, false); } if (offTheRecord) m_attributes.insert(LocalStorageEnabled, false); @@ -320,6 +321,7 @@ void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *p prefs->experimental_webgl_enabled = testAttribute(WebGLEnabled); prefs->should_print_backgrounds = testAttribute(PrintElementBackgrounds); prefs->allow_running_insecure_content = testAttribute(AllowRunningInsecureContent); + prefs->allow_geolocation_on_insecure_origins = testAttribute(AllowGeolocationOnInsecureOrigins); // Fonts settings. prefs->standard_font_family_map[content::kCommonScript] = toString16(fontFamily(StandardFont)); diff --git a/src/core/web_engine_settings.h b/src/core/web_engine_settings.h index 8459ba75b..4b0ce7b39 100644 --- a/src/core/web_engine_settings.h +++ b/src/core/web_engine_settings.h @@ -82,7 +82,8 @@ public: TouchIconsEnabled, FocusOnNavigationEnabled, PrintElementBackgrounds, - AllowRunningInsecureContent + AllowRunningInsecureContent, + AllowGeolocationOnInsecureOrigins }; // Must match the values from the public API in qwebenginesettings.h. diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp index 09bf2708e..ac01d9cd6 100644 --- a/src/webengine/api/qquickwebenginesettings.cpp +++ b/src/webengine/api/qquickwebenginesettings.cpp @@ -347,6 +347,21 @@ bool QQuickWebEngineSettings::allowRunningInsecureContent() const } /*! + \qmlproperty bool WebEngineSettings::allowGeolocationOnInsecureOrigins + \since QtWebEngine 1.5 + + Since Qt 5.7, only secure origins such as HTTPS have been able to request + Geolocation features. This provides an override to allow non secure + origins to access Geolocation again. + + Disabled by default. +*/ +bool QQuickWebEngineSettings::allowGeolocationOnInsecureOrigins() const +{ + return d_ptr->testAttribute(WebEngineSettings::AllowGeolocationOnInsecureOrigins); +} + +/*! \qmlproperty string WebEngineSettings::defaultTextEncoding \since QtWebEngine 1.2 @@ -540,6 +555,14 @@ void QQuickWebEngineSettings::setAllowRunningInsecureContent(bool on) Q_EMIT allowRunningInsecureContentChanged(); } +void QQuickWebEngineSettings::setAllowGeolocationOnInsecureOrigins(bool on) +{ + bool wasOn = d_ptr->testAttribute(WebEngineSettings::AllowGeolocationOnInsecureOrigins); + d_ptr->setAttribute(WebEngineSettings::AllowGeolocationOnInsecureOrigins, on); + if (wasOn != on) + Q_EMIT allowGeolocationOnInsecureOriginsChanged(); +} + void QQuickWebEngineSettings::setParentSettings(QQuickWebEngineSettings *parentSettings) { d_ptr->setParentSettings(parentSettings->d_ptr.data()); diff --git a/src/webengine/api/qquickwebenginesettings_p.h b/src/webengine/api/qquickwebenginesettings_p.h index a53c7cdb3..a2d4f1f96 100644 --- a/src/webengine/api/qquickwebenginesettings_p.h +++ b/src/webengine/api/qquickwebenginesettings_p.h @@ -85,6 +85,7 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineSettings : public QObject { Q_PROPERTY(bool focusOnNavigationEnabled READ focusOnNavigationEnabled WRITE setFocusOnNavigationEnabled NOTIFY focusOnNavigationEnabledChanged REVISION 3) Q_PROPERTY(bool printElementBackgrounds READ printElementBackgrounds WRITE setPrintElementBackgrounds NOTIFY printElementBackgroundsChanged REVISION 3) Q_PROPERTY(bool allowRunningInsecureContent READ allowRunningInsecureContent WRITE setAllowRunningInsecureContent NOTIFY allowRunningInsecureContentChanged REVISION 3) + Q_PROPERTY(bool allowGeolocationOnInsecureOrigins READ allowGeolocationOnInsecureOrigins WRITE setAllowGeolocationOnInsecureOrigins NOTIFY allowGeolocationOnInsecureOriginsChanged REVISION 4 FINAL) public: ~QQuickWebEngineSettings(); @@ -111,6 +112,7 @@ public: bool focusOnNavigationEnabled() const; bool printElementBackgrounds() const; bool allowRunningInsecureContent() const; + bool allowGeolocationOnInsecureOrigins() const; void setAutoLoadImages(bool on); void setJavascriptEnabled(bool on); @@ -134,6 +136,7 @@ public: void setFocusOnNavigationEnabled(bool on); void setPrintElementBackgrounds(bool on); void setAllowRunningInsecureContent(bool on); + void setAllowGeolocationOnInsecureOrigins(bool on); signals: void autoLoadImagesChanged(); @@ -158,6 +161,7 @@ signals: Q_REVISION(3) void focusOnNavigationEnabledChanged(); Q_REVISION(3) void printElementBackgroundsChanged(); Q_REVISION(3) void allowRunningInsecureContentChanged(); + Q_REVISION(4) void allowGeolocationOnInsecureOriginsChanged(); private: explicit QQuickWebEngineSettings(QQuickWebEngineSettings *parentSettings = 0); diff --git a/src/webengine/plugin/plugin.cpp b/src/webengine/plugin/plugin.cpp index 0fd2087d4..f8f790061 100644 --- a/src/webengine/plugin/plugin.cpp +++ b/src/webengine/plugin/plugin.cpp @@ -103,6 +103,7 @@ public: qmlRegisterUncreatableType<QQuickWebEngineSettings, 1>(uri, 1, 2, "WebEngineSettings", tr("Cannot create a separate instance of WebEngineSettings")); qmlRegisterUncreatableType<QQuickWebEngineSettings, 2>(uri, 1, 3, "WebEngineSettings", tr("Cannot create a separate instance of WebEngineSettings")); qmlRegisterUncreatableType<QQuickWebEngineSettings, 3>(uri, 1, 4, "WebEngineSettings", tr("Cannot create a separate instance of WebEngineSettings")); + qmlRegisterUncreatableType<QQuickWebEngineSettings, 4>(uri, 1, 5, "WebEngineSettings", tr("Cannot create a separate instance of WebEngineSettings")); qmlRegisterSingletonType<QQuickWebEngineSingleton>(uri, 1, 1, "WebEngine", webEngineSingletonProvider); qmlRegisterUncreatableType<QQuickWebEngineHistory>(uri, 1, 1, "NavigationHistory", tr("Cannot create a separate instance of NavigationHistory")); diff --git a/src/webenginewidgets/api/qwebenginesettings.cpp b/src/webenginewidgets/api/qwebenginesettings.cpp index 50002e3e6..08d24376a 100644 --- a/src/webenginewidgets/api/qwebenginesettings.cpp +++ b/src/webenginewidgets/api/qwebenginesettings.cpp @@ -95,6 +95,8 @@ static WebEngineSettings::Attribute toWebEngineAttribute(QWebEngineSettings::Web return WebEngineSettings::PrintElementBackgrounds; case QWebEngineSettings::AllowRunningInsecureContent: return WebEngineSettings::AllowRunningInsecureContent; + case QWebEngineSettings::AllowGeolocationOnInsecureOrigins: + return WebEngineSettings::AllowGeolocationOnInsecureOrigins; default: return WebEngineSettings::UnsupportedInCoreSettings; diff --git a/src/webenginewidgets/api/qwebenginesettings.h b/src/webenginewidgets/api/qwebenginesettings.h index e3fb83ff5..73995a457 100644 --- a/src/webenginewidgets/api/qwebenginesettings.h +++ b/src/webenginewidgets/api/qwebenginesettings.h @@ -88,7 +88,8 @@ public: TouchIconsEnabled, FocusOnNavigationEnabled, PrintElementBackgrounds, - AllowRunningInsecureContent + AllowRunningInsecureContent, + AllowGeolocationOnInsecureOrigins }; enum FontSize { diff --git a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc index 07afd6501..1919d6ea7 100644 --- a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc @@ -160,6 +160,12 @@ web-sockets from HTTP URLs. This provides an override to get the old insecure behavior. Disabled by default. (Added in Qt 5.8) + \value AllowGeolocationOnInsecureOrigins + Since Qt 5.7, only secure origins such as HTTPS have been able to request + Geolocation features. This provides an override to allow non secure + origins to access Geolocation again. + Disabled by default. (Added in Qt 5.9) + */ /*! diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index 236ee8ac5..8191f7589 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -368,24 +368,22 @@ defineTest(use?) { return(false) } -defineReplace(findOrBuildNinja) { - # If NINJA_PATH env var is set, prefer that. - # Fallback to locating our own bootstrapped ninja. - out = $(NINJA_PATH) - !exists($$out) { +defineReplace(ninjaPath) { src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") - out = $$shadowed($$absolute_path(ninja/ninja, $$src_3rd_party_dir)) win32: out = $${out}.exe + return($$out) +} - # If we did not find ninja, then we bootstrap it. - !exists($$out) { - mkpath($$dirname(out)) - ninja_configure = $$absolute_path(ninja/configure.py, $$src_3rd_party_dir) - system("cd $$system_quote($$system_path($$dirname(out))) && python $$system_quote($$system_path($$ninja_configure)) --bootstrap") - } - } - return($$system_path($$out)) +defineReplace(buildNinja) { + out = $$ninjaPath() + # check if it is not already build + !exists($$out) { + mkpath($$dirname(out)) + src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") + ninja_configure = $$absolute_path(ninja/configure.py, $$src_3rd_party_dir) + system("cd $$system_quote($$system_path($$dirname(out))) && python $$system_quote($$system_path($$ninja_configure)) --bootstrap") + } } defineTest(skipBuild) { |