Bug 92902 - [Qt][WK2] Race condition between first layout and viewport attributes initialization
Summary: [Qt][WK2] Race condition between first layout and viewport attributes initial...
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jesus Sanchez-Palencia
Keywords: Qt, QtTriaged
Depends on:
Reported: 2012-08-01 12:53 PDT by Jesus Sanchez-Palencia
Modified: 2012-08-01 15:21 PDT (History)
5 users (show)

See Also:

Patch (2.08 KB, patch)
2012-08-01 13:38 PDT, Jesus Sanchez-Palencia
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesus Sanchez-Palencia 2012-08-01 12:53:41 PDT
During our WebView initialization a default FrameView is created, triggering a layout. This is triggering QtViewportHandler::pageContentsSizeChanged earlier than the first QtViewportHandler::viewportAttributesChanged, which was responsible for initializing m_rawAttributes from QtViewportHandler. This hasn't been noticed before because we set useFixedLayout in QQuickWebViewFlickablePrivate::initialize before the layout is finished, which triggers the correct layout anyway.

However, while debugging https://bugs.webkit.org/show_bug.cgi?id=92753, debug messages delayed the initialization of the webview and the first layout finished before expected, leading us to "ASSERT(scale < 0)"  in QQuickWebPage::setContentsScale. (The random negative scale was returned by WebCore::computeMinimumScaleFactorForContentContained, called in QtViewportHandler::pageContentsSizeChanged).

This overly descriptive bug report is for the sake of remembering, since it took me a while to understand the race condition...

Patch is coming.
Comment 1 Jesus Sanchez-Palencia 2012-08-01 13:38:32 PDT
Created attachment 155874 [details]
Comment 2 WebKit Review Bot 2012-08-01 15:21:16 PDT
Comment on attachment 155874 [details]

Clearing flags on attachment: 155874

Committed r124374: <http://trac.webkit.org/changeset/124374>
Comment 3 WebKit Review Bot 2012-08-01 15:21:20 PDT
All reviewed patches have been landed.  Closing bug.