LayoutTests
authorkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Aug 2010 13:30:53 +0000 (13:30 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Aug 2010 13:30:53 +0000 (13:30 +0000)
2010-08-19  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>

        Reviewed by Kenneth Rohde Christiansen.

        [Gtk] Enable view mode media feature layout test
        https://bugs.webkit.org/show_bug.cgi?id=43278

        Unskip tests that are now passing.

        * platform/gtk/Skipped:

WebKit/gtk

2010-08-19  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>

        Reviewed by Kenneth Rohde Christiansen.

        [Gtk] Enable view mode media feature layout test
        https://bugs.webkit.org/show_bug.cgi?id=43278

        Add the view-mode property, to control the WebCore page's viewMode.

        * docs/webkitgtk-sections.txt:
        * webkit/webkitwebview.cpp:
        (webkit_web_view_get_property):
        (webkit_web_view_set_property):
        (webkit_web_view_class_init):
        (webkit_web_view_set_view_mode):
        (webkit_web_view_get_view_mode):
        * webkit/webkitwebview.h:

WebKitTools

2010-08-19  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>

        Reviewed by Kenneth Rohde Christiansen.

        [Gtk] Enable view mode media feature layout test
        https://bugs.webkit.org/show_bug.cgi?id=43278

        Add view mode media feature testing infrastructure, and add
        placeholder methods for the other platforms'
        LayoutTestControllers.

        * DumpRenderTree/LayoutTestController.cpp:
        (setViewModeMediaFeatureCallback):
        (LayoutTestController::staticFunctions):
        * DumpRenderTree/LayoutTestController.h:
        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
        (LayoutTestController::setViewModeMediaFeature):
        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
        (LayoutTestController::setViewModeMediaFeature):
        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
        (LayoutTestController::setViewModeMediaFeature):
        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
        (LayoutTestController::setViewModeMediaFeature):

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

13 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/gtk/Skipped
WebKit/gtk/ChangeLog
WebKit/gtk/docs/webkitgtk-sections.txt
WebKit/gtk/webkit/webkitwebview.cpp
WebKit/gtk/webkit/webkitwebview.h
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/LayoutTestController.cpp
WebKitTools/DumpRenderTree/LayoutTestController.h
WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp

index 781cb19..af26686 100644 (file)
@@ -1,3 +1,14 @@
+2010-08-19  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Gtk] Enable view mode media feature layout test
+        https://bugs.webkit.org/show_bug.cgi?id=43278
+
+        Unskip tests that are now passing.
+
+        * platform/gtk/Skipped:
+
 2010-08-19  Nikolas Zimmermann  <nzimmermann@rim.com>
 
         Reviewed by Dirk Schulze.
index 4670ada..447b4e3 100644 (file)
@@ -5510,9 +5510,6 @@ fast/runin/generated2.html
 fast/runin/generated3.html
 fast/runin/generated4.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
 http/tests/media/video-play-suspend.html
index 2863a52..46c69e9 100644 (file)
@@ -1,3 +1,21 @@
+2010-08-19  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Gtk] Enable view mode media feature layout test
+        https://bugs.webkit.org/show_bug.cgi?id=43278
+
+        Add the view-mode property, to control the WebCore page's viewMode.
+
+        * docs/webkitgtk-sections.txt:
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_get_property):
+        (webkit_web_view_set_property):
+        (webkit_web_view_class_init):
+        (webkit_web_view_set_view_mode):
+        (webkit_web_view_get_view_mode):
+        * webkit/webkitwebview.h:
+
 2010-08-19  Philippe Normand  <pnormand@igalia.com>
 
         Reviewed by Gustavo Noronha Silva.
index 0083146..35f9b40 100644 (file)
@@ -419,6 +419,7 @@ WebKitNetworkResponseClass
 <FILE>webkitwebview</FILE>
 WebKitNavigationResponse
 WebKitWebViewTargetInfo
+WebKitWebViewViewMode
 <TITLE>WebKitWebView</TITLE>
 WebKitWebView
 webkit_web_view_can_copy_clipboard
@@ -453,6 +454,7 @@ webkit_web_view_get_settings
 webkit_web_view_get_title
 webkit_web_view_get_transparent
 webkit_web_view_get_uri
+webkit_web_view_get_view_mode
 webkit_web_view_get_view_source_mode
 webkit_web_view_get_zoom_level
 webkit_web_view_go_back
@@ -481,6 +483,7 @@ webkit_web_view_set_highlight_text_matches
 webkit_web_view_set_maintains_back_forward_list
 webkit_web_view_set_settings
 webkit_web_view_set_transparent
+webkit_web_view_set_view_mode
 webkit_web_view_set_view_source_mode
 webkit_web_view_set_zoom_level
 webkit_web_view_stop_loading
index 64b7dcc..75edd35 100644 (file)
@@ -195,7 +195,8 @@ enum {
     PROP_ENCODING,
     PROP_CUSTOM_ENCODING,
     PROP_ICON_URI,
-    PROP_IM_CONTEXT
+    PROP_IM_CONTEXT,
+    PROP_VIEW_MODE
 };
 
 static guint webkit_web_view_signals[LAST_SIGNAL] = { 0, };
@@ -449,6 +450,9 @@ static void webkit_web_view_get_property(GObject* object, guint prop_id, GValue*
     case PROP_IM_CONTEXT:
         g_value_set_object(value, webkit_web_view_get_im_context(webView));
         break;
+    case PROP_VIEW_MODE:
+        g_value_set_enum(value, webkit_web_view_get_view_mode(webView));
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
     }
@@ -480,6 +484,9 @@ static void webkit_web_view_set_property(GObject* object, guint prop_id, const G
     case PROP_CUSTOM_ENCODING:
         webkit_web_view_set_custom_encoding(webView, g_value_get_string(value));
         break;
+    case PROP_VIEW_MODE:
+        webkit_web_view_set_view_mode(webView, static_cast<WebKitWebViewViewMode>(g_value_get_enum(value)));
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
     }
@@ -2859,6 +2866,32 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
                                                         GTK_TYPE_IM_CONTEXT,
                                                         WEBKIT_PARAM_READABLE));
 
+    /**
+    * WebKitWebView:view-mode:
+    *
+    * The "view-mode" media feature for the #WebKitWebView.
+    *
+    * The "view-mode" media feature is additional information for web
+    * applications about how the application is running, when it comes
+    * to user experience. Whether the application is running inside a
+    * regular browser window, in a dedicated window, fullscreen, for
+    * instance.
+    *
+    * This property stores a %WebKitWebViewViewMode value that matches
+    * the "view-mode" media feature the web application will see.
+    *
+    * See http://www.w3.org/TR/view-mode/ for more information.
+    *
+    * Since: 1.3.4
+    */
+    g_object_class_install_property(objectClass, PROP_VIEW_MODE,
+                                    g_param_spec_enum("view-mode",
+                                                      "View Mode",
+                                                      "The view-mode media feature for the #WebKitWebView.",
+                                                      WEBKIT_TYPE_WEB_VIEW_VIEW_MODE,
+                                                      WEBKIT_WEB_VIEW_VIEW_MODE_WINDOWED,
+                                                      WEBKIT_PARAM_READWRITE));
+
     g_type_class_add_private(webViewClass, sizeof(WebKitWebViewPrivate));
 }
 
@@ -4252,6 +4285,76 @@ const char* webkit_web_view_get_custom_encoding(WebKitWebView* webView)
 }
 
 /**
+ * webkit_web_view_set_view_mode:
+ * @web_view: the #WebKitWebView that will have its view mode set
+ * @mode: the %WebKitWebViewViewMode to be set
+ *
+ * Sets the view-mode property of the #WebKitWebView. Check the
+ * property's documentation for more information.
+ *
+ * Since: 1.3.4
+ */
+void webkit_web_view_set_view_mode(WebKitWebView* webView, WebKitWebViewViewMode mode)
+{
+    g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
+
+    Page* page = core(webView);
+
+    switch (mode) {
+    case WEBKIT_WEB_VIEW_VIEW_MODE_FLOATING:
+        page->setViewMode(Page::ViewModeFloating);
+        break;
+    case WEBKIT_WEB_VIEW_VIEW_MODE_FULLSCREEN:
+        page->setViewMode(Page::ViewModeFullscreen);
+        break;
+    case WEBKIT_WEB_VIEW_VIEW_MODE_MAXIMIZED:
+        page->setViewMode(Page::ViewModeMaximized);
+        break;
+    case WEBKIT_WEB_VIEW_VIEW_MODE_MINIMIZED:
+        page->setViewMode(Page::ViewModeMinimized);
+        break;
+    default:
+        page->setViewMode(Page::ViewModeWindowed);
+        break;
+    }
+}
+
+/**
+ * webkit_web_view_get_view_mode:
+ * @web_view: the #WebKitWebView to obtain the view mode from
+ *
+ * Gets the value of the view-mode property of the
+ * #WebKitWebView. Check the property's documentation for more
+ * information.
+ *
+ * Return value: the %WebKitWebViewViewMode currently set for the
+ * #WebKitWebView.
+ *
+ * Since: 1.3.4
+ */
+WebKitWebViewViewMode webkit_web_view_get_view_mode(WebKitWebView* webView)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), WEBKIT_WEB_VIEW_VIEW_MODE_WINDOWED);
+
+    Page* page = core(webView);
+    Page::ViewMode mode = page->viewMode();
+
+    if (mode == Page::ViewModeFloating)
+        return WEBKIT_WEB_VIEW_VIEW_MODE_FLOATING;
+
+    if (mode == Page::ViewModeFullscreen)
+        return WEBKIT_WEB_VIEW_VIEW_MODE_FULLSCREEN;
+
+    if (mode == Page::ViewModeMaximized)
+        return WEBKIT_WEB_VIEW_VIEW_MODE_MAXIMIZED;
+
+    if (mode == Page::ViewModeMinimized)
+        return WEBKIT_WEB_VIEW_VIEW_MODE_MINIMIZED;
+
+    return WEBKIT_WEB_VIEW_VIEW_MODE_WINDOWED;
+}
+
+/**
  * webkit_web_view_move_cursor:
  * @web_view: a #WebKitWebView
  * @step: a #GtkMovementStep
index 865ae9d..a320131 100644 (file)
@@ -64,6 +64,15 @@ typedef enum
     WEBKIT_WEB_VIEW_TARGET_INFO_NETSCAPE_URL
 } WebKitWebViewTargetInfo;
 
+typedef enum
+{
+    WEBKIT_WEB_VIEW_VIEW_MODE_WINDOWED,
+    WEBKIT_WEB_VIEW_VIEW_MODE_FLOATING,
+    WEBKIT_WEB_VIEW_VIEW_MODE_FULLSCREEN,
+    WEBKIT_WEB_VIEW_VIEW_MODE_MAXIMIZED,
+    WEBKIT_WEB_VIEW_VIEW_MODE_MINIMIZED
+} WebKitWebViewViewMode;
+
 struct _WebKitWebView {
     GtkContainer parent_instance;
 
@@ -340,6 +349,13 @@ WEBKIT_API const char*
 webkit_web_view_get_custom_encoding             (WebKitWebView        * webView);
 
 WEBKIT_API void
+webkit_web_view_set_view_mode                   (WebKitWebView        *web_view,
+                                                 WebKitWebViewViewMode mode);
+
+WEBKIT_API WebKitWebViewViewMode
+webkit_web_view_get_view_mode                   (WebKitWebView        *web_view);
+
+WEBKIT_API void
 webkit_web_view_move_cursor                     (WebKitWebView        * webView,
                                                  GtkMovementStep        step,
                                                  gint                   count);
index 687ff69..bb67bb5 100644 (file)
@@ -1,3 +1,27 @@
+2010-08-19  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Gtk] Enable view mode media feature layout test
+        https://bugs.webkit.org/show_bug.cgi?id=43278
+
+        Add view mode media feature testing infrastructure, and add
+        placeholder methods for the other platforms'
+        LayoutTestControllers.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (setViewModeMediaFeatureCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::setViewModeMediaFeature):
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::setViewModeMediaFeature):
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::setViewModeMediaFeature):
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::setViewModeMediaFeature):
+
 2010-08-18  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Sam Weinig.
index 700b44c..1643ba6 100644 (file)
@@ -1315,6 +1315,21 @@ static JSValueRef setUserStyleSheetLocationCallback(JSContextRef context, JSObje
     return JSValueMakeUndefined(context);
 }
 
+static JSValueRef setViewModeMediaFeatureCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    // Has mac implementation
+    if (argumentCount < 1)
+        return JSValueMakeUndefined(context);
+
+    JSRetainPtr<JSStringRef> mode(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+    ASSERT(!*exception);
+
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    controller->setViewModeMediaFeature(mode.get());
+
+    return JSValueMakeUndefined(context);
+}
+
 static JSValueRef setWillSendRequestClearHeaderCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     // Has mac & windows implementation
@@ -1929,6 +1944,7 @@ JSStaticFunction* LayoutTestController::staticFunctions()
         { "setUseDashboardCompatibilityMode", setUseDashboardCompatibilityModeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setUserStyleSheetEnabled", setUserStyleSheetEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setUserStyleSheetLocation", setUserStyleSheetLocationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "setViewModeMediaFeature", setViewModeMediaFeatureCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setWebViewEditable", setWebViewEditableCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setWillSendRequestClearHeader", setWillSendRequestClearHeaderCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setWillSendRequestReturnsNull", setWillSendRequestReturnsNullCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
index 2bab542..2bf7a75 100644 (file)
@@ -104,6 +104,7 @@ public:
     void setUseDashboardCompatibilityMode(bool flag);
     void setUserStyleSheetEnabled(bool flag);
     void setUserStyleSheetLocation(JSStringRef path);
+    void setViewModeMediaFeature(JSStringRef mode);
     void setXSSAuditorEnabled(bool flag);
     void setFrameFlatteningEnabled(bool enable);
     void setSpatialNavigationEnabled(bool enable);
index db44a60..32be43d 100644 (file)
@@ -353,6 +353,27 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
         setUserStyleSheetEnabled(true);
 }
 
+void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
+{
+    WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+    ASSERT(view);
+
+    char* viewMode = JSStringCopyUTF8CString(mode);
+
+    if (!g_strcmp0(viewMode, "windowed"))
+        webkit_web_view_set_view_mode(view, WEBKIT_WEB_VIEW_VIEW_MODE_WINDOWED);
+    else if (!g_strcmp0(viewMode, "floating"))
+        webkit_web_view_set_view_mode(view, WEBKIT_WEB_VIEW_VIEW_MODE_FLOATING);
+    else if (!g_strcmp0(viewMode, "fullscreen"))
+        webkit_web_view_set_view_mode(view, WEBKIT_WEB_VIEW_VIEW_MODE_FULLSCREEN);
+    else if (!g_strcmp0(viewMode, "maximized"))
+        webkit_web_view_set_view_mode(view, WEBKIT_WEB_VIEW_VIEW_MODE_MAXIMIZED);
+    else if (!g_strcmp0(viewMode, "minimized"))
+        webkit_web_view_set_view_mode(view, WEBKIT_WEB_VIEW_VIEW_MODE_MINIMIZED);
+
+    g_free(viewMode);
+}
+
 void LayoutTestController::setWindowIsKey(bool windowIsKey)
 {
     // FIXME: implement
index a85ac2e..97c177d 100644 (file)
@@ -468,6 +468,11 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
     [[WebPreferences standardPreferences] setUserStyleSheetLocation:url];
 }
 
+void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
+{
+    // FIXME: implement
+}
+
 void LayoutTestController::disableImageLoading()
 {
     [[WebPreferences standardPreferences] setLoadsImagesAutomatically:NO];
index 1ff88e5..68f4a6a 100644 (file)
@@ -751,6 +751,11 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef jsURL)
     SysFreeString(resultPathBSTR);
 }
 
+void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
+{
+    // FIXME: implement
+}
+
 void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
 {
     RetainPtr<CFStringRef> urlString(AdoptCF, JSStringCopyCFString(0, jsURL));
index 9fee1e3..f36c290 100644 (file)
@@ -135,6 +135,11 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
 {
 }
 
+void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
+{
+    // FIXME: implement
+}
+
 void LayoutTestController::setWindowIsKey(bool windowIsKey)
 {
     // FIXME: implement