diff options
author | Liang Qi <liang.qi@qt.io> | 2018-11-02 10:07:14 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-11-02 10:07:14 +0100 |
commit | 34b714122051eae86ac49fd95c7015fb081f79eb (patch) | |
tree | 7ba1917986e00da1df4821efe6e62f4e9bffb156 /src | |
parent | 6e3aaa4b22892fd1fecdb9cf6c6e96296c13844a (diff) | |
parent | 8eda96bc8ae68387807e079cd557c98c4a452c4f (diff) | |
download | qtwebengine-34b714122051eae86ac49fd95c7015fb081f79eb.tar.gz |
Merge remote-tracking branch 'origin/5.12.0' into 5.12
Change-Id: I4dfca686e8a03e592879c456208baf3ab0025f88
Diffstat (limited to 'src')
m--------- | src/3rdparty | 0 | ||||
-rw-r--r-- | src/core/api/qwebenginecookiestore.cpp | 3 | ||||
-rw-r--r-- | src/core/ozone/gl_ozone_glx_qt.cpp | 19 | ||||
-rw-r--r-- | src/core/render_widget_host_view_qt.cpp | 9 | ||||
-rw-r--r-- | src/core/web_event_factory.cpp | 10 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineview.cpp | 12 |
6 files changed, 42 insertions, 11 deletions
diff --git a/src/3rdparty b/src/3rdparty -Subproject 24e56256fed17af82e094884adb38fddf7945b0 +Subproject d521ec6dd1ed0114b9c6d32b047fb024420a6cd diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp index abb39f074..035c98342 100644 --- a/src/core/api/qwebenginecookiestore.cpp +++ b/src/core/api/qwebenginecookiestore.cpp @@ -195,7 +195,8 @@ bool QWebEngineCookieStorePrivate::canAccessCookies(const QUrl &firstPartyUrl, c if (!filterCallback) return true; - bool thirdParty = + // Empty first-party URL indicates a first-party request (see net/base/static_cookie_policy.cc) + bool thirdParty = !firstPartyUrl.isEmpty() && !net::registry_controlled_domains::SameDomainOrHost(toGurl(url), toGurl(firstPartyUrl), net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); diff --git a/src/core/ozone/gl_ozone_glx_qt.cpp b/src/core/ozone/gl_ozone_glx_qt.cpp index 9a0fea7c7..2e7a28a0e 100644 --- a/src/core/ozone/gl_ozone_glx_qt.cpp +++ b/src/core/ozone/gl_ozone_glx_qt.cpp @@ -41,7 +41,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - +#include <QGuiApplication> #include "gl_ozone_glx_qt.h" #include "gl_surface_glx_qt.h" #include "ui/gl/gl_context_glx.h" @@ -49,6 +49,13 @@ #include "ui/gl/gl_glx_api_implementation.h" #include <dlfcn.h> +#ifndef QT_NO_OPENGL +#include <QOpenGLContext> +QT_BEGIN_NAMESPACE +Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); +QT_END_NAMESPACE +#endif + namespace ui { bool GLOzoneGLXQt::InitializeGLOneOffPlatform() { @@ -72,6 +79,16 @@ bool GLOzoneGLXQt::InitializeStaticGLBindings( reinterpret_cast<gl::GLGetProcAddressProc>( base::GetFunctionPointerFromNativeLibrary(library, "glXGetProcAddress")); + +#ifndef QT_NO_OPENGL + if (!get_proc_address) { + // glx handle not loaded, fallback to qpa + if (QOpenGLContext *context = qt_gl_global_share_context()) { + get_proc_address = reinterpret_cast<gl::GLGetProcAddressProc>( + context->getProcAddress("glXGetProcAddress")); + } + } +#endif if (!get_proc_address) { LOG(ERROR) << "glxGetProcAddress not found."; base::UnloadNativeLibrary(library); diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 1582cf733..1c5382fe7 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -690,6 +690,11 @@ void RenderWidgetHostViewQt::SubmitCompositorFrame(const viz::LocalSurfaceId &lo m_adapterClient->updateScrollPosition(toQt(m_lastScrollOffset)); if (contentsSizeChanged) m_adapterClient->updateContentsSize(toQt(m_lastContentsSize)); + + if (m_pendingResize && host()) { + if (host()->SynchronizeVisualProperties()) + m_pendingResize = false; + } } void RenderWidgetHostViewQt::GetScreenInfo(content::ScreenInfo *results) const @@ -890,10 +895,6 @@ void RenderWidgetHostViewQt::OnDidUpdateVisualPropertiesComplete(const cc::Rende QSGNode *RenderWidgetHostViewQt::updatePaintNode(QSGNode *oldNode) { - if (m_pendingResize && host()) { - if (host()->SynchronizeVisualProperties()) - m_pendingResize = false; - } return m_compositor->updatePaintNode(oldNode); } diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index 680e1a44c..a45f7048b 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -1441,7 +1441,11 @@ blink::WebMouseWheelEvent WebEventFactory::toWebWheelEvent(QWheelEvent *ev, doub webEvent.wheel_ticks_x = static_cast<float>(ev->angleDelta().x()) / QWheelEvent::DefaultDeltasPerStep; webEvent.wheel_ticks_y = static_cast<float>(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep; webEvent.phase = toBlinkPhase(ev); - webEvent.has_precise_scrolling_deltas = true; +#if defined(Q_OS_DARWIN) + // has_precise_scrolling_deltas is a macOS term meaning it is a system scroll gesture, see qnsview_mouse.mm + webEvent.has_precise_scrolling_deltas = (ev->source() == Qt::MouseEventSynthesizedBySystem); +#endif + setBlinkWheelEventDelta(webEvent); return webEvent; @@ -1455,6 +1459,10 @@ bool WebEventFactory::coalesceWebWheelEvent(blink::WebMouseWheelEvent &webEvent, return false; if (toBlinkPhase(ev) != webEvent.phase) return false; +#if defined(Q_OS_DARWIN) + if (webEvent.has_precise_scrolling_deltas != (ev->source() == Qt::MouseEventSynthesizedBySystem)) + return false; +#endif webEvent.SetTimeStamp(currentTimeForEvent(ev)); webEvent.SetPositionInWidget(ev->x() / dpiScale, ev->y() / dpiScale); diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index 39901e693..3bc0be196 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -166,6 +166,9 @@ QQuickWebEngineViewPrivate::~QQuickWebEngineViewPrivate() adapter->stopFinding(); if (faviconProvider) faviconProvider->detach(q_ptr); + // q_ptr->d_ptr might be null due to destroy() + if (q_ptr->d_ptr) + bindViewAndWidget(q_ptr, nullptr); } void QQuickWebEngineViewPrivate::initializeProfile() @@ -188,10 +191,11 @@ bool QQuickWebEngineViewPrivate::profileInitialized() const void QQuickWebEngineViewPrivate::destroy() { - // the profile for this web contens is about to be - // garbage collected, delete WebContent first and - // let the QQuickWebEngineView be collected later by gc. - delete q_ptr->d_ptr.take(); + // The profile for this web contents is about to be + // garbage collected, delete WebContents first and + // let the QQuickWebEngineView be collected later by gc. + bindViewAndWidget(q_ptr, nullptr); + delete q_ptr->d_ptr.take(); } UIDelegatesManager *QQuickWebEngineViewPrivate::ui() |