added a comment - - edited
Take all of this with a grain of salt, as I'm very new to both Qt and WebKit.
To try and pin down what is causing the slowdown, I profiled (with Shark) resizing a WebView from Apple's WebKit framework and a QWebView rendering the same webpage. I'm finding that resizing the QWebView calls QWebPage::setViewportSize, which results in 3 separate calls to WebCore::RenderView::layout. The WebView in Apple's framework results in a single call to WebCore::RenderView::layout when resized.
What appears to be happening is
(1) QWebPage::setViewportSize calls WebCore::ScrollView::setFrameRect.
(2) In WebCore::ScrollView::setFrameRect, Widget::platformWidget returns 0. Consequently, WebCore::ScrollView::updateScrollbars is called next.
(3) Near the top of WebCore::ScrollView::updateScrollbars is a call to WebCore::FrameView::visibleContentsResized. This does not result in a layout, however, as WebCore::FrameView::contentsResized (which appears to be a wrapper for RenderView::setNeedsLayout) has not yet been called.
(4) Around line 400 of ScrollView.cpp, visibleContentsResized gets called again. This time, it is immediately preceded by contentsResized, so WebCore::FrameView::layout will definitely be called. Note that m_inUpdateScrollbars is not set to true beforehand.
(5) Around line 636 of FrameView.cpp (in FrameView::layout) is the first call to RenderView::layout.
(6) Around line 649 of FrameView.cpp is a call to WebCore::FrameView::adjustViewSize, which calls WebCore::ScrollView::setContentsSize. As with WebCore::ScrollView::setFrameRect, Widget::platformWidget returns 0 here. Consequently, WebCore::ScrollView::updateScrollbars is called again. Because m_inUpdateScrollbars is not set to true, this will lead to a second call to RenderView::layout.
(7) After WebCore::ScrollView::setFrameRect returns (back in QWebPage::setViewportSize), there is another call to WebCore::FrameView::layout (as a result of WebCore::FrameView::forceLayout), which leads immediately to the third call to RenderView::layout.
I haven't been able to turn any of this into real speed-ups, unfortunately. Adding a call to contentsResized before the first call to visibleContentsResized in ScrollView::updateScrollbars, and removing the call to WebCore::FrameView::forceLayout in QWebPage::setViewportSize, seems to speed up loading pages. But resizing, while faster, is still unusably slow. Plus, modifying the WebCore in this way is probably not a good idea.
Also, it seems like a lot of time is being spent in Font::floatWidthForComplexText in FontQt.cpp. I don't know enough about Qt or WebKit to know what Font::floatWidthForSimpleText is supposed to do, but I think there's a good chance that implementing this method would result in a speed boost.
Anyway, hopefully some of this is on the right track.