Fixes QWebFrame::setScrollBarPolicy(..) to actually work. Also happens
authortreat@webkit.org <treat@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Jan 2009 21:14:50 +0000 (21:14 +0000)
committertreat@webkit.org <treat@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Jan 2009 21:14:50 +0000 (21:14 +0000)
to fix 192 layout tests that were previously failing for Qt.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39611 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/loader/FrameLoaderClient.cpp
WebCore/loader/FrameLoaderClient.h
WebCore/page/FrameView.cpp
WebCore/page/FrameView.h
WebKit/qt/Api/qwebframe.cpp
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp

index 1263567..7d8b078 100644 (file)
@@ -1,3 +1,18 @@
+2009-01-05  Adam Treat  <treat@kde.org>
+
+        Reviewed by George Staikos.
+
+        Fixes FrameView to respect the state of scrollbarmode when it is explicitly
+        set programatically via a webkit API.
+
+        * loader/FrameLoaderClient.cpp:
+        (WebCore::FrameLoaderClient::transitionToCommittedForNewPage):
+        * loader/FrameLoaderClient.h:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::initScrollbars):
+        (WebCore::FrameView::updateDefaultScrollbarState):
+        * page/FrameView.h:
+
 2009-01-05  Darin Adler  <darin@apple.com>
 
         Reviewed by Dan Bernstein.
index 2162fcd..a1187d7 100644 (file)
@@ -45,7 +45,8 @@ FrameLoaderClient::~FrameLoaderClient()
 void FrameLoaderClient::transitionToCommittedForNewPage(Frame* frame,
                                                         const IntSize& viewportSize,
                                                         const Color& backgroundColor, bool transparent,
-                                                        const IntSize& fixedLayoutSize, bool useFixedLayout)
+                                                        const IntSize& fixedLayoutSize, bool useFixedLayout,
+                                                        ScrollbarMode horizontalScrollbarMode, ScrollbarMode verticalScrollbarMode)
 {
     ASSERT(frame);
 
@@ -67,6 +68,8 @@ void FrameLoaderClient::transitionToCommittedForNewPage(Frame* frame,
 
     frameView->setFixedLayoutSize(fixedLayoutSize);
     frameView->setUseFixedLayout(useFixedLayout);
+    frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode);
+    frameView->updateDefaultScrollbarState();
 
     frame->setView(frameView);
     // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.
index 4bc05b1..dc692ac 100644 (file)
@@ -30,6 +30,7 @@
 #define FrameLoaderClient_h
 
 #include "FrameLoaderTypes.h"
+#include "ScrollTypes.h"
 #include <wtf/Forward.h>
 #include <wtf/Platform.h>
 #include <wtf/Vector.h>
@@ -210,7 +211,8 @@ namespace WebCore {
 #endif
 
     protected:
-        static void transitionToCommittedForNewPage(Frame*, const IntSize&, const Color&, bool, const IntSize &, bool);
+        static void transitionToCommittedForNewPage(Frame*, const IntSize&, const Color&, bool, const IntSize &, bool,
+                                                    ScrollbarMode = ScrollbarAuto, ScrollbarMode = ScrollbarAuto);
     };
 
 } // namespace WebCore
index 6192c0e..9f4882e 100644 (file)
@@ -275,6 +275,11 @@ void FrameView::initScrollbars()
     if (!d->m_needToInitScrollbars)
         return;
     d->m_needToInitScrollbars = false;
+    updateDefaultScrollbarState();
+}
+
+void FrameView::updateDefaultScrollbarState()
+{
     d->m_hmode = horizontalScrollbarMode();
     d->m_vmode = verticalScrollbarMode();
     setScrollbarModes(d->m_hmode, d->m_vmode);
index 1def4f0..d20280d 100644 (file)
@@ -110,6 +110,7 @@ public:
 
     void adjustViewSize();
     void initScrollbars();
+    void updateDefaultScrollbarState();
     
     virtual IntRect windowClipRect(bool clipToContents = true) const;
     IntRect windowClipRectForLayer(const RenderLayer*, bool clipToLayerContents) const;
index c2a85e5..ef70a79 100644 (file)
@@ -605,12 +605,16 @@ void QWebFrame::setScrollBarPolicy(Qt::Orientation orientation, Qt::ScrollBarPol
 
     if (orientation == Qt::Horizontal) {
         d->horizontalScrollBarPolicy = policy;
-        if (d->frame->view())
+        if (d->frame->view()) {
             d->frame->view()->setHorizontalScrollbarMode((ScrollbarMode)policy);
+            d->frame->view()->updateDefaultScrollbarState();
+        }
     } else {
         d->verticalScrollBarPolicy = policy;
-        if (d->frame->view())
+        if (d->frame->view()) {
             d->frame->view()->setVerticalScrollbarMode((ScrollbarMode)policy);
+            d->frame->view()->updateDefaultScrollbarState();
+        }
     }
 }
 
index 96fe80c..d8bb9e2 100644 (file)
@@ -1,3 +1,15 @@
+2009-01-05  Adam Treat  <treat@kde.org>
+
+        Reviewed by George Staikos.
+
+        Fixes QWebFrame::setScrollBarPolicy(..) to actually work.  Also happens
+        to fix 192 layout tests that were previously failing for Qt.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::setScrollBarPolicy):
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+
 2009-01-04  Adam Treat  <treat@kde.org>
 
         Reviewed by George Staikos.
index 4efcd4e..3f59601 100644 (file)
@@ -217,7 +217,9 @@ void FrameLoaderClientQt::transitionToCommittedForNewPage()
     WebCore::FrameLoaderClient::transitionToCommittedForNewPage(m_frame, m_webFrame->page()->viewportSize(),
                                                                 backgroundColor, !backgroundColor.alpha(),
                                                                 m_webFrame->page()->fixedLayoutSize(),
-                                                                m_webFrame->page()->useFixedLayout());
+                                                                m_webFrame->page()->useFixedLayout(),
+                                                                (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Horizontal),
+                                                                (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Vertical));
 }