[Webkit-unassigned] [Bug 234874] New: WebKit browser scrollbars not always correctly displayed if overlay scrollbars are disabled

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 5 02:45:15 PST 2022


            Bug ID: 234874
           Summary: WebKit browser scrollbars not always correctly
                    displayed if overlay scrollbars are disabled
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKitGTK
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: simeon.danailov.andreev at gmail.com
                CC: bugs-noreply at webkitgtk.org

Created attachment 448372

  --> https://bugs.webkit.org/attachment.cgi?id=448372&action=review

Recording of using the reproducer from the description, showcasing the scrollbar bug.

Description of problem:

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)

How reproducible:

Run snippet provided below.

Steps to Reproduce:

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

<style CHARSET="ISO-8859-1" TYPE="text/css">
html         { font-size: 10pt; }
<body style="overflow:scroll;" text="#1a1a1a" bgcolor="#ffffff">
<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)
<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>

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

    // Make sure the main window and all its contents are visible

    // Run the main GTK+ event loop

    return 0;

static void destroyWindowCb(GtkWidget* widget, GtkWidget* window)

static gboolean closeWebViewCb(WebKitWebView* webView, GtkWidget* 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.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220105/eabb3d30/attachment-0001.htm>

More information about the webkit-unassigned mailing list