diff --git a/fix_webkit_tests.patch b/fix_webkit_tests.patch new file mode 100644 index 0000000..41d61e2 --- /dev/null +++ b/fix_webkit_tests.patch @@ -0,0 +1,73 @@ +From 1622a5c9c2f123ef27fc3a52938162a68892e725 Mon Sep 17 00:00:00 2001 +From: Scott Talbert +Date: Thu, 1 Feb 2024 20:36:50 -0500 +Subject: [PATCH 1/4] Fix WebView tests with WebKitGTK 2.43+ + +It seems that WebKitGTK is now failing to navigate to about: URLs unless +they are about:blank or about:srcdoc, so use about:srcdoc as the +alternate URL to fix the WebView tests. + +Ref: https://github.com/WebKit/WebKit/commit/3c3163e71f647db507949ecebad35d0f2ffb33f3 +--- + tests/controls/webtest.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +Index: wxWidgets-3.2.6/samples/webview/webview.cpp +=================================================================== +--- wxWidgets-3.2.6.orig/samples/webview/webview.cpp ++++ wxWidgets-3.2.6/samples/webview/webview.cpp +@@ -992,38 +992,38 @@ void WebFrame::OnToolsClicked(wxCommandE + } + m_histMenuItems.clear(); + +- wxVector > back = m_browser->GetBackwardHistory(); +- wxVector > forward = m_browser->GetForwardHistory(); ++ // We can't use empty labels for the menu items, so use this helper to give ++ // them at least some name if we don't have anything better. ++ const auto makeLabel = [](const wxString& title) ++ { ++ return title.empty() ? "(untitled)" : title; ++ }; + + wxMenuItem* item; + +- unsigned int i; +- for(i = 0; i < back.size(); i++) ++ for ( const auto& histItem : m_browser->GetBackwardHistory() ) + { +- wxString title = back[i]->GetTitle(); +- if ( title.empty() ) ++ wxString title = histItem->GetTitle() ++ if ( title.empty() ) + title = "(untitled)"; +- item = m_tools_history_menu->AppendRadioItem(wxID_ANY, title); +- m_histMenuItems[item->GetId()] = back[i]; ++ item = m_tools_history_menu->AppendRadioItem(wxID_ANY, makeLabel(title)); ++ m_histMenuItems[item->GetId()] = histItem; + Bind(wxEVT_MENU, &WebFrame::OnHistory, this, item->GetId()); + } + +- wxString title = m_browser->GetCurrentTitle(); +- if ( title.empty() ) +- title = "(untitled)"; +- item = m_tools_history_menu->AppendRadioItem(wxID_ANY, title); ++ item = m_tools_history_menu->AppendRadioItem(wxID_ANY, makeLabel(m_browser->GetCurrentTitle())); + item->Check(); + + //No need to connect the current item + m_histMenuItems[item->GetId()] = wxSharedPtr(new wxWebViewHistoryItem(m_browser->GetCurrentURL(), m_browser->GetCurrentTitle())); + +- for(i = 0; i < forward.size(); i++) ++ for ( const auto& histItem : m_browser->GetForwardHistory() ) + { +- wxString title = forward[i]->GetTitle(); ++ wxString title = histItem->GetTitle() + if ( title.empty() ) + title = "(untitled)"; +- item = m_tools_history_menu->AppendRadioItem(wxID_ANY, title); +- m_histMenuItems[item->GetId()] = forward[i]; ++ item = m_tools_history_menu->AppendRadioItem(wxID_ANY, makeLabel(title)); ++ m_histMenuItems[item->GetId()] = histItem; + Bind(wxEVT_TOOL, &WebFrame::OnHistory, this, item->GetId()); + } + diff --git a/wxWidgets-3_2.changes b/wxWidgets-3_2.changes index a890f67..e86fcd8 100644 --- a/wxWidgets-3_2.changes +++ b/wxWidgets-3_2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Oct 7 10:36:47 UTC 2024 - Markéta Machová + +- Add upstream fix_webkit_tests.patch to fix webview tests with + WebKitGTK 2.43+. + ------------------------------------------------------------------- Tue Oct 1 09:33:13 UTC 2024 - Markéta Machová diff --git a/wxWidgets-3_2.spec b/wxWidgets-3_2.spec index 0e9a1e8..546fa99 100644 --- a/wxWidgets-3_2.spec +++ b/wxWidgets-3_2.spec @@ -85,6 +85,7 @@ Patch1: autoconf-2_72.diff Patch2: textfiletest-fix-file-exists.diff # PATCH-FIX-UPSTREAM https://github.com/wxWidgets/wxWidgets/pull/24814 Fix docs generation for datetime with doxygen 1.11.0 Patch3: doxygen111.patch +Patch4: fix_webkit_tests.patch %if "%{flavor}" == "doc" BuildRequires: doxygen BuildRequires: fdupes