we start painting. This avoids a crash in Widget::invalidateRect
because QPainter::begin would fail
* The QWebFrame::layout() methods and calls are left untouched because
this would be an API decision.
Signed-off-by: Simon
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28353
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-12-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Avoid crashes by making sure everything is layouted before
+ we start painting. This avoids a crash in Widget::invalidateRect
+ because QPainter::begin would fail
+ * The QWebFrame::layout() methods and calls are left untouched because
+ this would be an API decision.
+
+
+ WARNING: NO TEST CASES ADDED OR CHANGED
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::updateControlTints):
+ * page/FrameView.h:
+ * platform/ScrollView.h:
+ * platform/qt/ScrollViewQt.cpp:
+ (WebCore::ScrollView::children):
+
2007-12-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
Reviewed by Simon.
d->m_wasScrolledByUser = wasScrolledByUser;
}
-#if PLATFORM(WIN) || PLATFORM(GTK)
+#if PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(QT)
void FrameView::layoutIfNeededRecursive()
{
// We have to crawl our entire tree looking for any FrameViews that need
// FIXME: This method should be used by all platforms, but currently depends on ScrollView::children,
// which not all methods have. Once FrameView and ScrollView are merged, this #if should be removed.
-#if PLATFORM(WIN) || PLATFORM(GTK)
+#if PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(QT)
void layoutIfNeededRecursive();
#endif
PlatformScrollbar *horizontalScrollBar() const;
PlatformScrollbar *verticalScrollBar() const;
+ HashSet<Widget*>* children();
+
private:
void updateScrollbars(const IntSize& desiredOffset);
IntSize maximumScroll() const;
geometryChanged();
}
+HashSet<Widget*>* ScrollView::children()
+{
+ return &(m_data->m_children);
+}
+
void ScrollView::geometryChanged() const
{
HashSet<Widget*>::const_iterator end = m_data->m_children.end();
void QWebFrame::layout()
{
- if (d->frameView->needsLayout()) {
- d->frameView->layout();
- }
+ if (!d->frameView)
+ return;
- foreach (QWebFrame *child, childFrames()) {
- child->layout();
- }
+ d->frameView->layoutIfNeededRecursive();
}
QPoint QWebFrame::pos() const
time.start();
#endif
+ mainFrame()->layout();
QPainter p(this);
QVector<QRect> vector = ev->region().rects();
+2007-12-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
+
+ Reviewed by Simon.
+
+ * Avoid crashes by making sure everything is layouted before
+ we start painting. This avoids a crash in Widget::invalidateRect
+ because QPainter::begin would fail
+ * The QWebFrame::layout() methods and calls are left untouched because
+ this would be an API decision.
+
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::layout):
+ * Api/qwebpage.cpp:
+ (QWebPage::paintEvent):
+
2007-12-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
Reviewed by Simon.