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

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 11:37:12 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit dd10dbe83a6b15994a9f1103a2ac67e8d0f0151a
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Jul 31 02:46:16 2010 +0000

    2010-07-30  Luiz Agostini  <luiz.agostini at openbossa.org>
    
            Reviewed by Simon Fraser.
    
            Enabling view modes to all platforms
            https://bugs.webkit.org/show_bug.cgi?id=37505
    
            Removing ENABLE_WIDGETS_10_SUPPORT flag.
    
            As view mode media feature is not part of widget 1.0 specification
            any more the ENABLE_WIDGETS_10_SUPPORT flag may be removed. The only use
            of this flag was related to view mode media feature implementation in Qt.
    
            * wtf/Platform.h:
    2010-07-30  Luiz Agostini  <luiz.agostini at openbossa.org>
    
            Reviewed by Simon Fraser.
    
            Enabling view modes to all platforms
            https://bugs.webkit.org/show_bug.cgi?id=37505
    
            Removing 'widget' reference from the layout tests because the view mode media feature
            is not part of widget 1.0 specification any more.
    
            The layout tests are stil skipped for all platforms except Qt because of the lack
            of support of LayoutTestController in those platforms.
    
            * fast/media/view-mode-media-feature-expected.txt: Renamed from LayoutTests/fast/media/media-feature-wgt-view-mode-expected.txt.
            * fast/media/view-mode-media-feature.html: Renamed from LayoutTests/fast/media/media-feature-wgt-view-mode.html.
            * platform/gtk/Skipped:
            * platform/mac/Skipped:
            * platform/win/Skipped:
    2010-07-30  Luiz Agostini  <luiz.agostini at openbossa.org>
    
            Reviewed by Simon Fraser.
    
            Enabling view modes to all platforms
            https://bugs.webkit.org/show_bug.cgi?id=37505
    
            View mode media feature implementation as specified in http://www.w3.org/TR/view-mode.
    
            The view mode media feature layout tests are stil skipped for all platforms except Qt
            because of the lack of support of LayoutTestController in those platforms.
    
            Test: fast/media/view-mode-media-feature.html
    
            * css/MediaFeatureNames.h:
            * css/MediaQueryEvaluator.cpp:
            (WebCore::view_modeMediaFeatureEval):
            * page/ChromeClient.h:
            * page/Page.cpp:
            (WebCore::Page::Page):
            (WebCore::createViewModesSet):
            (WebCore::Page::setViewMode):
            * page/Page.h:
            (WebCore::Page::viewMode):
    2010-07-30  Luiz Agostini  <luiz.agostini at openbossa.org>
    
            Reviewed by Simon Fraser.
    
            Enabling view modes to all platforms
            https://bugs.webkit.org/show_bug.cgi?id=37505
    
            As view mode media feature is now supported by WebCore there is no need
            to keep its implementation here. QtWebKit now uses WebCore's view mode media feature
            implementation.
    
            * Api/qwebpage.cpp:
            (QWebPagePrivate::dynamicPropertyChangeEvent):
            * Api/qwebpage_p.h:
            * WebCoreSupport/ChromeClientQt.cpp:
            * WebCoreSupport/ChromeClientQt.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64401 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 04bbc96..2244432 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-07-30  Luiz Agostini  <luiz.agostini at openbossa.org>
+
+        Reviewed by Simon Fraser.
+
+        Enabling view modes to all platforms
+        https://bugs.webkit.org/show_bug.cgi?id=37505
+
+        Removing ENABLE_WIDGETS_10_SUPPORT flag.
+
+        As view mode media feature is not part of widget 1.0 specification
+        any more the ENABLE_WIDGETS_10_SUPPORT flag may be removed. The only use
+        of this flag was related to view mode media feature implementation in Qt. 
+
+        * wtf/Platform.h:
+
 2010-07-30  Andy Estes  <aestes at apple.com>
 
         Reviewed by David Kilzer.
diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h
index f4a71b0..51bf92d 100644
--- a/JavaScriptCore/wtf/Platform.h
+++ b/JavaScriptCore/wtf/Platform.h
@@ -571,9 +571,6 @@
 
 #if PLATFORM(QT)
 #define WTF_USE_QT4_UNICODE 1
-#if !defined(ENABLE_WIDGETS_10_SUPPORT)
-#define ENABLE_WIDGETS_10_SUPPORT 1
-#endif
 #elif OS(WINCE)
 #define WTF_USE_WINCE_UNICODE 1
 #elif PLATFORM(GTK)
@@ -837,10 +834,6 @@
 #define ENABLE_DASHBOARD_SUPPORT 0
 #endif
 
-#if !defined(ENABLE_WIDGETS_10_SUPPORT)
-#define ENABLE_WIDGETS_10_SUPPORT 0
-#endif
-
 #if !defined(ENABLE_INSPECTOR)
 #define ENABLE_INSPECTOR 1
 #endif
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5f55269..0a96fcb 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,22 @@
+2010-07-30  Luiz Agostini  <luiz.agostini at openbossa.org>
+
+        Reviewed by Simon Fraser.
+
+        Enabling view modes to all platforms
+        https://bugs.webkit.org/show_bug.cgi?id=37505
+
+        Removing 'widget' reference from the layout tests because the view mode media feature
+        is not part of widget 1.0 specification any more.
+
+        The layout tests are stil skipped for all platforms except Qt because of the lack
+        of support of LayoutTestController in those platforms.
+
+        * fast/media/view-mode-media-feature-expected.txt: Renamed from LayoutTests/fast/media/media-feature-wgt-view-mode-expected.txt.
+        * fast/media/view-mode-media-feature.html: Renamed from LayoutTests/fast/media/media-feature-wgt-view-mode.html.
+        * platform/gtk/Skipped:
+        * platform/mac/Skipped:
+        * platform/win/Skipped:
+
 2010-07-30  Andrew Wilson  <atwilson at chromium.org>
 
         Unreviewed expectations change for chromium.
diff --git a/LayoutTests/fast/media/media-feature-wgt-view-mode.html b/LayoutTests/fast/media/media-feature-wgt-view-mode.html
deleted file mode 100644
index 4edd067..0000000
--- a/LayoutTests/fast/media/media-feature-wgt-view-mode.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<head>
-    <title>Testing Widgets 1.0 View Mode Media Feature</title>
-    <style type="text/css">
-        div {
-            background-color: red;
-        }
-        @media (-webkit-view-mode: minimized) {
-            body {
-                background-color: blue;
-            }
-        }
-        @media (-webkit-view-mode) {
-            div {
-                background-color: green;
-            }
-        }
-    </style>
-    <script>
-        if (window.layoutTestController)
-            layoutTestController.setViewModeMediaFeature("minimized");
-    </script>
-</head>
-<body>
-    <div style="width: 200; height: 200;"\>
-</body>
diff --git a/LayoutTests/fast/media/media-feature-wgt-view-mode-expected.txt b/LayoutTests/fast/media/view-mode-media-feature-expected.txt
similarity index 100%
rename from LayoutTests/fast/media/media-feature-wgt-view-mode-expected.txt
rename to LayoutTests/fast/media/view-mode-media-feature-expected.txt
diff --git a/LayoutTests/fast/media/view-mode-media-feature.html b/LayoutTests/fast/media/view-mode-media-feature.html
new file mode 100644
index 0000000..4a9dc79
--- /dev/null
+++ b/LayoutTests/fast/media/view-mode-media-feature.html
@@ -0,0 +1,25 @@
+<head>
+    <title>Testing the View Mode Media Feature</title>
+    <style type="text/css">
+        div {
+            background-color: red;
+        }
+        @media (-webkit-view-mode: minimized) {
+            body {
+                background-color: blue;
+            }
+        }
+        @media (-webkit-view-mode) {
+            div {
+                background-color: green;
+            }
+        }
+    </style>
+    <script>
+        if (window.layoutTestController)
+            layoutTestController.setViewModeMediaFeature("minimized");
+    </script>
+</head>
+<body>
+    <div style="width: 200; height: 200;"\>
+</body>
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index 7cddfb4..5b23f74 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -5456,8 +5456,8 @@ fast/runin/generated2.html
 fast/runin/generated3.html
 fast/runin/generated4.html
 
-# No Widgets 1.0 support
-fast/media/media-feature-wgt-view-mode.html
+# view mode media feature
+fast/media/view-mode-media-feature.html
 
 # MediaPlayerPrivateGStreamer doesn't return to NETWORK_IDLE and hence doesn't fire a suspend event
 # https://bugs.webkit.org/show_bug.cgi?id=37034
diff --git a/LayoutTests/platform/mac/Skipped b/LayoutTests/platform/mac/Skipped
index 47c537d..cf49fc0 100644
--- a/LayoutTests/platform/mac/Skipped
+++ b/LayoutTests/platform/mac/Skipped
@@ -139,8 +139,8 @@ http/tests/plugins/plugin-document-has-focus.html
 # Misses setMediaType() and implementation
 fast/media/print-restores-previous-mediatype.html
 
-# No Widgets 1.0 support
-fast/media/media-feature-wgt-view-mode.html
+# view mode media feature
+fast/media/view-mode-media-feature.html
 
 # Test is flaky and thus not useful until fixed.
 # https://bugs.webkit.org/show_bug.cgi?id=36642
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 4768335..7c8da3e 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -837,8 +837,8 @@ fast/dom/HTMLMeterElement/meter-optimums.html
 fast/dom/HTMLMeterElement/meter-styles.html
 fast/dom/HTMLMeterElement/meter-styles-changing-pseudo.html
 
-# No Widgets 1.0 support
-fast/media/media-feature-wgt-view-mode.html
+# view mode media feature
+fast/media/view-mode-media-feature.html
 
 # Need expectations. See https://bugs.webkit.org/show_bug.cgi?id=36461
 fast/repaint/overflow-scroll-body-appear.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 259eb04..9376af7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,28 @@
+2010-07-30  Luiz Agostini  <luiz.agostini at openbossa.org>
+
+        Reviewed by Simon Fraser.
+
+        Enabling view modes to all platforms
+        https://bugs.webkit.org/show_bug.cgi?id=37505
+
+        View mode media feature implementation as specified in http://www.w3.org/TR/view-mode.
+
+        The view mode media feature layout tests are stil skipped for all platforms except Qt
+        because of the lack of support of LayoutTestController in those platforms.
+
+        Test: fast/media/view-mode-media-feature.html
+
+        * css/MediaFeatureNames.h:
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::view_modeMediaFeatureEval):
+        * page/ChromeClient.h:
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        (WebCore::createViewModesSet):
+        (WebCore::Page::setViewMode):
+        * page/Page.h:
+        (WebCore::Page::viewMode):
+
 2010-07-30  Joseph Pecoraro  <joepeck at webkit.org>
 
         Reviewed by David Kilzer.
diff --git a/WebCore/css/MediaFeatureNames.h b/WebCore/css/MediaFeatureNames.h
index 8aaedb2..b8f2720 100644
--- a/WebCore/css/MediaFeatureNames.h
+++ b/WebCore/css/MediaFeatureNames.h
@@ -25,13 +25,6 @@
 namespace WebCore {
     namespace MediaFeatureNames {
 
-#if ENABLE(WIDGETS_10_SUPPORT)
-#define CSS_MEDIAQUERY_NAMES_FOR_WIDGETS_10_MEDIAFEATURE(macro) \
-    macro(view_mode, "-webkit-view-mode")
-#else
-#define CSS_MEDIAQUERY_NAMES_FOR_WIDGETS_10_MEDIAFEATURE(macro)
-#endif
-
 #define CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(macro) \
     macro(color, "color") \
     macro(grid, "grid") \
@@ -66,7 +59,7 @@ namespace WebCore {
     macro(transform_3d, "-webkit-transform-3d") \
     macro(transition, "-webkit-transition") \
     macro(animation, "-webkit-animation") \
-    CSS_MEDIAQUERY_NAMES_FOR_WIDGETS_10_MEDIAFEATURE(macro)
+    macro(view_mode, "-webkit-view-mode")
 
 // end of macro
 
diff --git a/WebCore/css/MediaQueryEvaluator.cpp b/WebCore/css/MediaQueryEvaluator.cpp
index 9d5822f..0b5507e 100644
--- a/WebCore/css/MediaQueryEvaluator.cpp
+++ b/WebCore/css/MediaQueryEvaluator.cpp
@@ -498,28 +498,13 @@ static bool transform_3dMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* f
     return returnValueIfNoParameter;
 }
 
-#if ENABLE(WIDGETS_10_SUPPORT)
 static bool view_modeMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
 {
-    if (value) {
-        String mode = static_cast<CSSPrimitiveValue*>(value)->getStringValue();
-        if (ChromeClient* client = frame->page()->chrome()->client()) {
-            if (mode == "windowed" && client->isWindowed())
-                return true;
-            if (mode == "floating" && client->isFloating())
-                return true;
-            if (mode == "fullscreen" && client->isFullscreen())
-                return true;
-            if (mode == "maximized" && client->isMaximized())
-                return true;
-            if (mode == "minimized" && client->isMinimized())
-                return true;
-            return false;
-        }
-    }
-    return true;
+    UNUSED_PARAM(op);
+    if (!value)
+        return true;
+    return Page::stringToViewMode(static_cast<CSSPrimitiveValue*>(value)->getStringValue()) == frame->page()->viewMode();
 }
-#endif
 
 static void createFunctionMap()
 {
diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.h
index 6f244c2..39a41ae 100644
--- a/WebCore/page/ChromeClient.h
+++ b/WebCore/page/ChromeClient.h
@@ -262,14 +262,6 @@ namespace WebCore {
         virtual void needTouchEvents(bool) = 0;
 #endif
 
-#if ENABLE(WIDGETS_10_SUPPORT)
-        virtual bool isWindowed() { return false; }
-        virtual bool isFloating() { return false; }
-        virtual bool isFullscreen() { return false; }
-        virtual bool isMaximized() { return false; }
-        virtual bool isMinimized() { return false; }
-#endif
-
     protected:
         virtual ~ChromeClient() { }
     };
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index f39d786..94d2940 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -167,6 +167,7 @@ Page::Page(const PageClients& pageClients)
     , m_customHTMLTokenizerTimeDelay(-1)
     , m_customHTMLTokenizerChunkSize(-1)
     , m_canStartMedia(true)
+    , m_viewMode(ViewModeWindowed)
 {
     if (!allPages) {
         allPages = new HashSet<Page*>;
@@ -220,6 +221,45 @@ Page::~Page()
 #endif
 }
 
+struct ViewModeInfo {
+    const char* name;
+    Page::ViewMode type;
+};
+static const int viewModeMapSize = 5;
+static ViewModeInfo viewModeMap[viewModeMapSize] = {
+    {"windowed", Page::ViewModeWindowed},
+    {"floating", Page::ViewModeFloating},
+    {"fullscreen", Page::ViewModeFullscreen},
+    {"maximized", Page::ViewModeMaximized},
+    {"minimized", Page::ViewModeMinimized}
+};
+
+Page::ViewMode Page::stringToViewMode(const String& text)
+{
+    for (int i = 0; i < viewModeMapSize; ++i) {
+        if (text == viewModeMap[i].name)
+            return viewModeMap[i].type;
+    }
+    return Page::ViewModeInvalid;
+}
+
+void Page::setViewMode(ViewMode viewMode)
+{
+    if (viewMode == m_viewMode || viewMode == ViewModeInvalid)
+        return;
+
+    m_viewMode = viewMode;
+
+    if (!m_mainFrame)
+        return;
+
+    if (m_mainFrame->view())
+        m_mainFrame->view()->forceLayout();
+
+    if (m_mainFrame->document())
+        m_mainFrame->document()->updateStyleSelector();
+}
+
 void Page::setMainFrame(PassRefPtr<Frame> mainFrame)
 {
     ASSERT(!m_mainFrame); // Should only be called during initialization
diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h
index aab95f3..62af0a7 100644
--- a/WebCore/page/Page.h
+++ b/WebCore/page/Page.h
@@ -186,6 +186,20 @@ namespace WebCore {
 #endif
         Settings* settings() const { return m_settings.get(); }
         ProgressTracker* progress() const { return m_progress.get(); }
+
+
+        enum ViewMode {
+            ViewModeInvalid,
+            ViewModeWindowed,
+            ViewModeFloating,
+            ViewModeFullscreen,
+            ViewModeMaximized,
+            ViewModeMinimized
+        };
+        static ViewMode stringToViewMode(const String&);
+
+        ViewMode viewMode() const { return m_viewMode; }
+        void setViewMode(ViewMode);
         
         void setTabKeyCyclesThroughElements(bool b) { m_tabKeyCyclesThroughElements = b; }
         bool tabKeyCyclesThroughElements() const { return m_tabKeyCyclesThroughElements; }
@@ -361,6 +375,8 @@ namespace WebCore {
 #if ENABLE(NOTIFICATIONS)
         NotificationPresenter* m_notificationPresenter;
 #endif
+
+        ViewMode m_viewMode;
     };
 
 } // namespace WebCore
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index fa49293..a8bd06a 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -1218,14 +1218,7 @@ typedef struct {
 void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* event)
 {
     if (event->propertyName() == "_q_viewMode") {
-        QString mode = q->property("_q_viewMode").toString();
-        if (mode != viewMode) {
-            viewMode = mode;
-            WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame());
-            WebCore::FrameView* view = frame->view();
-            frame->document()->updateStyleSelector();
-            view->layout();
-        }
+        page->setViewMode(Page::stringToViewMode(q->property("_q_viewMode").toString()));
     } else if (event->propertyName() == "_q_HTMLTokenizerChunkSize") {
         int chunkSize = q->property("_q_HTMLTokenizerChunkSize").toInt();
         q->handle()->page->setCustomHTMLTokenizerChunkSize(chunkSize);
diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h
index 44ceb87..cf4ab88 100644
--- a/WebKit/qt/Api/qwebpage_p.h
+++ b/WebKit/qt/Api/qwebpage_p.h
@@ -201,8 +201,6 @@ public:
     QWebInspector* inspector;
     bool inspectorIsInternalOnly; // True if created through the Inspect context menu action
     Qt::DropAction m_lastDropAction;
-    
-    QString viewMode;
 
     static bool drtRun;
 };
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 95fe09d..aecb4ea 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,20 @@
+2010-07-30  Luiz Agostini  <luiz.agostini at openbossa.org>
+
+        Reviewed by Simon Fraser.
+
+        Enabling view modes to all platforms
+        https://bugs.webkit.org/show_bug.cgi?id=37505
+
+        As view mode media feature is now supported by WebCore there is no need
+        to keep its implementation here. QtWebKit now uses WebCore's view mode media feature
+        implementation.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::dynamicPropertyChangeEvent):
+        * Api/qwebpage_p.h:
+        * WebCoreSupport/ChromeClientQt.cpp:
+        * WebCoreSupport/ChromeClientQt.h:
+
 2010-07-30  Joseph Pecoraro  <joepeck at webkit.org>
 
         Reviewed by David Kilzer.
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 935c006..2df8c78 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -603,33 +603,6 @@ QtAbstractWebPopup* ChromeClientQt::createSelectPopup()
 #endif
 }
 
-#if ENABLE(WIDGETS_10_SUPPORT)
-bool ChromeClientQt::isWindowed()
-{
-    return m_webPage->d->viewMode == "windowed";
-}
-
-bool ChromeClientQt::isFloating()
-{
-    return m_webPage->d->viewMode == "floating";
-}
-
-bool ChromeClientQt::isFullscreen()
-{
-    return m_webPage->d->viewMode == "fullscreen";
-}
-
-bool ChromeClientQt::isMaximized()
-{
-    return m_webPage->d->viewMode == "maximized";
-}
-
-bool ChromeClientQt::isMinimized()
-{
-    return m_webPage->d->viewMode == "minimized";
-}
-#endif
-
 void ChromeClientQt::didReceiveViewportArguments(Frame* frame, const ViewportArguments& arguments) const
 {
     if (m_webPage->mainFrame()->d->initialLayoutComplete)
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index 70bf872..98abf5f 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -169,14 +169,6 @@ namespace WebCore {
         virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*);
         virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*) { }
 
-#if ENABLE(WIDGETS_10_SUPPORT)
-        virtual bool isWindowed();
-        virtual bool isFloating();
-        virtual bool isFullscreen();
-        virtual bool isMaximized();
-        virtual bool isMinimized();
-#endif
-
         QtAbstractWebPopup* createSelectPopup();
 
         virtual void didReceiveViewportArguments(Frame*, const ViewportArguments&) const;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list