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

luiz at webkit.org luiz at webkit.org
Wed Dec 22 14:05:53 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit ced742e118edd7ca2a131f69d1b0994ed2d8242d
Author: luiz at webkit.org <luiz at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 4 13:17:11 2010 +0000

    2010-09-28  Luiz Agostini  <luiz.agostini at openbossa.org>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            Viewport data change notifications
            https://bugs.webkit.org/show_bug.cgi?id=46755
    
            Regarding viewport meta tags, what matters for browser developers is to know when the viewport data has
            changed and its current value. Viewport data belongs to the document, but it is useful to keep the current
            viewport data in Page as a reference, to be able to send notifications only when the current viewport
            has changed.
    
            * dom/Document.cpp:
            (WebCore::Document::processViewport):
            (WebCore::Document::setInPageCache):
            * dom/ViewportArguments.h:
            (WebCore::ViewportArguments::operator==):
            * html/HTMLBodyElement.cpp:
            (WebCore::HTMLBodyElement::HTMLBodyElement):
            * page/Chrome.cpp:
            (WebCore::Chrome::viewportDataChanged):
            * page/Chrome.h:
            * page/ChromeClient.h:
            (WebCore::ChromeClient::viewportDataChanged):
            * page/Page.cpp:
            (WebCore::Page::updateViewportArguments):
            * page/Page.h:
            (WebCore::Page::viewportArguments):
    2010-09-28  Luiz Agostini  <luiz.agostini at openbossa.org>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            Viewport data change notifications
            https://bugs.webkit.org/show_bug.cgi?id=46755
    
            Regarding viewport meta tags, what matters for browser developers is to know when the viewport data has
            changed and its current value. Viewport data belongs to the document, but it is useful to keep the current
            viewport data in Page as a reference, to be able to send notifications only when the current viewport
            has changed.
    
            * Api/qwebframe.cpp:
            * Api/qwebframe_p.h:
            * Api/qwebpage.cpp:
            (QWebPagePrivate::viewportArguments):
            (QWebPage::viewportConfigurationForSize):
            * Api/qwebpage_p.h:
            * WebCoreSupport/ChromeClientQt.cpp:
            (WebCore::ChromeClientQt::viewportDataChanged):
            * WebCoreSupport/ChromeClientQt.h:
            * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
            (DumpRenderTreeSupportQt::viewportAsText):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69009 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d9602da..1d75fad 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,32 @@
+2010-09-28  Luiz Agostini  <luiz.agostini at openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Viewport data change notifications
+        https://bugs.webkit.org/show_bug.cgi?id=46755
+
+        Regarding viewport meta tags, what matters for browser developers is to know when the viewport data has
+        changed and its current value. Viewport data belongs to the document, but it is useful to keep the current
+        viewport data in Page as a reference, to be able to send notifications only when the current viewport
+        has changed.
+
+        * dom/Document.cpp:
+        (WebCore::Document::processViewport):
+        (WebCore::Document::setInPageCache):
+        * dom/ViewportArguments.h:
+        (WebCore::ViewportArguments::operator==):
+        * html/HTMLBodyElement.cpp:
+        (WebCore::HTMLBodyElement::HTMLBodyElement):
+        * page/Chrome.cpp:
+        (WebCore::Chrome::viewportDataChanged):
+        * page/Chrome.h:
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::viewportDataChanged):
+        * page/Page.cpp:
+        (WebCore::Page::updateViewportArguments):
+        * page/Page.h:
+        (WebCore::Page::viewportArguments):
+
 2010-10-03  Kent Tamura  <tkent at chromium.org>
 
         Unreviewed, build fix for r68996.
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index d578ad9..009db6d 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -2607,7 +2607,7 @@ void Document::processViewport(const String& features)
     if (!frame || !frame->page())
         return;
 
-    frame->page()->chrome()->client()->didReceiveViewportArguments(frame, m_viewportArguments);
+    frame->page()->updateViewportArguments();
 }
 
 MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& request, const IntPoint& documentPoint, const PlatformMouseEvent& event)
@@ -3831,7 +3831,7 @@ void Document::setInPageCache(bool flag)
         m_savedRenderer = 0;
 
         if (frame() && frame()->page())
-            frame()->page()->chrome()->client()->didReceiveViewportArguments(frame(), m_viewportArguments);
+            frame()->page()->updateViewportArguments();
 
         if (childNeedsStyleRecalc())
             scheduleStyleRecalc();
diff --git a/WebCore/dom/ViewportArguments.h b/WebCore/dom/ViewportArguments.h
index 5731842..32c9454 100644
--- a/WebCore/dom/ViewportArguments.h
+++ b/WebCore/dom/ViewportArguments.h
@@ -85,9 +85,15 @@ struct ViewportArguments {
 
     float userScalable;
 
-    bool hasCustomArgument() const
+    bool operator==(const ViewportArguments& other) const
     {
-        return initialScale != ValueAuto || minimumScale != ValueAuto || maximumScale != ValueAuto || width != ValueAuto || height != ValueAuto || userScalable != ValueAuto || targetDensityDpi != ValueAuto;
+        return initialScale == other.initialScale
+            && minimumScale == other.minimumScale
+            && maximumScale == other.maximumScale
+            && width == other.width
+            && height == other.height
+            && targetDensityDpi == other.targetDensityDpi
+            && userScalable == other.userScalable;
     }
 };
 
diff --git a/WebCore/html/HTMLBodyElement.cpp b/WebCore/html/HTMLBodyElement.cpp
index 3415eee..4090566 100644
--- a/WebCore/html/HTMLBodyElement.cpp
+++ b/WebCore/html/HTMLBodyElement.cpp
@@ -196,6 +196,9 @@ void HTMLBodyElement::insertedIntoDocument()
     // But without it we hang during WebKit tests; need to fix that and remove this.
     if (FrameView* view = document()->view())
         view->scheduleRelayout();
+
+    if (document() && document()->page())
+        document()->page()->updateViewportArguments();
 }
 
 bool HTMLBodyElement::isURLAttribute(Attribute *attr) const
diff --git a/WebCore/page/Chrome.cpp b/WebCore/page/Chrome.cpp
index 8feedce..944f32f 100644
--- a/WebCore/page/Chrome.cpp
+++ b/WebCore/page/Chrome.cpp
@@ -426,6 +426,11 @@ void Chrome::chooseIconForFiles(const Vector<String>& filenames, FileChooser* fi
     m_client->chooseIconForFiles(filenames, fileChooser);
 }
 
+void Chrome::dispatchViewportDataDidChange(const ViewportArguments& arguments) const
+{
+    m_client->dispatchViewportDataDidChange(arguments);
+}
+
 void Chrome::setCursor(const Cursor& cursor)
 {
     m_client->setCursor(cursor);
diff --git a/WebCore/page/Chrome.h b/WebCore/page/Chrome.h
index 5ee8897..5b4c60c 100644
--- a/WebCore/page/Chrome.h
+++ b/WebCore/page/Chrome.h
@@ -51,6 +51,7 @@ namespace WebCore {
 #if ENABLE(NOTIFICATIONS)
     class NotificationPresenter;
 #endif
+    class ViewportArguments;
 
     struct FrameLoadRequest;
     struct WindowFeatures;
@@ -139,6 +140,8 @@ namespace WebCore {
         void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
         void chooseIconForFiles(const Vector<String>&, FileChooser*);
 
+        void dispatchViewportDataDidChange(const ViewportArguments&) const;
+
 #if PLATFORM(MAC)
         void focusNSView(NSView*);
 #endif
diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.h
index 7542615..4791f51 100644
--- a/WebCore/page/ChromeClient.h
+++ b/WebCore/page/ChromeClient.h
@@ -146,6 +146,8 @@ namespace WebCore {
         virtual void setCursor(const Cursor&) = 0;
         // End methods used by HostWindow.
 
+        virtual void dispatchViewportDataDidChange(const ViewportArguments&) const { }
+
         virtual void contentsSizeChanged(Frame*, const IntSize&) const = 0;
         virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const = 0; // Currently only Mac has a non empty implementation.
        
@@ -155,8 +157,6 @@ namespace WebCore {
 
         virtual void setToolTip(const String&, TextDirection) = 0;
 
-        virtual void didReceiveViewportArguments(Frame*, const ViewportArguments&) const { }
-
         virtual void print(Frame*) = 0;
 
 #if ENABLE(DATABASE)
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index 28cfd07..2cccd92 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -288,6 +288,9 @@ void Frame::setDocument(PassRefPtr<Document> newDoc)
 
     // Update the cached 'document' property, which is now stale.
     m_script.updateDocument();
+
+    if (m_page)
+        m_page->updateViewportArguments();
 }
 
 #if ENABLE(ORIENTATION_EVENTS)
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index bbe05f1..2c73fa8 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -417,6 +417,15 @@ void Page::scheduleForcedStyleRecalcForAllPages()
             frame->document()->scheduleForcedStyleRecalc();
 }
 
+void Page::updateViewportArguments()
+{
+    if (!mainFrame() || !mainFrame()->document() || mainFrame()->document()->viewportArguments() == m_viewportArguments)
+        return;
+
+    m_viewportArguments = mainFrame()->document()->viewportArguments();
+    chrome()->dispatchViewportDataDidChange(m_viewportArguments);
+}
+
 void Page::refreshPlugins(bool reload)
 {
     if (!allPages)
diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h
index 8f01faa..460a698 100644
--- a/WebCore/page/Page.h
+++ b/WebCore/page/Page.h
@@ -23,6 +23,7 @@
 
 #include "FrameLoaderTypes.h"
 #include "PlatformString.h"
+#include "ViewportArguments.h"
 #include <wtf/Forward.h>
 #include <wtf/HashSet.h>
 #include <wtf/Noncopyable.h>
@@ -127,6 +128,9 @@ namespace WebCore {
 
         RenderTheme* theme() const { return m_theme.get(); };
 
+        ViewportArguments viewportArguments() const { return m_viewportArguments; }
+        void updateViewportArguments();
+
         static void refreshPlugins(bool reload);
         PluginData* pluginData() const;
 
@@ -383,6 +387,8 @@ namespace WebCore {
 #endif
 
         ViewMode m_viewMode;
+
+        ViewportArguments m_viewportArguments;
     };
 
 } // namespace WebCore
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 1791096..55ec464 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -230,14 +230,6 @@ void QWebFramePrivate::init(QWebFrame *qframe, QWebFrameData *frameData)
     frame->init();
 }
 
-WebCore::ViewportArguments QWebFramePrivate::viewportArguments()
-{
-    if (!frame || !frame->document())
-        return WebCore::ViewportArguments();
-
-    return frame->document()->viewportArguments();
-}
-
 void QWebFramePrivate::setPage(QWebPage* newPage)
 {
     if (page == newPage)
diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h
index 5ba3f52..79187ab 100644
--- a/WebKit/qt/Api/qwebframe_p.h
+++ b/WebKit/qt/Api/qwebframe_p.h
@@ -90,8 +90,6 @@ public:
     void renderFromTiledBackingStore(WebCore::GraphicsContext*, const QRegion& clip);
 #endif
 
-    WebCore::ViewportArguments viewportArguments();
-
     QWebFrame *q;
     Qt::ScrollBarPolicy horizontalScrollBarPolicy;
     Qt::ScrollBarPolicy verticalScrollBarPolicy;
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index 1439468..c262908 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -334,6 +334,11 @@ QWebPagePrivate::~QWebPagePrivate()
 #endif
 }
 
+WebCore::ViewportArguments QWebPagePrivate::viewportArguments()
+{
+    return page ? page->viewportArguments() : WebCore::ViewportArguments();
+}
+
 WebCore::Page* QWebPagePrivate::core(const QWebPage* page)
 {
     return page->d->page;
@@ -2386,8 +2391,7 @@ QWebPage::ViewportConfiguration QWebPage::viewportConfigurationForSize(const QSi
         deviceHeight = size.height();
     }
 
-    WebCore::ViewportConfiguration conf = WebCore::findConfigurationForViewportData(mainFrame()->d->viewportArguments(),
-            desktopWidth, deviceWidth, deviceHeight, deviceDPI, availableSize);
+    WebCore::ViewportConfiguration conf = WebCore::findConfigurationForViewportData(d->viewportArguments(), desktopWidth, deviceWidth, deviceHeight, deviceDPI, availableSize);
 
     result.m_isValid = true;
     result.m_size = conf.layoutViewport;
diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h
index 12716f9..1e8da3e 100644
--- a/WebKit/qt/Api/qwebpage_p.h
+++ b/WebKit/qt/Api/qwebpage_p.h
@@ -36,6 +36,8 @@
 
 #include <wtf/RefPtr.h>
 
+#include "ViewportArguments.h"
+
 namespace WebCore {
     class ChromeClientQt;
     class ContextMenuClientQt;
@@ -139,6 +141,8 @@ public:
     WebCore::InspectorController* inspectorController();
     quint16 inspectorServerPort();
 
+    WebCore::ViewportArguments viewportArguments();
+
 #ifndef QT_NO_SHORTCUT
     static QWebPage::WebAction editorActionForKeyEvent(QKeyEvent* event);
 #endif
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index cf4e8a6..cebfdc3 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,27 @@
+2010-09-28  Luiz Agostini  <luiz.agostini at openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Viewport data change notifications
+        https://bugs.webkit.org/show_bug.cgi?id=46755
+
+        Regarding viewport meta tags, what matters for browser developers is to know when the viewport data has
+        changed and its current value. Viewport data belongs to the document, but it is useful to keep the current
+        viewport data in Page as a reference, to be able to send notifications only when the current viewport
+        has changed.
+
+        * Api/qwebframe.cpp:
+        * Api/qwebframe_p.h:
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::viewportArguments):
+        (QWebPage::viewportConfigurationForSize):
+        * Api/qwebpage_p.h:
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::viewportDataChanged):
+        * WebCoreSupport/ChromeClientQt.h:
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::viewportAsText):
+
 2010-10-04  Simon Hausmann  <simon.hausmann at nokia.com>
 
         Rubber-stamped by Tor Arne Vestbø.
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 9fbc5e5..b38ce09 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -642,7 +642,7 @@ QWebSelectMethod* ChromeClientQt::createSelectPopup() const
 #endif
 }
 
-void ChromeClientQt::didReceiveViewportArguments(Frame* frame, const ViewportArguments& arguments) const
+void ChromeClientQt::dispatchViewportDataDidChange(const ViewportArguments&) const
 {
     emit m_webPage->viewportChangeRequested();
 }
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index 56801aa..0a449f6 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -177,7 +177,7 @@ namespace WebCore {
 
         QWebSelectMethod* createSelectPopup() const;
 
-        virtual void didReceiveViewportArguments(Frame*, const ViewportArguments&) const;
+        virtual void dispatchViewportDataDidChange(const ViewportArguments&) const;
 
         QWebPage* m_webPage;
         WebCore::KURL lastHoverURL;
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index 44f3fc5..550598b 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -631,7 +631,7 @@ void DumpRenderTreeSupportQt::dumpNotification(bool b)
 
 QString DumpRenderTreeSupportQt::viewportAsText(QWebPage* page, const QSize& availableSize)
 {
-    WebCore::ViewportArguments args = page->mainFrame()->d->viewportArguments();
+    WebCore::ViewportArguments args = page->d->viewportArguments();
     WebCore::ViewportConfiguration conf = WebCore::findConfigurationForViewportData(args,
         /* desktop-width */ 980,
         /* device-width  */ 320,

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list