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 2037016 - WebKit horizontal scrollbar not correctly displayed if theme enables steppers
Summary: WebKit horizontal scrollbar not correctly displayed if theme enables steppers
Keywords:
Status: CLOSED ERRATA
Alias: None
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-04 16:28 UTC by Simeon Andreev
Modified: 2022-06-08 08:39 UTC (History)
5 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:28 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Screenshot of the reproducer snippet, with enabled scrollbar steppers and disabled overlay scrollbars. (23.58 KB, image/png)
2022-01-04 16:28 UTC, Simeon Andreev
no flags Details
Recording of the reproduction snippet, if scrollbar steppers and overlay scrollbars are enabled. (247.12 KB, video/mp4)
2022-01-04 16:30 UTC, Simeon Andreev
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-106812 0 None None None 2022-01-04 16:34:03 UTC
Red Hat Product Errata RHBA-2022:2349 0 None None None 2022-05-17 12:34:46 UTC
WebKit Project 234871 0 None None None 2022-01-05 07:56:01 UTC

Description Simeon Andreev 2022-01-04 16:28:48 UTC
Created attachment 1848883 [details]
Screenshot of the reproducer snippet, with enabled scrollbar steppers and disabled overlay scrollbars.

Description of problem:

The following theme code breaks WebKit horizontal scrollbars:

* { -GtkScrollbar-has-backward-stepper: true; -GtkScrollbar-has-forward-stepper: true; }


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. Adjust the user .css to enable scrollbar steppers (create a backup beforehand if user .css already exists):

echo "* { -GtkScrollbar-has-backward-stepper: true; -GtkScrollbar-has-forward-stepper: true; }" > ~/.config/gtk-3.0/gtk.css

2. Create an .html file to display "overlay_scroll.html", with contents:

<!DOCTYPE html>
<html>
<head>
    <style>     
    div.scroll {
        margin: 4px, 4px;
        padding: 4px;
        width: 500px;
        overflow: scroll;
    }
    </style>
</head>
<body>
        <div class="scroll">
          "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
        </div>
</body>
</html>

3. 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), 300, 200);

    // 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/overlay_scroll.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;
}


4. Run the snippet with command line:

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


Actual results:

The horizontal scrollbar is not displayed correctly.

When overlay scrollbars are disabled, the horizontal scrollbar is undersized/misplaced, and a thick black bar is displayed above it.

When overlay scrollbars are enabled, the horizontal scrollbar is undersized/misplaced.

It looks like the horizontal scrollbar is drawn too low, but its hard to tell.

Expected results:

The horizontal scrollbar is displayed correctly.

Additional info:

Found while investigating Eclipse bug for JavaDoc/debugging hovers with GTK3: https://bugs.eclipse.org/bugs/show_bug.cgi?id=546961

Comment 1 Simeon Andreev 2022-01-04 16:30:48 UTC
Created attachment 1848884 [details]
Recording of the reproduction snippet, if scrollbar steppers and overlay scrollbars are enabled.

Comment 2 Michael Catanzaro 2022-01-04 17:24:40 UTC
Ack, thanks for the detailed report.

If you have a WebKit Bugzilla account, I'm going to request that you report this upstream as well. If not, I can forward it.

Comment 3 Simeon Andreev 2022-01-05 07:25:25 UTC
(In reply to Michael Catanzaro from comment #2)
> Ack, thanks for the detailed report.
> 
> If you have a WebKit Bugzilla account, I'm going to request that you report
> this upstream as well. If not, I can forward it.

I don't have an account. What is the WebKit bugzilla?

Is anyone able to register, if so I'll create an account. If not, please forward the bug.

Comment 4 Tomas Popela 2022-01-05 07:40:04 UTC
(In reply to Simeon Andreev from comment #3)
> (In reply to Michael Catanzaro from comment #2)
> > Ack, thanks for the detailed report.
> > 
> > If you have a WebKit Bugzilla account, I'm going to request that you report
> > this upstream as well. If not, I can forward it.
> 
> I don't have an account. What is the WebKit bugzilla?

https://bugs.webkit.org/

> Is anyone able to register, if so I'll create an account.

Yes, everyone is able to register there.

Comment 5 Simeon Andreev 2022-01-05 07:55:02 UTC
OK, I opened a ticket: https://bugs.webkit.org/show_bug.cgi?id=234871

Comment 6 Michael Catanzaro 2022-02-04 20:05:51 UTC
Hi, since we found a workaround in the upstream ticket, is it OK to close this issue? It certainly is a valid bug, but I don't think it's high enough priority to track downstream if you are content with the workaround.

Comment 7 Simeon Andreev 2022-02-07 15:44:13 UTC
(In reply to Michael Catanzaro from comment #6)
> Hi, since we found a workaround in the upstream ticket, is it OK to close
> this issue? It certainly is a valid bug, but I don't think it's high enough
> priority to track downstream if you are content with the workaround.

I discussed with Andrey (the colleague responsible for Eclipse maintenance at Advantest). We cannot add the suggested workaround to Eclipse, as it would affect the Eclipse UI for all themes, in particular it will also affect Adwaita. Maybe with a switch, which we enable in some way...

If there is an option to set an ENV variable, so that we can set it in our environment (that uses a theme with steppers) and so affect every WebKit based application, that would be preferable. Though I assume there isn't one? Or maybe something in the theme can be set to affect WebKit?

Comment 8 Michael Catanzaro 2022-02-07 17:45:48 UTC
OK, I'll add this back to my TODO list then. It should be fixable.

Just remember that the suggested workaround will be mandatory with GTK 4, as there it's impossible to draw system scrollbars.

Comment 12 errata-xmlrpc 2022-05-17 12:34:28 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 13 Simeon Andreev 2022-06-08 08:39:41 UTC
I validated on RHEL 9 with webkit2gtk3-2.34.6-1.el9.x86_64, the problem is gone. Thanks!


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