[Webkit-unassigned] [Bug 81209] Consistent resize events in mobile browsers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 15 06:17:21 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=81209





--- Comment #1 from Kenneth Rohde Christiansen <kenneth at webkit.org>  2012-03-15 06:17:21 PST ---
It would be great with a method for getting the scroll bar sizes. It would be useful for this and it will be useful for innerWidth etc as well.

This should be easy on most platform (using webkit for drawing scrollbars), but might be a bit more complicated on Mac and GTK, though looking at the documentation it seems doable.

Passing some pseudo code here for inspiration and because something might know of better ways of doing this.

Mac:

double horizontalScrollbarWidth()
{
    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    CGFloat width = 0;

    NSScrollView* view = NSScrollView<WebCoreFrameScrollView> *>(platformWidget());
    if (view->hasHorizontalScroller())
        width = view->horizontalScroller()->scrollerWidth();
    END_BLOCK_OBJC_EXCEPTIONS;
}

And GTK+:

double horizontalScrollbarWidth()
{
   if (!shouldCreateMainFrameScrollbar(this)
      fallback to webcore scrollbars

   GtkWidget* measuredWidget = hostWindow()->platformPageClient();
   GtkWidget* parentWidget = gtk_widget_get_parent(measuredWidget)

   if (!parentWidget)
       return 0;

   GtkWidget* sb = gtk_scrolled_window_get_hscrollbar(GTK_SCROLLED_WINDOW(parentWidget));
   if (!sb)
      return 0;

   GtkAllocation allocation;
   gtk_widget_get_allocation(sb, &allocation);

   return allocation.width;
}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list