Bug 106052

Summary: [WK2] [Gtk] crash when web inspector is attached, and window height is reduced.
Product: WebKit Reporter: arno. <a.renevier>
Component: WebKitGTKAssignee: arno. <a.renevier>
Status: RESOLVED FIXED    
Severity: Normal CC: cgarcia, gustavo, mrobinson, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 106050    
Bug Blocks:    
Attachments:
Description Flags
patch proposal: detach inspector when webViewBase height becomes too small
none
patch proposal: updated patch: wrong static_cast
cgarcia: review-
A different approach mrobinson: review+

Description arno. 2013-01-03 15:26:20 PST
Hi,
I display web inspector in MiniBrowser (this requires patch from #106050), attached to the webview.
Then I reduce window size.
When height is small enough, main view height reaches 0, and the browser crashes.
It crashes from a x11 error in RedirectedXCompositeWindow::resize because size.height() is <= 0
Comment 1 arno. 2013-01-03 15:29:02 PST
Created attachment 181234 [details]
patch proposal: detach inspector when webViewBase height becomes too small
Comment 2 WebKit Review Bot 2013-01-03 15:33:46 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Martin Robinson 2013-01-03 15:41:07 PST
Comment on attachment 181234 [details]
patch proposal: detach inspector when webViewBase height becomes too small

Seems that it would be a bit jarring to turn off the inspector completely if you shrank the window and then made it larger again. Why not just hide the inspector if there isn't enough space?
Comment 4 arno. 2013-01-03 15:51:53 PST
Created attachment 181242 [details]
patch proposal: updated patch: wrong static_cast
Comment 5 Carlos Garcia Campos 2013-01-04 06:36:25 PST
Comment on attachment 181242 [details]
patch proposal: updated patch: wrong static_cast

I don't think detaching the inspector is the right fix, here. There are actually two bugs, we shouldn't allocate for the children a size bigger than the parent, and we should make sure the widget allocation is always >= 1 (which is what GTK does in gtk_widget_size_allocate())
Comment 6 Carlos Garcia Campos 2013-01-04 06:39:21 PST
Created attachment 181299 [details]
A different approach
Comment 7 Carlos Garcia Campos 2013-01-04 09:15:42 PST
Committed r138803: <http://trac.webkit.org/changeset/138803>