2010-12-06 Philippe Normand <pnormand@igalia.com>
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Dec 2010 18:31:52 +0000 (18:31 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Dec 2010 18:31:52 +0000 (18:31 +0000)
        Reviewed by Martin Robinson.

        [GTK] Support the Mozilla-style Fullscreen Javascript API
        https://bugs.webkit.org/show_bug.cgi?id=50572

        * configure.ac: new configure flag to disable the new Javascript
        Fullscreen API build. It is enabled by default.

WebCore:

        Reviewed by Martin Robinson.

        [GTK] Support the Mozilla-style Fullscreen Javascript API
        https://bugs.webkit.org/show_bug.cgi?id=50572

        * GNUmakefile.am: enable the Javascript Fullscreen API feature if
        it's been requested at configure time.

WebKit/gtk:

        Reviewed by Martin Robinson.

        [GTK] Support the Mozilla-style Fullscreen Javascript API
        https://bugs.webkit.org/show_bug.cgi?id=50572

        Fullscreen API support. It is controlled at runtime using a new
        setting called enable-fullscreen, set to FALSE by default.

        * WebCoreSupport/ChromeClientGtk.cpp:
        (WebKit::ChromeClient::supportsFullScreenForElement):
        (WebKit::ChromeClient::enterFullScreenForElement):
        (WebKit::ChromeClient::exitFullScreenForElement):
        * WebCoreSupport/ChromeClientGtk.h:
        * webkit/webkitwebsettings.cpp:
        (webkit_web_settings_class_init):
        (webkit_web_settings_set_property):
        (webkit_web_settings_get_property):
        (webkit_web_settings_copy):
        * webkit/webkitwebview.cpp:
        (webkit_web_view_update_settings):

WebKitTools:

        Reviewed by Martin Robinson.

        [GTK] Support the Mozilla-style Fullscreen Javascript API
        https://bugs.webkit.org/show_bug.cgi?id=50572

        Enable the Javascript Fullscreen support in the GtkLauncher. Also
        make DRT update the Chrome when the WebView settings have been
        reset to consistent values.

        * DumpRenderTree/gtk/DumpRenderTree.cpp:
        (resetDefaultsToConsistentValues):
        * GtkLauncher/main.c:
        (create_window):
        * Scripts/build-webkit:

LayoutTests:

        Reviewed by Martin Robinson.

        [GTK] Support the Mozilla-style Fullscreen Javascript API
        https://bugs.webkit.org/show_bug.cgi?id=50572

        * platform/gtk/Skipped: Unskip now passing fullscreen tests.

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

15 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/platform/gtk/Skipped
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
WebKit/gtk/webkit/webkitwebsettings.cpp
WebKit/gtk/webkit/webkitwebview.cpp
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
WebKitTools/GtkLauncher/main.c
WebKitTools/Scripts/build-webkit
configure.ac

index 1015832..187598a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-12-06  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Support the Mozilla-style Fullscreen Javascript API
+        https://bugs.webkit.org/show_bug.cgi?id=50572
+
+        * configure.ac: new configure flag to disable the new Javascript
+        Fullscreen API build. It is enabled by default.
+
 2010-12-09  Philippe Normand  <pnormand@igalia.com>
 
         Reviewed by Xan Lopez.
index f0d30de..4da6d36 100644 (file)
@@ -1,3 +1,12 @@
+2010-12-06  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Support the Mozilla-style Fullscreen Javascript API
+        https://bugs.webkit.org/show_bug.cgi?id=50572
+
+        * platform/gtk/Skipped: Unskip now passing fullscreen tests.
+
 2010-12-09  Michael Saboff  <msaboff@apple.com>
 
         Reviewed by Geoffrey Garen.
index 6c782b4..c6b4e68 100644 (file)
@@ -5484,9 +5484,6 @@ media/video-volume.html
 # https://bugs.webkit.org/show_bug.cgi?id=44784
 fast/history/history-subframe-with-name.html
 
-# Full Screen support is not yet enabled.
-fullscreen/
-
 # https://bugs.webkit.org/show_bug.cgi?id=44932
 canvas/philip/tests/2d.path.isPointInPath.edge.html
 
index 2a50842..7449eb3 100644 (file)
@@ -1,3 +1,13 @@
+2010-12-06  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Support the Mozilla-style Fullscreen Javascript API
+        https://bugs.webkit.org/show_bug.cgi?id=50572
+
+        * GNUmakefile.am: enable the Javascript Fullscreen API feature if
+        it's been requested at configure time.
+
 2010-12-09  Yong Li  <yoli@rim.com>
 
         Reviewed by Darin Adler.
index f417a24..ab09db7 100644 (file)
@@ -4115,6 +4115,14 @@ endif # END USE_GSTREAMER
 endif # END ENABLE_VIDEO
 
 # ----
+# Javascript Fullscreen Support
+# ----
+if ENABLE_FULLSCREEN_API
+FEATURE_DEFINES += ENABLE_FULLSCREEN_API=1
+webcore_cppflags += -DENABLE_FULLSCREEN_API=1
+endif # END ENABLE_FULLSCREEN_API
+
+# ----
 # XHTML-MP Support
 # ----
 if ENABLE_XHTMLMP
@@ -4668,7 +4676,8 @@ USER_AGENT_STYLE_SHEETS = \
        $(WebCore)/css/svg.css \
        $(WebCore)/css/wml.css \
        $(WebCore)/css/mediaControls.css \
-       $(WebCore)/css/mediaControlsGtk.css
+       $(WebCore)/css/mediaControlsGtk.css \
+       $(WebCore)/css/fullscreen.css
 
 # new-style JavaScript bindings
 SCRIPTS_BINDINGS = \
index bd413fe..fa635e5 100644 (file)
@@ -1,3 +1,26 @@
+2010-12-06  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Support the Mozilla-style Fullscreen Javascript API
+        https://bugs.webkit.org/show_bug.cgi?id=50572
+
+        Fullscreen API support. It is controlled at runtime using a new
+        setting called enable-fullscreen, set to FALSE by default.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::supportsFullScreenForElement):
+        (WebKit::ChromeClient::enterFullScreenForElement):
+        (WebKit::ChromeClient::exitFullScreenForElement):
+        * WebCoreSupport/ChromeClientGtk.h:
+        * webkit/webkitwebsettings.cpp:
+        (webkit_web_settings_class_init):
+        (webkit_web_settings_set_property):
+        (webkit_web_settings_get_property):
+        (webkit_web_settings_copy):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_update_settings):
+
 2010-12-09  Joone Hur  <joone@kldp.org>
 
         Reviewed by Martin Robinson.
index ad29af0..378f42a 100644 (file)
@@ -688,4 +688,24 @@ void ChromeClient::exitFullscreenForNode(Node* node)
 }
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+bool ChromeClient::supportsFullScreenForElement(const WebCore::Element* element)
+{
+    return true;
+}
+
+void ChromeClient::enterFullScreenForElement(WebCore::Element* element)
+{
+    element->document()->webkitWillEnterFullScreenForElement(element);
+    element->document()->webkitDidEnterFullScreenForElement(element);
+}
+
+void ChromeClient::exitFullScreenForElement(WebCore::Element* element)
+{
+    element->document()->webkitWillExitFullScreenForElement(element);
+    element->document()->webkitDidExitFullScreenForElement(element);
+}
+#endif
+
+
 }
index b4a1a37..e9f1c83 100644 (file)
@@ -145,6 +145,12 @@ namespace WebKit {
         virtual void exitFullscreenForNode(WebCore::Node*);
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+        virtual bool supportsFullScreenForElement(const WebCore::Element*);
+        virtual void enterFullScreenForElement(WebCore::Element*);
+        virtual void exitFullScreenForElement(WebCore::Element*);
+#endif
+
     private:
         WebKitWebView* m_webView;
         WebCore::KURL m_hoveredLinkURL;
index 2661b82..c91049b 100644 (file)
@@ -110,6 +110,7 @@ struct _WebKitWebSettingsPrivate {
     gboolean auto_resize_window;
     gboolean enable_java_applet;
     gboolean enable_hyperlink_auditing;
+    gboolean enable_fullscreen;
 };
 
 #define WEBKIT_WEB_SETTINGS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate))
@@ -161,7 +162,8 @@ enum {
     PROP_ENABLE_PAGE_CACHE,
     PROP_AUTO_RESIZE_WINDOW,
     PROP_ENABLE_JAVA_APPLET,
-    PROP_ENABLE_HYPERLINK_AUDITING
+    PROP_ENABLE_HYPERLINK_AUDITING,
+    PROP_ENABLE_FULLSCREEN
 };
 
 // Create a default user agent string
@@ -902,6 +904,15 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
                                                          FALSE,
                                                          flags));
 
+    /* Undocumented for now */
+    g_object_class_install_property(gobject_class,
+                                    PROP_ENABLE_FULLSCREEN,
+                                    g_param_spec_boolean("enable-fullscreen",
+                                                         _("Enable Fullscreen"),
+                                                         _("Whether the Mozilla style API should be enabled."),
+                                                         FALSE,
+                                                         flags));
+
     g_type_class_add_private(klass, sizeof(WebKitWebSettingsPrivate));
 }
 
@@ -1128,6 +1139,9 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
     case PROP_ENABLE_HYPERLINK_AUDITING:
         priv->enable_hyperlink_auditing = g_value_get_boolean(value);
         break;
+    case PROP_ENABLE_FULLSCREEN:
+        priv->enable_fullscreen = g_value_get_boolean(value);
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
         break;
@@ -1275,6 +1289,9 @@ static void webkit_web_settings_get_property(GObject* object, guint prop_id, GVa
     case PROP_ENABLE_HYPERLINK_AUDITING:
         g_value_set_boolean(value, priv->enable_hyperlink_auditing);
         break;
+    case PROP_ENABLE_FULLSCREEN:
+        g_value_set_boolean(value, priv->enable_fullscreen);
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
         break;
@@ -1350,6 +1367,7 @@ WebKitWebSettings* webkit_web_settings_copy(WebKitWebSettings* web_settings)
                  "auto-resize-window", priv->auto_resize_window,
                  "enable-java-applet", priv->enable_java_applet,
                  "enable-hyperlink-auditing", priv->enable_hyperlink_auditing,
+                 "enable-fullscreen", priv->enable_fullscreen,
                  NULL));
 
     return copy;
index 4652c46..f7c71b2 100644 (file)
@@ -3246,7 +3246,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
         javaScriptCanAccessClipboard, enableOfflineWebAppCache,
         enableUniversalAccessFromFileURI, enableFileAccessFromFileURI,
         enableDOMPaste, tabKeyCyclesThroughElements,
-        enableSiteSpecificQuirks, usePageCache, enableJavaApplet, enableHyperlinkAuditing;
+        enableSiteSpecificQuirks, usePageCache, enableJavaApplet, enableHyperlinkAuditing, enableFullscreen;
 
     WebKitEditingBehavior editingBehavior;
 
@@ -3285,6 +3285,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
                  "enable-page-cache", &usePageCache,
                  "enable-java-applet", &enableJavaApplet,
                  "enable-hyperlink-auditing", &enableHyperlinkAuditing,
+                 "enable-fullscreen", &enableFullscreen,
                  NULL);
 
     settings->setDefaultTextEncodingName(defaultEncoding);
@@ -3322,7 +3323,9 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
     settings->setUsesPageCache(usePageCache);
     settings->setJavaEnabled(enableJavaApplet);
     settings->setHyperlinkAuditingEnabled(enableHyperlinkAuditing);
-
+#if ENABLE(FULLSCREEN_API)
+    settings->setFullScreenEnabled(enableFullscreen);
+#endif
     Page* page = core(webView);
     if (page)
         page->setTabKeyCyclesThroughElements(tabKeyCyclesThroughElements);
index a3aa4c9..07b2858 100644 (file)
@@ -1,3 +1,20 @@
+2010-12-06  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Support the Mozilla-style Fullscreen Javascript API
+        https://bugs.webkit.org/show_bug.cgi?id=50572
+
+        Enable the Javascript Fullscreen support in the GtkLauncher. Also
+        make DRT update the Chrome when the WebView settings have been
+        reset to consistent values.
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (resetDefaultsToConsistentValues):
+        * GtkLauncher/main.c:
+        (create_window):
+        * Scripts/build-webkit:
+
 2010-12-09  Koan-Sin Tan  <koansin.tan@gmail.com>
 
         Reviewed by Tor Arne Vestbø
index 8dfbecd..a20ef99 100644 (file)
@@ -411,7 +411,9 @@ static void resetDefaultsToConsistentValues()
                  "enable-plugins", TRUE,
                  "enable-hyperlink-auditing", FALSE,
                  "editing-behavior", WEBKIT_EDITING_BEHAVIOR_MAC,
+                 "enable-fullscreen", TRUE,
                  NULL);
+    webkit_web_view_set_settings(webView, settings);
 
     DumpRenderTreeSupportGtk::clearMainFrameName(mainFrame);
 
index a1baf05..2fc38ba 100644 (file)
@@ -188,6 +188,7 @@ static GtkWidget* createToolbar(GtkWidget* uriEntry, WebKitWebView* webView)
 static GtkWidget* createWindow(WebKitWebView** outWebView)
 {
     WebKitWebView *webView;
+    WebKitWebSettings *webSettings;
     GtkWidget *vbox;
     GtkWidget *window;
     GtkWidget *uriEntry;
@@ -210,6 +211,10 @@ static GtkWidget* createWindow(WebKitWebView** outWebView)
 
     gtk_container_add(GTK_CONTAINER(window), vbox);
 
+    webSettings = webkit_web_view_get_settings(webView);
+    g_object_set(G_OBJECT(webSettings), "enable-fullscreen", TRUE, NULL);
+    webkit_web_view_set_settings(webView, webSettings);
+
     g_signal_connect(window, "destroy", G_CALLBACK(destroyCb), NULL);
 
     if (outWebView)
index 800e610..7518bea 100755 (executable)
@@ -160,7 +160,7 @@ my @features = (
       define => "ENABLE_FILTERS", default => (isAppleWebKit() || isGtk() || isQt() || isEfl()), value => \$filtersSupport },
 
     { option => "fullscreen-api", desc => "Toggle Fullscreen API support",
-      define => "ENABLE_FULLSCREEN_API", default => isAppleMacWebKit(), value => \$fullscreenAPISupport },
+      define => "ENABLE_FULLSCREEN_API", default => (isAppleMacWebKit() || isGtk()), value => \$fullscreenAPISupport },
 
     { option => "geolocation", desc => "Toggle Geolocation support",
       define => "ENABLE_GEOLOCATION", default => (isAppleWebKit() || isGtk()), value => \$geolocationSupport },
index 0478a8a..f73c2e8 100644 (file)
@@ -469,6 +469,14 @@ AC_ARG_ENABLE(video,
               [],[enable_video="yes"])
 AC_MSG_RESULT([$enable_video])
 
+# check whether to enable Javascript Fullscreen API support
+AC_MSG_CHECKING([whether to enable Fullscreen API support])
+AC_ARG_ENABLE(fullscreen_api,
+              AC_HELP_STRING([--enable-fullscreen-api],
+                             [enable the Fullscreen API support [default=yes]]),
+              [],[enable_fullscreen_api="yes"])
+AC_MSG_RESULT([$enable_fullscreen_api])
+
 # check whether to enable XHTML-MP support
 AC_MSG_CHECKING([whether to enable XHTML-MP support])
 AC_ARG_ENABLE(xhtmlmp,
@@ -948,6 +956,7 @@ AM_CONDITIONAL([ENABLE_FILTERS],[test "$enable_filters" = "yes"])
 AM_CONDITIONAL([ENABLE_GEOLOCATION], [test "$enable_geolocation" = "yes"])
 AM_CONDITIONAL([ENABLE_MATHML], [test "$enable_mathml" = "yes"])
 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
+AM_CONDITIONAL([ENABLE_FULLSCREEN_API],[test "$enable_fullscreen_api" = "yes"])
 AM_CONDITIONAL([ENABLE_NOTIFICATIONS],[test "$enable_notifications" = "yes"])
 AM_CONDITIONAL([ENABLE_ORIENTATION_EVENTS],[test "$enable_orientation_events" = "yes"])
 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
@@ -1018,6 +1027,7 @@ Features:
  HTML5 sandboxed iframe support                           : $enable_sandbox
  HTML5 server-sent events support                         : $enable_eventsource
  HTML5 video element support                              : $enable_video
+ Fullscreen API support                                   : $enable_fullscreen_api
  Icon database support                                    : $enable_icon_database
  Image resizer support                                    : $enable_image_resizer
  Link prefetch support                                    : $enable_link_prefetch