Bug 81209
Summary: | Consistent resize events in mobile browsers | ||
---|---|---|---|
Product: | WebKit | Reporter: | Allan Sandfeld Jensen <allan.jensen> |
Component: | WebKit Misc. | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | afbarstow, anssi.kostiainen, efidler, kenneth, simon.fraser, skyostil, tonikitoo, vestbo, webkit-bug-importer, zalan |
Priority: | P2 | Keywords: | BrowserCompat, InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | 81208, 111532, 80242 | ||
Bug Blocks: |
Allan Sandfeld Jensen
As seen on http://www.quirksmode.org/dom/events/resize_mobile.html all the mobile browsers treat resize-events slightly different, even between webkit browsers.
The problem is probably that the event is originally designed for the desktop-case and there has been no obvious interpretation of what it should mean on a mobile browser.
Some discussion of these issues can also be found in bug 80242.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Kenneth Rohde Christiansen
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;
}
Radar WebKit Bug Importer
<rdar://problem/66196856>