wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
5.77k stars 1.7k forks source link

F39: wxWebView draws text with the background color -> "invisible" page #24496

Open JoergHW opened 3 weeks ago

JoergHW commented 3 weeks ago

Description

Bug description:

The rendering of wxWebView per default has either ForegroundColour = BackgroundColour set or does not respect color. Additionally I tried to convince the renderer to use a colour, but failed. Using

   m_browser->SetPage
               (
                "<html><title>New Page</title>"
                "<body><h1 style=\"color:skyblue\">Page header</h1><p style=\"color:red;\">Created </p>using <tt>SetPage()</tt> method.</body></html>",  
                wxString()
               );

or

    m_browser->SetPage
               (
                "<html><title>New Page</title>"
                "<body><font color=\"red\">Created </font>using <tt>SetPage()</tt> method.</body></html>",
                wxString()
               );

instead of the original plain text, it did not make anything visible either. Just black on black.

Expected vs observed behaviour:

Expected: Text from a "web page" is visible. Observed: Text is there (check with copy & paste), but the foreground and background are identical, so it is invisible.

Stack trace:

not relevant

Patch or snippet allowing to reproduce the problem:

samples/webview

To Reproduce:

  1. start samples/webview/webview
  2. Click on 'menu -> Set Page'
  3. Observe

Platform and version information

JoergHW commented 3 weeks ago

Downloaded wxWidgets-3.2.4 and build locally: ../configure --with-gtk --disable-tests --enable-webview --enable-webviewwebkit --disable-webviewedge --disable-webviewie --without-nanosvg --enable-debug_gdb --enable-debug

vadz commented 3 weeks ago

I don't see the problem running GTK_THEME=Adwaita:dark ./webview in master: the page is visible, but it also still uses the light mode, i.e. black on white text:

image

This might be due to WebViewGtk version difference, I wonder which one does Fedora 39 use?

JoergHW commented 3 weeks ago

@vadz Tried it your way, did not change anything. The details about the render backend are slightly covered, sorry. I have installed: webkit2gtk4.1-2.44.0-2.fc39.x86_64.rpm webkit2gtk4.1-devel-2.44.0-2.fc39.x86_64.rpm webkitgtk6.0-2.44.0-2.fc39.x86_64.rpm

image

vadz commented 3 weeks ago

It could be that WebKitGtk 2.44 has implemented support for dark mode missing in my 2.42 and this breaks this somehow... Sorry, I really don't have time to debug this now.

JoergHW commented 3 weeks ago

light mode does not work better: image

Take your time ...

vadz commented 3 weeks ago

This is really unexpected, it really looks like 2.44 broke compatibility in some way.

We probably need to start by looking at their changelog.

paulcor commented 3 weeks ago

It works fine for me on Fedora 39 with the exact same webkit2gtk4.1-2.44.0-2.fc39.x86_64. Maybe something to do with that "unable to construct a complete frambuffer" message.

JoergHW commented 1 week ago

Needed to upgrade to F40 for some reason. Tried the compiled example WITHOUT modification and it works now. 18:30:55: Backend: wxWebViewWebKit Version: webkit2 2.44.1 18:30:55: User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15 The package names between F39 and F40 do not show a difference in version numbering: webkit2gtk4.1-2.44.1-1.fc40.x86_64.rpm webkit2gtk4.1-2.44.1-1.fc39.x86_64.rpm Could it be some kind of "global" configuration?