Remove most dependencies of Widget/ScrollView onto native QWidgets.
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2008 14:49:32 +0000 (14:49 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2008 14:49:32 +0000 (14:49 +0000)
This also brings the code closer in line with the Windows code. Seems
to work nicely on first try :)

Signed-off-by: Simon
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29166 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/qt/FrameQt.cpp
WebCore/platform/Widget.h
WebCore/platform/qt/PlatformScreenQt.cpp
WebCore/platform/qt/PlatformScrollBarQt.cpp
WebCore/platform/qt/ScrollViewQt.cpp
WebCore/platform/qt/WidgetQt.cpp
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp

index 33f3e62d839f0e234ce23d316810d1ef94702c07..d8aecdda2578713b014487e1bd0a5aabaa2b7c59 100644 (file)
@@ -1,3 +1,49 @@
+2008-01-04  Lars Knoll  <lars@trolltech.com>
+
+        Reviewed by Simon.
+
+        Remove most dependencies of Widget/ScrollView onto native QWidgets.
+
+        This also brings the code closer in line with the Windows code. Seems
+        to work nicely on first try :)
+
+        * page/qt/FrameQt.cpp:
+        (WebCore::Frame::createScriptInstanceForWidget):
+        * platform/Widget.h:
+        * platform/qt/PlatformScreenQt.cpp:
+        (WebCore::screenDepth):
+        (WebCore::screenDepthPerComponent):
+        (WebCore::screenIsMonochrome):
+        (WebCore::screenRect):
+        * platform/qt/PlatformScrollBarQt.cpp:
+        (WebCore::PlatformScrollbar::thumbPosition):
+        (WebCore::PlatformScrollbar::handleMouseMoveEvent):
+        * platform/qt/ScrollViewQt.cpp:
+        (WebCore::ScrollView::ScrollViewPrivate::ScrollViewPrivate):
+        (WebCore::ScrollView::ScrollViewPrivate::scrollBackingStore):
+        (WebCore::ScrollView::updateContents):
+        (WebCore::ScrollView::update):
+        (WebCore::ScrollView::scrollRectIntoViewRecursively):
+        (WebCore::ScrollView::updateScrollbars):
+        (WebCore::ScrollView::addChild):
+        (WebCore::ScrollView::removeChild):
+        (WebCore::ScrollView::paint):
+        * platform/qt/WidgetQt.cpp:
+        (WebCore::WidgetPrivate::WidgetPrivate):
+        (WebCore::WidgetPrivate::~WidgetPrivate):
+        (WebCore::Widget::frameGeometry):
+        (WebCore::Widget::setFrameGeometry):
+        (WebCore::Widget::setCursor):
+        (WebCore::Widget::show):
+        (WebCore::Widget::hide):
+        (WebCore::Widget::nativeWidget):
+        (WebCore::Widget::setNativeWidget):
+        (WebCore::Widget::suppressInvalidation):
+        (WebCore::Widget::setSuppressInvalidation):
+        (WebCore::Widget::invalidateRect):
+        (WebCore::Widget::topLevel):
+        (WebCore::Widget::containingWindow):
+
 2008-01-04  Lars Knoll  <lars@trolltech.com>
 
         Reviewed by Simon.
index 0e46aff35e9672a624b844a350dfdb1d95f5a43a..7ae1dd9e0197387d7b3b5bf96bdd9ba9b1fa43c5 100644 (file)
@@ -99,8 +99,11 @@ static void doScroll(const RenderObject* r, bool isHorizontal, int multiplier)
 
 KJS::Bindings::Instance* Frame::createScriptInstanceForWidget(WebCore::Widget* widget)
 {
+    QWidget* nativeWidget = widget->nativeWidget();
+    if (!nativeWidget)
+        return 0;
     return KJS::Bindings::Instance::createBindingForLanguageInstance(KJS::Bindings::Instance::QtLanguage,
-                                                                     widget->qwidget(),
+                                                                     nativeWidget,
                                                                      bindingRootObject());
 }
 
index 1f204eddd574416a74aef8b4f884f0406a957414..38092a9306ea3de35adcb53965dba410aab864b4 100644 (file)
@@ -168,15 +168,17 @@ protected:
 #endif
 
 #if PLATFORM(QT)
-        QWidget* qwidget() const;
-        void setQWidget(QWidget *widget);
-        QWidget* containingWindow() const;
+        void setNativeWidget(QWidget *widget);
+        QWidget* nativeWidget() const;
+
+        QWidget *containingWindow() const;
 
         QWebFrame* qwebframe() const;
         void setQWebFrame(QWebFrame *webFrame);
         virtual void setParent(ScrollView*);
         ScrollView* parent() const;
         virtual void geometryChanged() const;
+        ScrollView* topLevel() const;
 
         IntRect convertToContainingWindow(const IntRect&) const;
         IntPoint convertToContainingWindow(const IntPoint&) const;
@@ -184,6 +186,9 @@ protected:
 
         virtual IntPoint convertChildToSelf(const Widget*, const IntPoint&) const;
         virtual IntPoint convertSelfToChild(const Widget*, const IntPoint&) const;
+
+        bool suppressInvalidation() const;
+        void setSuppressInvalidation(bool);
 #endif
 
 #if PLATFORM(MAC)
index b7a5a0b509ded7b27f4cabe038df0f06abe87a8f..4792a512a481008ae83b2e2d80ad210b2ecd9648 100644 (file)
 #include <QDesktopWidget>
 
 namespace WebCore {
-    
+
 int screenDepth(Widget* w)
 {
     QDesktopWidget* d = QApplication::desktop();
-    return d->screen(d->screenNumber(w->qwidget()))->depth();
+    QWidget *view = w->containingWindow();
+    int screenNumber = view ? d->screenNumber(view) : 0;
+    return d->screen(screenNumber)->depth();
 }
 
 int screenDepthPerComponent(Widget* w)
 {
-    return w->qwidget()->depth();
+    QWidget *view = w->containingWindow();
+    return view ? view->depth() : QApplication::desktop()->screen(0)->depth();
 }
 
 bool screenIsMonochrome(Widget* w)
 {
     QDesktopWidget* d = QApplication::desktop();
-    return d->screen(d->screenNumber(w->qwidget()))->numColors() < 2;
+    QWidget *view = w->containingWindow();
+    int screenNumber = view ? d->screenNumber(view) : 0;
+    return d->screen(screenNumber)->numColors() < 2;
 }
 
 FloatRect screenRect(Widget* w)
 {
-    QRect r = QApplication::desktop()->screenGeometry(w->qwidget());
+    QRect r = QApplication::desktop()->screenGeometry(w->containingWindow());
     return FloatRect(r.x(), r.y(), r.width(), r.height());
 }
 
 FloatRect screenAvailableRect(Widget* w)
 {
-    QRect r = QApplication::desktop()->availableGeometry(w->qwidget());
+    QRect r = QApplication::desktop()->availableGeometry(w->containingWindow());
     return FloatRect(r.x(), r.y(), r.width(), r.height());
 }
 
index 5cb4cb68dc0ebfcbd72a313faff12298873478f2..eca120406f2ff7b7bc3a2988990934e0baedc878 100644 (file)
@@ -177,7 +177,7 @@ void PlatformScrollbar::paint(GraphicsContext* graphicsContext, const IntRect& d
 int PlatformScrollbar::thumbPosition() const
 {
     if (isEnabled())
-        return (float)m_currentPos * (trackLength() - thumbLength()) / (m_totalSize - m_visibleSize);
+        return (int)((float)m_currentPos * (trackLength() - thumbLength()) / (m_totalSize - m_visibleSize));
     return 0;
 }
 
@@ -230,7 +230,7 @@ bool PlatformScrollbar::handleMouseMoveEvent(const PlatformMouseEvent& evt)
             delta = max(-thumbPos, delta);
 
         if (delta != 0) {
-            setValue((float)(thumbPos + delta) * (m_totalSize - m_visibleSize) / (trackLen - thumbLen));
+            setValue((int)((float)(thumbPos + delta) * (m_totalSize - m_visibleSize) / (trackLen - thumbLen)));
             m_pressedPos += thumbPosition() - thumbPos;
         }
         
index 2058beb8bb4d7e72ace562b17e8813e927a2ed29..b5b5beb514ca4fbc77d6583b8891f862e152c70d 100644 (file)
@@ -65,8 +65,6 @@ public:
       , m_vScrollbarMode(ScrollbarAuto)
       , m_hScrollbarMode(ScrollbarAuto)
     {
-        setHasHorizontalScrollbar(true);
-        setHasVerticalScrollbar(true);
     }
 
     ~ScrollViewPrivate()
@@ -160,8 +158,10 @@ void ScrollView::ScrollViewPrivate::scrollBackingStore(const IntSize& scrollDelt
        m_view->scrollBackingStore(-scrollDelta.width(), -scrollDelta.height(),
                                   scrollViewRect, clipRect);
     } else  {
-       // We need to go ahead and repaint the entire backing store.
-       m_view->update();
+       // We need to go ahead and repaint the entire backing store.  Do it now before moving the
+       // plugins.
+       m_view->addToDirtyRegion(updateRect);
+       m_view->updateBackingStore();
     }
 
     m_view->geometryChanged();
@@ -201,46 +201,21 @@ void ScrollView::updateContents(const IntRect& rect, bool now)
     IntRect containingWindowRect = rect;
     containingWindowRect.setLocation(windowPoint);
 
-    //In QWebPage::paintEvent we paint the ev->region().rects()
-    //individually.  Unfortunately, webkit expects we'll draw the
-    //boundingrect of all update rects instead.  This is unfortunate,
-    //because if we want to draw the scrollbar rects along with the update
-    //rects this results in redrawing the entire page for a 1px scroll.
-    //In light of this we cache the update rects that webkit sends us here
-    //and send the bound along to QWebPage.  The cache is cleared everytime
-    //an actual paint occurs in ScrollView::paint...
-
-    QRect r(containingWindowRect);
-    QWebPage* page = qwebframe()->page();
-    r = r.intersect(QRect(QPoint(0, 0), page->viewportSize()));
-    if (r.isEmpty())
-        return;
     // Cache the dirty spot.
-    if (!m_data->m_dirtyRegion.isEmpty())
-        m_data->m_dirtyRegion = m_data->m_dirtyRegion.united(QRegion(r));
-    else
-        m_data->m_dirtyRegion = QRegion(r);
-
-#if 0
-    // ### QWebPage
-    bool painting = containingWindow()->testAttribute(Qt::WA_WState_InPaintEvent);
-    if (painting && now) {
-        QWebPage *page = qobject_cast<QWebPage*>(containingWindow());
-        QPainter p(page);
-        page->mainFrame()->render(&p, m_data->m_dirtyRegion.boundingRect());
-    } else if (now) {
-        containingWindow()->repaint(m_data->m_dirtyRegion.boundingRect());
-    } else {
-        containingWindow()->update(m_data->m_dirtyRegion.boundingRect());
-    }
-#endif
+    addToDirtyRegion(containingWindowRect);
+
+    if (now)
+        updateBackingStore();
 }
 
 void ScrollView::update()
 {
-    QWidget* window = containingWindow();
-    if (window)
-        window->update(frameGeometry());
+    QWidget* native = nativeWidget();
+    if (native) {
+        native->update();
+        return;
+    }
+    updateContents(IntRect(0, 0, width(), height()));
 }
 
 int ScrollView::visibleWidth() const
@@ -385,7 +360,6 @@ void ScrollView::scrollRectIntoViewRecursively(const IntRect& r)
 {
     IntPoint p(max(0, r.x()), max(0, r.y()));
     ScrollView* view = this;
-    ScrollView* oldView = view;
     while (view) {
         view->setContentsPos(p.x(), p.y());
         p.move(view->x() - view->scrollOffset().width(), view->y() - view->scrollOffset().height());
@@ -544,9 +518,13 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset)
         if (!m_data->m_scrollbarsSuppressed && oldRect != m_data->m_hBar->frameGeometry())
             m_data->m_hBar->invalidate();
 
+        if (m_data->m_scrollbarsSuppressed)
+            m_data->m_hBar->setSuppressInvalidation(true);
         m_data->m_hBar->setSteps(LINE_STEP, pageStep);
         m_data->m_hBar->setProportion(clientWidth, contentsWidth());
         m_data->m_hBar->setValue(scroll.width());
+        if (m_data->m_scrollbarsSuppressed)
+            m_data->m_hBar->setSuppressInvalidation(false); 
     } 
 
     if (m_data->m_vBar) {
@@ -563,9 +541,13 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset)
         if (!m_data->m_scrollbarsSuppressed && oldRect != m_data->m_vBar->frameGeometry())
             m_data->m_vBar->invalidate();
 
+        if (m_data->m_scrollbarsSuppressed)
+            m_data->m_vBar->setSuppressInvalidation(true);
         m_data->m_vBar->setSteps(LINE_STEP, pageStep);
         m_data->m_vBar->setProportion(clientHeight, contentsHeight());
         m_data->m_vBar->setValue(scroll.height());
+        if (m_data->m_scrollbarsSuppressed)
+            m_data->m_vBar->setSuppressInvalidation(false);
     }
 
     if (oldHasVertical != (m_data->m_vBar != 0) || oldHasHorizontal != (m_data->m_hBar != 0))
@@ -596,58 +578,38 @@ PlatformScrollbar* ScrollView::scrollbarUnderMouse(const PlatformMouseEvent& mou
 
 void ScrollView::addChild(Widget* child)
 {
-    QWidget* w = child->qwidget();
-    if (w)
-        m_data->m_children.add(child);
-
     child->setParent(this);
+    m_data->m_children.add(child);
 }
 
 void ScrollView::removeChild(Widget* child)
 {
     child->setParent(0);
     child->hide();
-    QWidget* w = child->qwidget();
-    if (w)
-        m_data->m_children.remove(child);
+    m_data->m_children.remove(child);
 }
 
 void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
 {
-    Q_ASSERT(isFrameView());
-
-    m_data->m_dirtyRegion = QRegion(); //clear the cache...
+    // FIXME: This code is here so we don't have to fork FrameView.h/.cpp.
+    // In the end, FrameView should just merge with ScrollView.
+    ASSERT(isFrameView());
 
     if (context->paintingDisabled())
         return;
 
     IntRect documentDirtyRect = rect;
-
-    QPainter *p = context->platformContext();
+    documentDirtyRect.intersect(frameGeometry());
 
     context->save();
 
-    QRect canvasRect = frameGeometry();
-    documentDirtyRect.intersect(canvasRect);
-    context->translate(canvasRect.x(), canvasRect.y());
-    documentDirtyRect.move(-canvasRect.x(), -canvasRect.y());
+    context->translate(x(), y());
+    documentDirtyRect.move(-x(), -y());
 
     context->translate(-contentsX(), -contentsY());
     documentDirtyRect.move(contentsX(), contentsY());
 
-    IntRect clipRect = enclosingIntRect(visibleContentRect());
-
-    context->clip(clipRect);
-
-#ifdef DEBUG_SCROLLVIEW
-    qDebug() << "ScrollView::paint --> "
-             << "isSubframe" << (qwebframe() != qwebframe()->page()->mainFrame() ? "true" : "false")
-             << "rect" << rect
-             << "canvasRect" << canvasRect
-             << "clipRect" << clipRect
-             << "documentDirtyRect" << documentDirtyRect
-             << endl;
-#endif
+    context->clip(enclosingIntRect(visibleContentRect()));
 
     static_cast<const FrameView*>(this)->frame()->paint(context, documentDirtyRect);
 
@@ -656,13 +618,10 @@ void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
     // Now paint the scrollbars.
     if (!m_data->m_scrollbarsSuppressed && (m_data->m_hBar || m_data->m_vBar)) {
         context->save();
-
         IntRect scrollViewDirtyRect = rect;
-        scrollViewDirtyRect.intersect(canvasRect);
-
-        context->translate(canvasRect.x(), canvasRect.y());
-        scrollViewDirtyRect.move(-canvasRect.x(), -canvasRect.y());
-
+        scrollViewDirtyRect.intersect(frameGeometry());
+        context->translate(x(), y());
+        scrollViewDirtyRect.move(-x(), -y());
         if (m_data->m_hBar)
             m_data->m_hBar->paint(context, scrollViewDirtyRect);
         if (m_data->m_vBar)
@@ -690,6 +649,9 @@ void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
 
         context->restore();
     }
+
+    m_data->m_dirtyRegion = QRegion(); //clear the cache...
+
 }
 
 void ScrollView::wheelEvent(PlatformWheelEvent& e)
index 92adc1891ab49e1e05945c228b65c0314fd315ae..ae27e5bcd047a12532a5416ec846245ceb351a9d 100644 (file)
@@ -53,23 +53,19 @@ namespace WebCore {
 
 struct WidgetPrivate
 {
-    WidgetPrivate() : m_client(0), m_widget(0), m_webFrame(0), m_parentScrollView(0) { }
+    WidgetPrivate()
+        : m_client(0)
+        , enabled(true)
+        , suppressInvalidation(false)
+        , m_widget(0)
+        , m_webFrame(0)
+        , m_parentScrollView(0) { }
     ~WidgetPrivate() { delete m_webFrame; }
 
-    void setGeometry(const QRect &rect) {
-        if (m_widget)
-            m_widget->setGeometry(rect);
-        m_geometry = rect;
-    }
-    QRect geometry() const {
-        if (m_widget)
-            m_widget->geometry();
-        return m_geometry;
-    }
-
     WidgetClient* m_client;
 
     bool enabled;
+    bool suppressInvalidation;
     QRect m_geometry;
     QWidget *m_widget; //for plugins
     QWebFrame *m_webFrame;
@@ -99,7 +95,16 @@ WidgetClient* Widget::client() const
 
 IntRect Widget::frameGeometry() const
 {
-    return data->geometry();
+    if (data->m_widget)
+        data->m_widget->geometry();
+    return data->m_geometry;
+}
+
+void Widget::setFrameGeometry(const IntRect& r)
+{
+    if (data->m_widget)
+        data->m_widget->setGeometry(r);
+    data->m_geometry = r;
 }
 
 void Widget::setFocus()
@@ -109,8 +114,8 @@ void Widget::setFocus()
 void Widget::setCursor(const Cursor& cursor)
 {
 #ifndef QT_NO_CURSOR
-    if (qwidget())
-        qwidget()->setCursor(cursor.impl());
+    if (data->m_widget)
+        data->m_widget->setCursor(cursor.impl());
 #endif
 }
 
@@ -118,16 +123,12 @@ void Widget::show()
 {
     if (data->m_widget)
         data->m_widget->show();
-    else
-        notImplemented();
 }
 
 void Widget::hide()
 {
     if (data->m_widget)
         data->m_widget->hide();
-    else
-        notImplemented();
 }
 
 QWebFrame* Widget::qwebframe() const
@@ -140,27 +141,16 @@ void Widget::setQWebFrame(QWebFrame* webFrame)
     data->m_webFrame = webFrame;
 }
 
-QWidget* Widget::qwidget() const
+QWidget* Widget::nativeWidget() const
 {
-    if (data->m_widget)
-        return data->m_widget;
-
-    if (data->m_webFrame)
-        return data->m_webFrame->page()->view();
-
-    return 0;
+    return data->m_widget;
 }
 
-void Widget::setQWidget(QWidget *widget)
+void Widget::setNativeWidget(QWidget *widget)
 {
     data->m_widget = widget;
 }
 
-void Widget::setFrameGeometry(const IntRect& r)
-{
-    data->setGeometry(r);
-}
-
 void Widget::paint(GraphicsContext *, const IntRect &rect)
 {
 }
@@ -188,6 +178,16 @@ void Widget::setIsSelected(bool)
     notImplemented();
 }
 
+bool Widget::suppressInvalidation() const
+{
+    return data->suppressInvalidation;
+}
+
+void Widget::setSuppressInvalidation(bool suppress)
+{
+    data->suppressInvalidation = suppress;
+}
+
 void Widget::invalidate()
 {
     invalidateRect(IntRect(0, 0, width(), height()));
@@ -195,8 +195,24 @@ void Widget::invalidate()
 
 void Widget::invalidateRect(const IntRect& r)
 {
-    if (data->m_widget) //plugins
-        return data->m_widget->update(r);
+    if (data->suppressInvalidation)
+        return;
+
+    if (data->m_widget) { //plugins
+        data->m_widget->update(r);
+        return;
+    }
+
+    if (!parent()) {
+        if (isFrameView())
+            static_cast<FrameView*>(this)->addToDirtyRegion(r);
+        return;
+    }
+
+    // Get the root widget.
+    ScrollView* outermostView = topLevel();
+    if (!outermostView)
+        return;
 
     IntRect windowRect = convertToContainingWindow(r);
 
@@ -204,27 +220,7 @@ void Widget::invalidateRect(const IntRect& r)
     IntRect clipRect = windowClipRect();
     windowRect.intersect(clipRect);
 
-    QWidget *canvas = qwidget(); //regular frameview
-    if (!canvas && parent())
-        canvas = parent()->qwidget(); //scrollbars
-
-    if (!canvas)  // not visible anymore
-        return;
-
-    bool shouldPaint = canvas->testAttribute(Qt::WA_WState_InPaintEvent);
-    if (parent() && parent()->isFrameView() && static_cast<FrameView*>(parent())->needsLayout())
-        shouldPaint = false;
-
-#if 0
-    // ### QWebPage
-    if (shouldPaint) {
-        QWebPage* page = qobject_cast<QWebPage*>(canvas);
-        QPainter p(page);
-        page->mainFrame()->render(&p, windowRect);
-    } else {
-        canvas->update(windowRect);
-    }
-#endif
+    outermostView->addToDirtyRegion(windowRect);
 }
 
 void Widget::removeFromParent()
@@ -243,6 +239,30 @@ ScrollView* Widget::parent() const
     return data->m_parentScrollView;
 }
 
+ScrollView* Widget::topLevel() const
+{
+    if (!data->m_parentScrollView)
+        return isFrameView() ? const_cast<ScrollView*>(static_cast<const ScrollView*>(this)) : 0;
+    ScrollView* topLevel = data->m_parentScrollView;
+    while (topLevel->data->m_parentScrollView)
+        topLevel = topLevel->data->m_parentScrollView;
+    return topLevel;
+}
+
+QWidget *Widget::containingWindow() const
+{
+    ScrollView *topLevel = this->topLevel();
+    if (!topLevel)
+        return 0;
+    QWidget *view = 0;
+    if (topLevel->data->m_webFrame)
+        view = topLevel->data->m_webFrame->page()->view();
+    if (!view)
+        view = data->m_widget;
+    return view;
+}
+
+
 void Widget::geometryChanged() const
 {
 }
@@ -288,11 +308,6 @@ IntPoint Widget::convertSelfToChild(const Widget* child, const IntPoint& point)
     return IntPoint(point.x() - child->x(), point.y() - child->y());
 }
 
-QWidget *Widget::containingWindow() const
-{
-    return qwidget();
-}
-
 }
 
 // vim: ts=4 sw=4 et
index db9c1236a1c4df0d9abf7eb5d5871a7ebd619f1a..62c4ffbd11c0f9d4fcf0d0d324a9ce77258ad447 100644 (file)
@@ -1,3 +1,20 @@
+2008-01-04  Lars Knoll  <lars@trolltech.com>
+
+        Reviewed by Simon.
+
+        Remove most dependencies of Widget/ScrollView onto native QWidgets.
+        
+        This also brings the code closer in line with the Windows code. Seems
+        to work nicely on first try :)
+        
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::updateBackingStore):
+        (WebCore::ChromeClientQt::mouseDidMoveOverElement):
+        (WebCore::ChromeClientQt::setToolTip):
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::createPlugin):
+
 2008-01-04  Holger Hans Peter Freyther  <holger.freyther@trolltech.com>
 
         Reviewed by Simon.
index b9e00d6cbb258aba105dee023373e6897437657b..a8d30e567550b222f44c02a24e906a37897545c0 100644 (file)
@@ -300,16 +300,23 @@ IntRect ChromeClientQt::windowResizerRect() const
 
 void ChromeClientQt::addToDirtyRegion(const IntRect& r)
 {
+    QWidget* view = m_webPage->view();
+    if (view)
+        view->update(r);
 }
 
 void ChromeClientQt::scrollBackingStore(int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect)
 {
-    // #### QWebPage
-    //m_webPage->scroll(dx, dy, scrollViewRect);
+    QWidget* view = m_webPage->view();
+    if (view)
+        view->scroll(dx, dy, scrollViewRect);
 }
 
 void ChromeClientQt::updateBackingStore()
 {
+//     QWidget* view = m_webPage->view();
+//     if (view)
+//         view->update();
 }
 
 void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult&, unsigned /*modifierFlags*/)
index 0d8056bbeee582214478de9123ea8a31f48ab58c..0ada4996bdbf09f69221cd5d5c5da0f5304f288e 100644 (file)
@@ -954,7 +954,7 @@ Widget* FrameLoaderClientQt::createPlugin(const IntSize&, Element* element, cons
         if (widget && view) {
             widget->setParent(view);
             Widget* w= new Widget();
-            w->setQWidget(widget);
+            w->setNativeWidget(widget);
             return w;
         }
         // FIXME: make things work for widgetless plugins as well