[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 15:54:18 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 798f27e97d635d3c49bb381503feab832b1db7b4
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 16 12:55:02 2010 +0000

    2010-11-16  Kenneth Rohde Christiansen  <kenneth at webkit.org>
    
            Reviewed by Andreas Kling.
    
            [WK2][Qt] Expose resizes-to-contents mode in WebKit2
    
            Only available with ENABLE(TILED_BACKING_STORE)
    
            Based on a patch by Antti Koivisto.
    
            * UIProcess/API/qt/qwkpage.cpp:
            (QWKPage::setResizesToContentsUsingLayoutSize):
            * UIProcess/API/qt/qwkpage.h:
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::setResizesToContentsUsingLayoutSize):
            * UIProcess/WebPageProxy.h:
            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
            (WebKit::WebChromeClient::contentsSizeChanged):
            * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
            (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::setSize):
            (WebKit::WebPage::setResizesToContentsUsingLayoutSize):
            (WebKit::WebPage::resizeToContentsIfNeeded):
            * WebProcess/WebPage/WebPage.h:
            (WebKit::WebPage::resizesToContentsEnabled):
            (WebKit::WebPage::resizesToContentsLayoutSize):
            * WebProcess/WebPage/WebPage.messages.in:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72086 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 1ce3615..a6ef4f2 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,32 @@
+2010-11-16  Kenneth Rohde Christiansen  <kenneth at webkit.org>
+
+        Reviewed by Andreas Kling.
+
+        [WK2][Qt] Expose resizes-to-contents mode in WebKit2
+
+        Only available with ENABLE(TILED_BACKING_STORE)
+
+        Based on a patch by Antti Koivisto.
+
+        * UIProcess/API/qt/qwkpage.cpp:
+        (QWKPage::setResizesToContentsUsingLayoutSize):
+        * UIProcess/API/qt/qwkpage.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setResizesToContentsUsingLayoutSize):
+        * UIProcess/WebPageProxy.h:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::contentsSizeChanged):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setSize):
+        (WebKit::WebPage::setResizesToContentsUsingLayoutSize):
+        (WebKit::WebPage::resizeToContentsIfNeeded):
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::resizesToContentsEnabled):
+        (WebKit::WebPage::resizesToContentsLayoutSize):
+        * WebProcess/WebPage/WebPage.messages.in:
+
 2010-11-16  Andreas Kling  <kling at webkit.org>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit2/UIProcess/API/qt/qwkpage.cpp b/WebKit2/UIProcess/API/qt/qwkpage.cpp
index f47bbc3..bcb4bfe 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage.cpp
+++ b/WebKit2/UIProcess/API/qt/qwkpage.cpp
@@ -531,6 +531,13 @@ QWKHistory* QWKPage::history() const
     return d->history;
 }
 
+void QWKPage::setResizesToContentsUsingLayoutSize(const QSize& targetLayoutSize)
+{
+#if ENABLE(TILED_BACKING_STORE)
+    d->page->setResizesToContentsUsingLayoutSize(targetLayoutSize);
+#endif
+}
+
 #ifndef QT_NO_ACTION
 void QWKPage::triggerAction(WebAction action, bool)
 {
diff --git a/WebKit2/UIProcess/API/qt/qwkpage.h b/WebKit2/UIProcess/API/qt/qwkpage.h
index 29583cc..8770edb 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage.h
+++ b/WebKit2/UIProcess/API/qt/qwkpage.h
@@ -84,6 +84,8 @@ public:
 
     void setActualVisibleContentsRect(const QRect& rect) const;
 
+    void setResizesToContentsUsingLayoutSize(const QSize& targetLayoutSize);
+
     QAction* action(WebAction action) const;
     void triggerAction(WebAction action, bool checked = false);
 
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 59fb431..b9d53b6 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -618,6 +618,13 @@ void WebPageProxy::preferencesDidChange()
     process()->send(Messages::WebPage::PreferencesDidChange(pageNamespace()->context()->preferences()->store()), m_pageID);
 }
 
+#if ENABLE(TILED_BACKING_STORE)
+void WebPageProxy::setResizesToContentsUsingLayoutSize(const WebCore::IntSize& targetLayoutSize)
+{
+    process()->send(Messages::WebPage::SetResizesToContentsUsingLayoutSize(targetLayoutSize), m_pageID);
+}
+#endif
+
 void WebPageProxy::getStatistics(WKContextStatistics* statistics)
 {
     statistics->numberOfWKFrames += process()->frameCountInPage(this);
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index adea894..1efb430 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -244,6 +244,10 @@ public:
 
     void getStatistics(WKContextStatistics*);
 
+#if ENABLE(TILED_BACKING_STORE)
+    void setResizesToContentsUsingLayoutSize(const WebCore::IntSize&);
+#endif
+
     void contextMenuItemSelected(const WebContextMenuItemData&);
 
     WebPageCreationParameters creationParameters(const WebCore::IntSize&) const;
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
index 37e6fd9..cd00528 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
@@ -368,6 +368,11 @@ PlatformPageClient WebChromeClient::platformPageClient() const
 void WebChromeClient::contentsSizeChanged(Frame* frame, const IntSize& size) const
 {
 #if PLATFORM(QT)
+#if ENABLE(TILED_BACKING_STORE)
+    if (frame->page()->mainFrame() == frame)
+        m_page->resizeToContentsIfNeeded();
+#endif
+
     WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
 
     if (!m_page->mainFrame() || m_page->mainFrame() != webFrame)
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index 73ed31c..dab56dc 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -942,7 +942,17 @@ void WebFrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame*)
 
 void WebFrameLoaderClient::transitionToCommittedForNewPage()
 {
+#if ENABLE(TILED_BACKING_STORE)
+    WebPage* webPage = m_frame->page();
+    bool isMainFrame = webPage->mainFrame() == m_frame;
+
+    m_frame->coreFrame()->createView(m_frame->page()->size(), Color::white, false, webPage->resizesToContentsLayoutSize(), isMainFrame && webPage->resizesToContentsEnabled());
+
+    if (isMainFrame && webPage->resizesToContentsEnabled())
+        m_frame->coreFrame()->view()->setProhibitsScrolling(true);
+#else
     m_frame->coreFrame()->createView(m_frame->page()->size(), Color::white, false, IntSize(), false);
+#endif
 }
 
 void WebFrameLoaderClient::dispatchDidBecomeFrameset(bool value)
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index 688cc6e..2027376 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -391,6 +391,12 @@ void WebPage::layoutIfNeeded()
 
 void WebPage::setSize(const WebCore::IntSize& viewSize)
 {
+#if ENABLE(TILED_BACKING_STORE)
+    // If we are resizing to content ignore external attempts.
+    if (!m_resizesToContentsLayoutSize.isEmpty())
+        return;
+#endif
+
     if (m_viewSize == viewSize)
         return;
 
@@ -410,6 +416,38 @@ void WebPage::setActualVisibleContentRect(const IntRect& rect)
 
     frame->view()->setActualVisibleContentRect(rect);
 }
+
+void WebPage::setResizesToContentsUsingLayoutSize(const IntSize& targetLayoutSize)
+{
+    m_resizesToContentsLayoutSize = targetLayoutSize;
+
+    Frame* frame = m_page->mainFrame();
+    if (m_resizesToContentsLayoutSize.isEmpty()) {
+        m_page->settings()->setShouldDelegateScrolling(false);
+        frame->view()->setUseFixedLayout(false);
+    } else {
+        m_page->settings()->setShouldDelegateScrolling(true);
+        frame->view()->setUseFixedLayout(true);
+        frame->view()->setFixedLayoutSize(m_resizesToContentsLayoutSize);
+    }
+    frame->view()->forceLayout();
+}
+
+void WebPage::resizeToContentsIfNeeded()
+{
+    if (m_resizesToContentsLayoutSize.isEmpty())
+        return;
+
+    Frame* frame = m_page->mainFrame();
+
+    IntSize contentSize = frame->view()->contentsSize();
+    if (contentSize == m_viewSize)
+        return;
+
+    m_viewSize = contentSize;
+    frame->view()->resize(m_viewSize);
+    frame->view()->setNeedsLayout();
+}
 #endif
 
 void WebPage::drawRect(GraphicsContext& graphicsContext, const IntRect& rect)
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index 4b0e8e6..90d6085 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -194,6 +194,11 @@ public:
 #if ENABLE(TILED_BACKING_STORE)
     void pageDidRequestScroll(const WebCore::IntSize& delta);
     void setActualVisibleContentRect(const WebCore::IntRect&);
+
+    bool resizesToContentsEnabled() const { return !m_resizesToContentsLayoutSize.isEmpty(); }
+    WebCore::IntSize resizesToContentsLayoutSize() const { return m_resizesToContentsLayoutSize; }
+    void setResizesToContentsUsingLayoutSize(const WebCore::IntSize& targetLayoutSize);
+    void resizeToContentsIfNeeded();
 #endif
 
     WebContextMenu* contextMenu();
@@ -305,6 +310,10 @@ private:
     InjectedBundlePageLoaderClient m_loaderClient;
     InjectedBundlePageUIClient m_uiClient;
 
+#if ENABLE(TILED_BACKING_STORE)
+    WebCore::IntSize m_resizesToContentsLayoutSize;
+#endif
+
     FindController m_findController;
     RefPtr<PageOverlay> m_pageOverlay;
 
diff --git a/WebKit2/WebProcess/WebPage/WebPage.messages.in b/WebKit2/WebProcess/WebPage/WebPage.messages.in
index ab84e8b..36ce81a 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.messages.in
+++ b/WebKit2/WebProcess/WebPage/WebPage.messages.in
@@ -58,6 +58,7 @@ messages -> WebPage {
 
 #if ENABLE(TILED_BACKING_STORE)
     SetActualVisibleContentRect(WebCore::IntRect rect)
+    SetResizesToContentsUsingLayoutSize(WebCore::IntSize size)
 #endif
 
     Close()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list