Bug 97092 - [GTK] REGRESSION(r128907): it broke several WebKit2 API tests
Summary: [GTK] REGRESSION(r128907): it broke several WebKit2 API tests
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2012-09-19 03:04 PDT by Carlos Garcia Campos
Modified: 2012-09-19 07:00 PDT (History)
1 user (show)

See Also:

Patch (1.86 KB, patch)
2012-09-19 03:07 PDT, Carlos Garcia Campos
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2012-09-19 03:04:03 PDT
The problem is in RedirectedXCompositeWindow implementation. Every WebView creates a RedirectedXCompositeWindow of size 1,1. At the end of the constructor resize and resizeLater function are called:

resizeLater(); // Force update of the usable area.

resize always schedules a resizeLater call because m_usableSize is uninitialized (0, 0) and is always smaller than size (1, 1). The first resizeLater, called right after resize() resets the m_pendingResizeSourceId. If the window is destroyed before the second resizeLater is called (called from the main loop), the destructor won't remove the source, because it has been reset by the first resizeLater and after the objects is freed, the second resizeLater will be called by the main loop with an already freed RedirectedXCompositeWindow. This happens often in unit tests where web view are created and destroyed quickly. 
Instead of calling resizeLater from the constructor to initialize m_usableSize, we could just initialize it to the given size.
Comment 1 Carlos Garcia Campos 2012-09-19 03:07:30 PDT
Created attachment 164704 [details]
Comment 2 Martin Robinson 2012-09-19 06:10:40 PDT
Comment on attachment 164704 [details]

Comment 3 Carlos Garcia Campos 2012-09-19 07:00:33 PDT
Committed r128996: <http://trac.webkit.org/changeset/128996>