diff options
| author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2024-12-19 09:20:21 +0200 |
|---|---|---|
| committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2024-12-19 09:20:21 +0200 |
| commit | 45c01c6e389f639948db46d627b0b378565aeda6 (patch) | |
| tree | 1e36071df810b89f89274001d4ee1695ccd8190b | |
| parent | 74bcc15b4837374491a173a82bcc1d5865cd5fbd (diff) | |
| parent | 1e355341de6d8c2801c039e04b3c14b1c9d5d008 (diff) | |
Merge tag 'v6.2.11-lts' into tqtc/lts-6.2-opensource
Qt 6.2.11-lts release
Conflicts solved:
.cmake.conf
dependencies.yaml
Change-Id: Ib1f8250a04c00cf4eac9fbdca76a91528f73a1de
22 files changed, 188 insertions, 72 deletions
diff --git a/.cmake.conf b/.cmake.conf index d9b3c415c..e019b1f82 100644 --- a/.cmake.conf +++ b/.cmake.conf @@ -1,3 +1,3 @@ -set(QT_REPO_MODULE_VERSION "6.2.10") +set(QT_REPO_MODULE_VERSION "6.2.11") set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "") set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_WEBENGINE "3.19") diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION index ea03ba173..21a6b0c46 100644 --- a/CHROMIUM_VERSION +++ b/CHROMIUM_VERSION @@ -1,3 +1,3 @@ Based on Chromium version: 108.0.5359.181 -Patched with security patches up to Chromium version: 117.0.5938.63 +Patched with security patches up to Chromium version: 119.0.6045.199 diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake index 73a06d59f..f8bcf9a9a 100644 --- a/cmake/Functions.cmake +++ b/cmake/Functions.cmake @@ -918,6 +918,8 @@ macro(append_compiler_linker_sdk_setup) endif() extend_gn_list(gnArgArg ARGS is_clang CONDITION CLANG) + extend_gn_list(gnArgArg ARGS is_msvc CONDITION MSVC) + if(CLANG) if(MACOS) get_darwin_sdk_version(macSdkVersion) @@ -976,7 +978,7 @@ macro(append_compiler_linker_sdk_setup) endif() endif() - if(WIN32) + if(MSVC) get_filename_component(windowsSdkPath $ENV{WINDOWSSDKDIR} ABSOLUTE) get_filename_component(visualStudioPath $ENV{VSINSTALLDIR} ABSOLUTE) list(APPEND gnArgArg @@ -1051,6 +1053,11 @@ macro(append_sanitizer_setup) ARGS is_ubsan is_ubsan_vptr CONDITION undefined IN_LIST ECM_ENABLE_SANITIZERS ) + if(MACOS) + list(APPEND gnArgArg + clang_version="${QT_COMPILER_VERSION_MAJOR}.${QT_COMPILER_VERSION_MINOR}.${QT_COMPILER_VERSION_PATCH}" + ) + endif() endif() endmacro() diff --git a/configure.cmake b/configure.cmake index 579125d04..ed6f8d1f2 100644 --- a/configure.cmake +++ b/configure.cmake @@ -574,19 +574,16 @@ ${xcbErrorMessage}" ) add_check_for_support( MODULES QtWebEngine QtPdf - CONDITION + CONDITION MSVC OR (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR (LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) OR - (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL MSVC) OR - (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL Clang AND - CMAKE_CXX_SIMULATE_ID STREQUAL MSVC) OR (MACOS AND CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) OR (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) OR (ANDROID AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) MESSAGE "${CMAKE_CXX_COMPILER_ID} compiler is not supported." ) if(WIN32) - if(CMAKE_CXX_COMPILER_ID STREQUAL MSVC) + if(MSVC) add_check_for_support( MODULES QtWebEngine QtPdf CONDITION NOT MSVC_VERSION LESS 1929 diff --git a/examples/pdf/multipage/doc/src/multipage.qdoc b/examples/pdf/multipage/doc/src/multipage.qdoc index b9fec15a9..fff8b0d11 100644 --- a/examples/pdf/multipage/doc/src/multipage.qdoc +++ b/examples/pdf/multipage/doc/src/multipage.qdoc @@ -5,7 +5,7 @@ \example multipage \meta installpath pdf \ingroup qtpdf-examples - \examplecategory {Graphics & Multimedia} + \examplecategory {User Interface Components} \title PDF Multipage Viewer Example \brief A Qt Quick PDF viewer that allows scrolling through the pages. diff --git a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc index 0c9fa06a9..b56958a9f 100644 --- a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc +++ b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc @@ -5,7 +5,7 @@ \example pdfviewer \meta installpath pdfwidgets \ingroup qtpdf-examples - \examplecategory {Graphics & Multimedia} + \examplecategory {User Interface Components} \title PDF Viewer Widget Example \brief A widget-based PDF viewer that allows scrolling through the pages. diff --git a/src/3rdparty b/src/3rdparty -Subproject ef090c47d08c734ae2b3c1db508982aca0f3ee1 +Subproject 21bb29b9b730cc215ee7dfb3cf343139a9be952 diff --git a/src/core/api/qwebengineprofile.cpp b/src/core/api/qwebengineprofile.cpp index ab873e345..2defebdaf 100644 --- a/src/core/api/qwebengineprofile.cpp +++ b/src/core/api/qwebengineprofile.cpp @@ -495,7 +495,10 @@ QWebEngineProfile::HttpCacheType QWebEngineProfile::httpCacheType() const /*! Sets the HTTP cache type to \a httpCacheType. - \sa httpCacheType(), setCachePath() + \note Setting the \a httpCacheType to NoCache on the profile, which has already some cache + entries does not trigger the removal of those entries. + + \sa httpCacheType(), setCachePath(), clearHttpCache() */ void QWebEngineProfile::setHttpCacheType(QWebEngineProfile::HttpCacheType httpCacheType) { diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp index 24c006dc5..4b8e947c0 100644 --- a/src/core/browser_accessibility_qt.cpp +++ b/src/core/browser_accessibility_qt.cpp @@ -25,6 +25,8 @@ public: BrowserAccessibilityQt(content::BrowserAccessibilityManager *manager, ui::AXNode *node); ~BrowserAccessibilityQt(); + bool isReady() const; + QtWebEngineCore::BrowserAccessibilityInterface *interface = nullptr; }; @@ -144,6 +146,13 @@ BrowserAccessibilityQt::~BrowserAccessibilityQt() interface->destroy(); } +bool BrowserAccessibilityQt::isReady() const +{ + // FIXME: This is just a workaround, remove this when the commented out assert in + // BrowserAccessibilityManager::GetFromID(int32_t id) gets fixed. + return manager()->GetFromID(node()->id()) != nullptr; +} + BrowserAccessibilityInterface::BrowserAccessibilityInterface(BrowserAccessibilityQt *chromiumInterface) : q(chromiumInterface) { @@ -169,6 +178,9 @@ void BrowserAccessibilityInterface::destroy() bool BrowserAccessibilityInterface::isValid() const { + if (!q->isReady()) + return false; + auto managerQt = static_cast<content::BrowserAccessibilityManagerQt *>(q->manager()); return managerQt && managerQt->isValid(); } @@ -219,11 +231,7 @@ void *BrowserAccessibilityInterface::interface_cast(QAccessible::InterfaceType t } case QAccessible::TableCellInterface: { QAccessible::Role r = role(); - if (r == QAccessible::Cell) { - Q_ASSERT(findTable()); - return static_cast<QAccessibleTableCellInterface *>(this); - } - if (r == QAccessible::ListItem || r == QAccessible::TreeItem) { + if (r == QAccessible::Cell || r == QAccessible::ListItem || r == QAccessible::TreeItem) { if (findTable()) return static_cast<QAccessibleTableCellInterface *>(this); } @@ -276,6 +284,9 @@ int BrowserAccessibilityInterface::indexOfChild(const QAccessibleInterface *ifac QString BrowserAccessibilityInterface::text(QAccessible::Text t) const { + if (!q->isReady()) + return QString(); + switch (t) { case QAccessible::Name: return toQt(q->GetStringAttribute(ax::mojom::StringAttribute::kName)); @@ -297,7 +308,7 @@ void BrowserAccessibilityInterface::setText(QAccessible::Text t, const QString & QRect BrowserAccessibilityInterface::rect() const { - if (!q->manager()) // needed implicitly by GetScreenBoundsRect() + if (!q->manager() || !q->isReady()) // needed implicitly by GetScreenBoundsRect() return QRect(); gfx::Rect bounds = q->GetUnclippedScreenBoundsRect(); bounds = gfx::ScaleToRoundedRect(bounds, 1.f / q->manager()->device_scale_factor()); // FIXME: check @@ -699,6 +710,11 @@ QAccessible::Role BrowserAccessibilityInterface::role() const QAccessible::State BrowserAccessibilityInterface::state() const { QAccessible::State state = QAccessible::State(); + if (!q->isReady()) { + state.invalid = true; + return state; + } + if (q->HasState(ax::mojom::State::kCollapsed)) state.collapsed = true; if (q->HasState(ax::mojom::State::kDefault)) diff --git a/src/core/compositor/compositor.cpp b/src/core/compositor/compositor.cpp index c147f988b..d576e0923 100644 --- a/src/core/compositor/compositor.cpp +++ b/src/core/compositor/compositor.cpp @@ -94,10 +94,8 @@ void Compositor::Observer::unbind() Compositor::Handle<Compositor> Compositor::Observer::compositor() { - if (!m_binding) - return nullptr; g_bindings.lock(); - if (m_binding->compositor) + if (m_binding && m_binding->compositor) return m_binding->compositor; // delay unlock g_bindings.unlock(); return nullptr; @@ -128,10 +126,8 @@ void Compositor::unbind() Compositor::Handle<Compositor::Observer> Compositor::observer() { - if (!m_binding) - return nullptr; g_bindings.lock(); - if (m_binding->observer) + if (m_binding && m_binding->observer) return m_binding->observer; // delay unlock g_bindings.unlock(); return nullptr; diff --git a/src/core/doc/qtwebengine.qdocconf b/src/core/doc/qtwebengine.qdocconf index 5cbe9e500..d322cc285 100644 --- a/src/core/doc/qtwebengine.qdocconf +++ b/src/core/doc/qtwebengine.qdocconf @@ -31,7 +31,8 @@ qhp.QtWebEngine.subprojects.examples.selectors = doc:example qhp.QtWebEngine.subprojects.examples.sortPages = true manifestmeta.highlighted.names += "QtWebEngine/WebEngine Widgets Simple Browser Example" \ - "QtWebEngine/WebEngine Quick Nano Browser" + "QtWebEngine/WebEngine Quick Nano Browser" \ + "QtWebEngine/Recipe Browser" tagfile = ../../../doc/qtwebengine/qtwebengine.tags diff --git a/src/core/doc/src/qtwebengine-deploying.qdoc b/src/core/doc/src/qtwebengine-deploying.qdoc index 625570fee..502bffe9d 100644 --- a/src/core/doc/src/qtwebengine-deploying.qdoc +++ b/src/core/doc/src/qtwebengine-deploying.qdoc @@ -141,6 +141,10 @@ \section2 \macos Specific Deployment Steps + To deploy a \QWE application on \maocs, you will need to ensure that the \QWE process is signed + with an entitlements file that at least contains the entitlements listed in + QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/Resources/QtWebEngineProcess.entitlements. + To deploy a \QWE application that accesses the microphone or camera on \macos, you will need to provide texts for the messages that will be shown to the user to explain why the application asks for permission to access to the camera or microphone. diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp index e9e9aaeda..4ed45c020 100644 --- a/src/core/profile_adapter.cpp +++ b/src/core/profile_adapter.cpp @@ -345,8 +345,6 @@ void ProfileAdapter::setHttpCacheType(ProfileAdapter::HttpCacheType newhttpCache return; if (!m_offTheRecord && !m_profile->m_profileIOData->isClearHttpCacheInProgress()) { m_profile->m_profileIOData->resetNetworkContext(); - if (m_httpCacheType == NoCache) - clearHttpCache(); } } diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 37f3b13ac..83066e811 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -210,10 +210,28 @@ static std::unique_ptr<content::WebContents> createBlankWebContents(WebContentsA return webContents; } +static int navigationListSize(content::NavigationController &controller) { + // If we're currently on the initial NavigationEntry, no navigation has + // committed, so the initial NavigationEntry should not be part of the + // "Navigation List", and we should return 0 as the navigation list size. + if (controller.GetLastCommittedEntry()->IsInitialEntry()) + return 0; + return controller.GetEntryCount(); +} + +static int navigationListCurrentIndex(content::NavigationController &controller) { + // If we're currently on the initial NavigationEntry, no navigation has + // committed, so the initial NavigationEntry should not be part of the + // "Navigation List", and we should return -1 as the current index. + if (controller.GetLastCommittedEntry()->IsInitialEntry()) + return -1; + return controller.GetCurrentEntryIndex(); +} + static void serializeNavigationHistory(content::NavigationController &controller, QDataStream &output) { - const int currentIndex = controller.GetCurrentEntryIndex(); - const int count = controller.GetEntryCount(); + const int currentIndex = navigationListCurrentIndex(controller); + const int count = navigationListSize(controller); const int pendingIndex = controller.GetPendingEntryIndex(); output << kHistoryStreamVersion; @@ -535,6 +553,8 @@ void WebContentsAdapter::initializeRenderPrefs() ? blink::kWebRTCIPHandlingDefaultPublicInterfaceOnly : blink::kWebRTCIPHandlingDefault; #endif + rendererPrefs->can_accept_load_drops = m_adapterClient->webEngineSettings()->testAttribute(QWebEngineSettings::NavigateOnDropEnabled); + // Set web-contents font settings to the default font settings as Chromium constantly overrides // the global font defaults with the font settings of the latest web-contents created. static const gfx::FontRenderParams params = gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr); @@ -909,13 +929,13 @@ void WebContentsAdapter::navigateToOffset(int offset) int WebContentsAdapter::navigationEntryCount() { CHECK_INITIALIZED(0); - return m_webContents->GetController().GetEntryCount(); + return navigationListSize(m_webContents->GetController()); } int WebContentsAdapter::currentNavigationEntryIndex() { CHECK_INITIALIZED(0); - return m_webContents->GetController().GetCurrentEntryIndex(); + return navigationListCurrentIndex(m_webContents->GetController()); } QUrl WebContentsAdapter::getNavigationEntryOriginalUrl(int index) diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 973da88a7..52be749c2 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -178,31 +178,6 @@ bool usingSoftwareDynamicGL() #endif } -#if defined(Q_OS_WIN) -static QString getAdapterLuid() { - static const bool preferSoftwareDevice = qEnvironmentVariableIntValue("QSG_RHI_PREFER_SOFTWARE_RENDERER"); - QRhiD3D11InitParams rhiParams; - QRhi::Flags flags; - if (preferSoftwareDevice) { - flags |= QRhi::PreferSoftwareRenderer; - } - QScopedPointer<QRhi> rhi(QRhi::create(QRhi::D3D11,&rhiParams,flags,nullptr)); - // mimic what QSGRhiSupport and QBackingStoreRhi does - if (!rhi && !preferSoftwareDevice) { - flags |= QRhi::PreferSoftwareRenderer; - rhi.reset(QRhi::create(QRhi::D3D11, &rhiParams, flags)); - } - if (rhi) { - const QRhiD3D11NativeHandles *handles = - static_cast<const QRhiD3D11NativeHandles *>(rhi->nativeHandles()); - Q_ASSERT(handles); - return QString("%1,%2").arg(handles->adapterLuidHigh).arg(handles->adapterLuidLow); - } else { - return QString(); - } -} -#endif - static bool openGLPlatformSupport() { return QGuiApplicationPrivate::platformIntegration()->hasCapability( @@ -278,6 +253,31 @@ static const char *getGLType(bool /*enableGLSoftwareRendering*/, bool disableGpu } #endif // QT_CONFIG(opengl) +#if defined(Q_OS_WIN) +static QString getAdapterLuid() { + static const bool preferSoftwareDevice = qEnvironmentVariableIntValue("QSG_RHI_PREFER_SOFTWARE_RENDERER"); + QRhiD3D11InitParams rhiParams; + QRhi::Flags flags; + if (preferSoftwareDevice) { + flags |= QRhi::PreferSoftwareRenderer; + } + QScopedPointer<QRhi> rhi(QRhi::create(QRhi::D3D11,&rhiParams,flags,nullptr)); + // mimic what QSGRhiSupport and QBackingStoreRhi does + if (!rhi && !preferSoftwareDevice) { + flags |= QRhi::PreferSoftwareRenderer; + rhi.reset(QRhi::create(QRhi::D3D11, &rhiParams, flags)); + } + if (rhi) { + const QRhiD3D11NativeHandles *handles = + static_cast<const QRhiD3D11NativeHandles *>(rhi->nativeHandles()); + Q_ASSERT(handles); + return QString("%1,%2").arg(handles->adapterLuidHigh).arg(handles->adapterLuidLow); + } else { + return QString(); + } +} +#endif + #if QT_CONFIG(webengine_pepper_plugins) void dummyGetPluginCallback(const std::vector<content::WebPluginInfo>&) { @@ -720,6 +720,9 @@ WebEngineContext::WebEngineContext() enableFeatures.push_back(features::kNetworkServiceInProcess.name); enableFeatures.push_back(features::kTracingServiceInProcess.name); +#if QT_CONFIG(webengine_webrtc_pipewire) + enableFeatures.push_back(features::kWebRtcPipeWireCapturer.name); +#endif // When enabled, event.movement is calculated in blink instead of in browser. disableFeatures.push_back(features::kConsolidatedMovementXY.name); @@ -971,7 +974,7 @@ const char *qWebEngineChromiumVersion() noexcept const char *qWebEngineChromiumSecurityPatchVersion() noexcept { - return "117.0.5938.63"; // FIXME: Remember to update + return "119.0.6045.199"; // FIXME: Remember to update } QT_END_NAMESPACE diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp index 906f9fb72..520bc6499 100644 --- a/src/core/web_engine_settings.cpp +++ b/src/core/web_engine_settings.cpp @@ -441,6 +441,11 @@ bool WebEngineSettings::applySettingsToRendererPreferences(blink::RendererPrefer } } #endif + bool canNavigateOnDrop = testAttribute(QWebEngineSettings::NavigateOnDropEnabled); + if (canNavigateOnDrop != prefs->can_accept_load_drops) { + prefs->can_accept_load_drops = canNavigateOnDrop; + changed = true; + } return changed; } diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt index e79bbd85e..a752a7c07 100644 --- a/src/pdf/CMakeLists.txt +++ b/src/pdf/CMakeLists.txt @@ -189,7 +189,7 @@ foreach(arch ${archs}) CONDITION QT_FEATURE_pdf_xfa_tiff ) extend_gn_list(gnArgArg - ARGS pdfium_use_system_zlib + ARGS pdfium_use_system_zlib use_system_zlib CONDITION QT_FEATURE_webengine_system_zlib ) extend_gn_list(gnArgArg diff --git a/src/pdf/configure/BUILD.root.gn.in b/src/pdf/configure/BUILD.root.gn.in index 3918c1e9f..333e541ab 100644 --- a/src/pdf/configure/BUILD.root.gn.in +++ b/src/pdf/configure/BUILD.root.gn.in @@ -59,7 +59,7 @@ static_library("QtPdf") { deps = [ "//third_party/pdfium" ] - if (is_win) { + if (is_msvc) { libs = [ "dloadhelper.lib", "winmm.lib", diff --git a/src/pdf/qpdfbookmarkmodel.cpp b/src/pdf/qpdfbookmarkmodel.cpp index 78d89cc9b..93dbf5d1f 100644 --- a/src/pdf/qpdfbookmarkmodel.cpp +++ b/src/pdf/qpdfbookmarkmodel.cpp @@ -260,6 +260,10 @@ QPdfDocument* QPdfBookmarkModel::document() const return d->m_document; } +/*! + \property QPdfBookmarkModel::document + \brief the PDF document in which bookmarks are to be found. +*/ void QPdfBookmarkModel::setDocument(QPdfDocument *document) { if (d->m_document == document) diff --git a/tests/auto/widgets/accessibility/tst_accessibility.cpp b/tests/auto/widgets/accessibility/tst_accessibility.cpp index 68566c082..f2cd4d05d 100644 --- a/tests/auto/widgets/accessibility/tst_accessibility.cpp +++ b/tests/auto/widgets/accessibility/tst_accessibility.cpp @@ -50,6 +50,7 @@ private Q_SLOTS: void roles(); void objectName(); void crossTreeParent(); + void tableCellInterface(); }; // This will be called before the first test function is executed. @@ -605,6 +606,58 @@ void tst_Accessibility::crossTreeParent() QCOMPARE(p->object()->objectName(), QStringLiteral("my_id")); } +void tst_Accessibility::tableCellInterface() +{ + QWebEngineView webView; + webView.resize(400, 400); + webView.show(); + QVERIFY(QTest::qWaitForWindowExposed(&webView)); + + QSignalSpy spyFinished(&webView, &QWebEngineView::loadFinished); + webView.setHtml(QLatin1String( + "<html><body>" + " <ul>" + " <li><a href='#link1' id='link1'>Link in ListItem</a></li>" + " </ul>" + "" + " <div role='rowgroup'>" + " <div role='row'>" + " <span role='cell'><a href='#link2' id='link2'>Link in Cell</a></span>" + " </div>" + " </div>" + "</body></html>")); + QTRY_COMPARE(spyFinished.size(), 1); + + QAccessibleInterface *view = QAccessible::queryAccessibleInterface(&webView); + QAccessibleInterface *document = view->child(0); + QTRY_COMPARE(document->childCount(), 2); + + // ListItem without Table parent. + { + QAccessibleInterface *list = document->child(0); + QAccessibleInterface *listItem = list->child(0); + QVERIFY(!listItem->tableCellInterface()); + + // Should not crash. + QPoint linkCenter = elementCenter(webView.page(), QLatin1String("link1")); + QTest::mouseClick(webView.focusProxy(), Qt::LeftButton, {}, linkCenter); + QTRY_COMPARE(webView.url().fragment(), QLatin1String("link1")); + } + + // Cell without Table parent. + { + QAccessibleInterface *rowgroup = document->child(1); + QAccessibleInterface *row = rowgroup->child(0); + QAccessibleInterface *cell = row->child(0); + QVERIFY(!cell->tableCellInterface()); + + // Should not crash. + QPoint linkCenter = elementCenter(webView.page(), QLatin1String("link2")); + QTest::mouseClick(webView.focusProxy(), Qt::LeftButton, {}, linkCenter); + QTRY_COMPARE(webView.url().fragment(), QLatin1String("link2")); + } +} + static QByteArrayList params = QByteArrayList() << "--force-renderer-accessibility" << "--enable-features=AccessibilityExposeARIAAnnotations"; diff --git a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp index 6ddc031d5..ad66e972c 100644 --- a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp +++ b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp @@ -487,9 +487,9 @@ void tst_QWebEngineHistory::clear() QWebEnginePage page2(this); QWebEngineHistory* hist2 = page2.history(); - QCOMPARE(hist2->count(), 1); + QCOMPARE(hist2->count(), 0); hist2->clear(); - QCOMPARE(hist2->count(), 1); // Do not change anything. + QCOMPARE(hist2->count(), 0); // Do not change anything. } void tst_QWebEngineHistory::historyItemFromDeletedPage() diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 132cefb04..c5d4e2e57 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -278,6 +278,9 @@ private: QWebEngineView* m_view; QWebEnginePage* m_page; + QScopedPointer<QPointingDevice> s_touchDevice = + QScopedPointer<QPointingDevice>(QTest::createTouchDevice()); + QString tmpDirPath() const { static QString tmpd = QDir::tempPath() + "/tst_qwebenginepage-" @@ -285,13 +288,13 @@ private: return tmpd; } - QScopedPointer<QPointingDevice> s_touchDevice; - void makeClick(QWindow *window, bool withTouch = false, const QPoint &p = QPoint()) { + void makeClick(const QPointer<QWindow> window, bool withTouch = false, + const QPoint &p = QPoint()) + { + QVERIFY2(window, "window is gone"); if (!withTouch) { QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), p); } else { - if (!s_touchDevice) - s_touchDevice.reset(QTest::createTouchDevice()); QTest::touchEvent(window, s_touchDevice.get()).press(1, p); QTest::touchEvent(window, s_touchDevice.get()).release(1, p); } @@ -1358,6 +1361,9 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterMove_data() void tst_QWebEnginePage::comboBoxPopupPositionAfterMove() { +#if defined(Q_OS_MACOS) && (defined(__arm64__) || defined(__aarch64__)) + QSKIP("This test crashes for Apple M1"); +#endif QWebEngineView view; view.move(QGuiApplication::primaryScreen()->availableGeometry().topLeft()); view.resize(640, 480); @@ -1370,7 +1376,7 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterMove() QTRY_COMPARE(spyLoadFinished.size(), 1); const auto oldTlws = QGuiApplication::topLevelWindows(); QFETCH(bool, withTouch); - QWindow *window = view.windowHandle(); + QPointer<QWindow> window = view.windowHandle(); auto pos = elementCenter(view.page(), "foo"); makeClick(window, withTouch, pos); QWindow *popup = nullptr; @@ -1420,6 +1426,9 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove_data() void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove() { +#if defined(Q_OS_MACOS) && (defined(__arm64__) || defined(__aarch64__)) + QSKIP("This test crashes for Apple M1"); +#endif QWidget mainWidget; mainWidget.setLayout(new QHBoxLayout); @@ -1443,7 +1452,7 @@ void tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove() const auto oldTlws = QGuiApplication::topLevelWindows(); QFETCH(bool, withTouch); - QWindow *window = view.window()->windowHandle(); + QPointer<QWindow> window = view.window()->windowHandle(); makeClick(window, withTouch, view.mapTo(view.window(), elementCenter(view.page(), "foo"))); QWindow *popup = nullptr; @@ -2072,14 +2081,14 @@ void tst_QWebEnginePage::symmetricUrl() QVERIFY(view.url().isEmpty()); - QCOMPARE(view.history()->count(), 1); + QCOMPARE(view.history()->count(), 0); QUrl dataUrl("data:text/html,<h1>Test"); view.setUrl(dataUrl); view.show(); QCOMPARE(view.url(), dataUrl); - QCOMPARE(view.history()->count(), 1); + QCOMPARE(view.history()->count(), 0); // loading is _not_ immediate, so the text isn't set just yet. QVERIFY(toPlainTextSync(view.page()).isEmpty()); @@ -2392,7 +2401,7 @@ void tst_QWebEnginePage::setHtmlWithBaseURL() QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].height").toInt(), 128); // no history item has to be added. - QCOMPARE(m_view->page()->history()->count(), 1); + QCOMPARE(m_view->page()->history()->count(), 0); } class MyPage : public QWebEnginePage @@ -2823,7 +2832,7 @@ void tst_QWebEnginePage::setUrlHistory() int expectedLoadFinishedCount = 0; QSignalSpy spy(m_page, SIGNAL(loadFinished(bool))); - QCOMPARE(m_page->history()->count(), 1); + QCOMPARE(m_page->history()->count(), 0); m_page->setUrl(QUrl()); expectedLoadFinishedCount++; @@ -2897,7 +2906,7 @@ void tst_QWebEnginePage::setUrlUsingStateObject() QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); int expectedUrlChangeCount = 0; - QCOMPARE(m_page->history()->count(), 1); + QCOMPARE(m_page->history()->count(), 0); url = QUrl("qrc:/resources/test1.html"); m_page->setUrl(url); @@ -3722,7 +3731,7 @@ void tst_QWebEnginePage::openLinkInNewPage() QCOMPARE(page1.history()->count(), 1); else QCOMPARE(page1.history()->count(), 2); - QCOMPARE(page2.history()->count(), 1); + QCOMPARE(page2.history()->count(), 0); break; case Effect::LoadInOther: QTRY_COMPARE(page2.spy.size(), 1); |
