Make the fullscreen JS API enabled at runtime.
authorkoz@chromium.org <koz@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Aug 2011 02:06:58 +0000 (02:06 +0000)
committerkoz@chromium.org <koz@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Aug 2011 02:06:58 +0000 (02:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=65501

Reviewed by Adam Barth.

Source/WebCore:

* bindings/generic/RuntimeEnabledFeatures.cpp:
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webkitFullScreenAPIEnabled):
(WebCore::RuntimeEnabledFeatures::setWebkitFullScreenAPIEnabled):
(WebCore::RuntimeEnabledFeatures::webkitRequestFullScreenEnabled):
(WebCore::RuntimeEnabledFeatures::webkitIsFullScreenEnabled):
(WebCore::RuntimeEnabledFeatures::webkitFullScreenKeyboardInputAllowedEnabled):
(WebCore::RuntimeEnabledFeatures::webkitCurrentFullScreenElementEnabled):
(WebCore::RuntimeEnabledFeatures::webkitCancelFullScreenEnabled):
* dom/Document.idl:
* dom/Element.idl:

Source/WebKit/chromium:

* public/WebRuntimeFeatures.h:
* src/WebRuntimeFeatures.cpp:
(WebKit::WebRuntimeFeatures::enableFullScreenAPI):
(WebKit::WebRuntimeFeatures::isFullScreenAPIEnabled):

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

Source/WebCore/ChangeLog
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
Source/WebCore/dom/Document.idl
Source/WebCore/dom/Element.idl
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebRuntimeFeatures.h
Source/WebKit/chromium/src/WebRuntimeFeatures.cpp

index 7ce4452..b1d367a 100644 (file)
@@ -1,3 +1,22 @@
+2011-08-07  James Kozianski  <koz@chromium.org>
+
+        Make the fullscreen JS API enabled at runtime.
+        https://bugs.webkit.org/show_bug.cgi?id=65501
+
+        Reviewed by Adam Barth.
+
+        * bindings/generic/RuntimeEnabledFeatures.cpp:
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::webkitFullScreenAPIEnabled):
+        (WebCore::RuntimeEnabledFeatures::setWebkitFullScreenAPIEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitRequestFullScreenEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitIsFullScreenEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitFullScreenKeyboardInputAllowedEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitCurrentFullScreenElementEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitCancelFullScreenEnabled):
+        * dom/Document.idl:
+        * dom/Element.idl:
+
 2011-08-07  Martin Robinson  <mrobinson@igalia.com>
 
         Distribution fix for GTK+.
index dd47184..8bd01cc 100644 (file)
@@ -146,4 +146,8 @@ bool RuntimeEnabledFeatures::openDatabaseSyncEnabled()
 bool RuntimeEnabledFeatures::isQuotaEnabled = false;
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+bool RuntimeEnabledFeatures::isFullScreenAPIEnabled = true;
+#endif
+
 } // namespace WebCore
index 4e84367..d7cf489 100644 (file)
@@ -70,6 +70,16 @@ public:
     static bool webkitIDBRequestEnabled() { return isIndexedDBEnabled; }
     static bool webkitIDBTransactionEnabled() { return isIndexedDBEnabled; }
 
+#if ENABLE(FULLSCREEN_API)
+    static bool webkitFullScreenAPIEnabled() { return isFullScreenAPIEnabled; }
+    static void setWebkitFullScreenAPIEnabled(bool isEnabled) { isFullScreenAPIEnabled = isEnabled; }
+    static bool webkitRequestFullScreenEnabled() { return isFullScreenAPIEnabled; }
+    static bool webkitIsFullScreenEnabled() { return isFullScreenAPIEnabled; }
+    static bool webkitFullScreenKeyboardInputAllowedEnabled() { return isFullScreenAPIEnabled; }
+    static bool webkitCurrentFullScreenElementEnabled() { return isFullScreenAPIEnabled; }
+    static bool webkitCancelFullScreenEnabled() { return isFullScreenAPIEnabled; }
+#endif
+
 #if ENABLE(VIDEO)
     static bool audioEnabled();
     static bool htmlMediaElementEnabled();
@@ -192,6 +202,10 @@ private:
 #if ENABLE(QUOTA)
     static bool isQuotaEnabled;
 #endif
+
+#if ENABLE(FULLSCREEN_API)
+    static bool isFullScreenAPIEnabled;
+#endif
 };
 
 } // namespace WebCore
index 652767f..5c6838e 100644 (file)
@@ -238,10 +238,10 @@ module core {
             raises(DOMException);
 
 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API
-        readonly attribute boolean webkitIsFullScreen;
-        readonly attribute boolean webkitFullScreenKeyboardInputAllowed;
-        readonly attribute Element webkitCurrentFullScreenElement;
-        void webkitCancelFullScreen();
+        readonly attribute [EnabledAtRuntime] boolean webkitIsFullScreen;
+        readonly attribute [EnabledAtRuntime] boolean webkitFullScreenKeyboardInputAllowed;
+        readonly attribute [EnabledAtRuntime] Element webkitCurrentFullScreenElement;
+        [EnabledAtRuntime] void webkitCancelFullScreen();
 #endif
 
 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
index c728abd..9ebb02a 100644 (file)
@@ -136,7 +136,7 @@ module core {
 
 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API
         const unsigned short ALLOW_KEYBOARD_INPUT = 1;
-        void webkitRequestFullScreen(in [Optional=CallWithDefaultValue] unsigned short flags);
+        [EnabledAtRuntime] void webkitRequestFullScreen(in [Optional=CallWithDefaultValue] unsigned short flags);
 #endif
 
 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
index 63ac132..8c6c675 100644 (file)
@@ -1,3 +1,15 @@
+2011-08-07  James Kozianski  <koz@chromium.org>
+
+        Make the fullscreen JS API enabled at runtime.
+        https://bugs.webkit.org/show_bug.cgi?id=65501
+
+        Reviewed by Adam Barth.
+
+        * public/WebRuntimeFeatures.h:
+        * src/WebRuntimeFeatures.cpp:
+        (WebKit::WebRuntimeFeatures::enableFullScreenAPI):
+        (WebKit::WebRuntimeFeatures::isFullScreenAPIEnabled):
+
 2011-08-05  James Robinson  <jamesr@chromium.org>
 
         [chromium] Accelerated canvas breaks when moving canvases or resources between Pages
index 2413e2f..a3082cc 100644 (file)
@@ -106,6 +106,9 @@ public:
     WEBKIT_EXPORT static void enableMediaStream(bool);
     WEBKIT_EXPORT static bool isMediaStreamEnabled();
 
+    WEBKIT_EXPORT static void enableFullScreenAPI(bool);
+    WEBKIT_EXPORT static bool isFullScreenAPIEnabled();
+
 private:
     WebRuntimeFeatures();
 };
index a5b6a2f..8a629c0 100644 (file)
@@ -356,4 +356,22 @@ bool WebRuntimeFeatures::isMediaStreamEnabled()
 #endif
 }
 
+void WebRuntimeFeatures::enableFullScreenAPI(bool enable)
+{
+#if ENABLE(FULLSCREEN_API)
+    RuntimeEnabledFeatures::setWebkitFullScreenAPIEnabled(enable);
+#else
+    UNUSED_PARAM(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isFullScreenAPIEnabled()
+{
+#if ENABLE(FULLSCREEN_API)
+    return RuntimeEnabledFeatures::webkitFullScreenAPIEnabled();
+#else
+    return false;
+#endif
+}
+
 } // namespace WebKit