RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2037269 - WebKit browser scrollbars not always correctly displayed if overlay scrollbars are disabled
Summary: WebKit browser scrollbars not always correctly displayed if overlay scrollbar...
Keywords:
Status: CLOSED ERRATA
Alias: None
Deadline: 2022-02-28
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: webkit2gtk3
Version: 9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Michael Catanzaro
QA Contact: Michal Odehnal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-05 10:52 UTC by Simeon Andreev
Modified: 2022-06-10 06:20 UTC (History)
4 users (show)

Fixed In Version: webkit2gtk3-2.34.6-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 12:34:30 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Recording of using the reproducer from the description, showcasing the scrollbar bug. (732.40 KB, video/mp4)
2022-01-05 10:52 UTC, Simeon Andreev
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-106861 0 None None None 2022-01-05 10:52:54 UTC
Red Hat Product Errata RHBA-2022:2349 0 None None None 2022-05-17 12:34:46 UTC
WebKit Project 234874 0 None None None 2022-01-05 22:13:31 UTC

Description Simeon Andreev 2022-01-05 10:52:05 UTC
Created attachment 1849011 [details]
Recording of using the reproducer from the description, showcasing the scrollbar bug.

Description of problem:

See WebKit bugzilla ticket: https://bugs.webkit.org/show_bug.cgi?id=234874

We observe broken scrollbars with disabled overlay scrollbars in Eclipse, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=546870

* https://bugs.eclipse.org/bugs/attachment.cgi?id=278446 (screenshot)
* https://bugs.eclipse.org/bugs/attachment.cgi?id=278447 (recording)

Screenshot and recording from the Eclipse bugs are from RHEL 7.4, where the behavior was slightly different. On RHEL 7.9+, the scrollbars are "represented" by black bars; on RHEL 7.4 (and RHEL 7.2 I believe), the area of the scrollbars has painting artifacts.


Version-Release number of selected component (if applicable):

Red Hat Enterprise Linux release 9.0 Beta (Plow)
gtk3-3.24.30-3.el9.x86_64
webkit2gtk3-2.32.3-2.el9.x86_64

How reproducible:

Run snippet provided below.

Steps to Reproduce:

1. Create an .html file "javadoc.html" to display, with contents:

<html>
<head>
<style CHARSET="ISO-8859-1" TYPE="text/css">
html         { font-size: 10pt; }
</style>
</head>
<body style="overflow:scroll;" text="#1a1a1a" bgcolor="#ffffff">
<h5>
<div style='word-wrap: break-word; position: relative; margin-left: 20px; padding-top: 2px; '>
<a href='invalid_link'>
<img alt='Open Declaration' style='border:none; position: absolute; width: 16px; height: 16px; left: -21px; ' src='file:invalid_path.png'/>
</a>void <a class='header' href='invalid_link'>java</a>.<a class='header' href='invalid_link'>io</a>.<a class='header' href='invalid_link'>PrintStream</a>.println(<span style='font-weight:normal;'></span>int x)
</div>
</h5>
<br><p>Prints an integer and then terminate the line.  This method behaves as
 though it invokes <code><a href='invalid_link'>print(int)</a></code> and then
 <code><a href='invalid_link'>println()</a></code>.<dl><dt>Parameters:</dt><dd><b>x</b>   The <code>int</code> to be printed.</dd></dl>
</body>
</html>

2. Create the GTK3 snippet "browser.cpp" with contents:

#include <gtk/gtk.h>
#include <webkit2/webkit2.h>


static void destroyWindowCb(GtkWidget* widget, GtkWidget* window);
static gboolean closeWebViewCb(WebKitWebView* webView, GtkWidget* window);

// gcc -g browser.cpp  `pkg-config --cflags --libs  webkit2gtk-4.0 gtk+-3.0` -o BrowserExample && ./BrowserExample

int main(int argc, char* argv[])
{
    // Initialize GTK+
    gtk_init(&argc, &argv);

    // Create a window that will contain the browser instance
    GtkWidget *main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_default_size(GTK_WINDOW(main_window), 400, 300);

    // Create a browser instance
    WebKitWebView *webView = WEBKIT_WEB_VIEW(webkit_web_view_new());

    // Put the browser area into the main window
    gtk_container_add(GTK_CONTAINER(main_window), GTK_WIDGET(webView));

    // Set up callbacks so that if either the main window or the browser instance is
    // closed, the program will exit
    g_signal_connect(main_window, "destroy", G_CALLBACK(destroyWindowCb), NULL);
    g_signal_connect(webView, "close", G_CALLBACK(closeWebViewCb), main_window);

    // Load a web page into the browser instance
    webkit_web_view_load_uri(webView, "file:///home/sandreev/javadoc.html");

    // Make sure that when the browser area becomes visible, it will get mouse
    // and keyboard events
    gtk_widget_grab_focus(GTK_WIDGET(webView));

    // Make sure the main window and all its contents are visible
    gtk_widget_show_all(main_window);

    // Run the main GTK+ event loop
    gtk_main();

    return 0;
}


static void destroyWindowCb(GtkWidget* widget, GtkWidget* window)
{
    gtk_main_quit();
}

static gboolean closeWebViewCb(WebKitWebView* webView, GtkWidget* window)
{
    gtk_widget_destroy(window);
    return TRUE;
}


3. Run the snippet with command line, disable overlay scrollbars:

export GTK_OVERLAY_SCROLLING=0 &&  gcc -g browser.cpp  `pkg-config --cflags --libs  webkit2gtk-4.0 gtk+-3.0` -o BrowserExample && ./BrowserExample 


Actual results:

The scrollbars are not displayed correctly. There are black bars instead of scrollbars, for most window sizes. If the window is small enough to actually require scrollbars (if overlay scrollbars were enabled) scrollbars seem to be fine.

Expected results:

The scrollbars are displayed correctly.

Additional info:

The broken scrollbars are not always seen (e.g. with .html from bug 234871, scrollbars are fine if steppers are disabled). Something in the .html snippet above seems to cause the bug; for variations of the .html (e.g. remove font size styling) I see normal scrollbars (with Adwaita theme). Maybe its the amount of text and its formatting, I'm not sure.

On the Eclipse bug, one of the previous SWT maintainers from RHEL bisected GTK3 to find the first commit which showed the problem: https://bugs.eclipse.org/bugs/show_bug.cgi?id=546870#c8

> (In reply to Eric Williams from comment #7)
> > The issue only happens on GTK3.22 or greater -- I'm currently bisecting to
> > see what broke it.
> 
> I bisected GTK and found that this patch broke it:
> https://gitlab.gnome.org/GNOME/gtk/commit/
> 9d719b99893297bdd1675217ba9a7c8575cc0d80
> 
> Specifically lines 193/194 in gdk/gdkdisplay.h. Why this is causing the
> breakage I do not know -- more investigation is needed.

I'm not sure how the changes relate to WebKit.

Comment 4 errata-xmlrpc 2022-05-17 12:34:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: webkit2gtk3), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2349

Comment 5 Simeon Andreev 2022-06-10 06:20:42 UTC
I validated the fix on RHEL 9, works as expected. Thanks!


Note You need to log in before you can comment on or make changes to this bug.