2011-02-26 David Dorwin <ddorwin@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Feb 2011 10:17:48 +0000 (10:17 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Feb 2011 10:17:48 +0000 (10:17 +0000)
        Reviewed by Darin Fisher.

        Enable WebKit Full Screen API in Chromium. The element becomes the full size of the window, but the window is not yet full screen. Support is disabled by default.

        fullscreen javascript bindings not implemented for v8
        https://bugs.webkit.org/show_bug.cgi?id=44797

        Tested by the existing fullscreen Layout Tests.

        * WebCore.gyp/WebCore.gyp:
        * WebCore.gypi:
2011-02-26  David Dorwin  <ddorwin@chromium.org>

        Reviewed by Darin Fisher.

        Enable WebKit Full Screen API in Chromium. The element becomes the full size of the window, but the window is not yet full screen. Support is disabled by default.

        fullscreen javascript bindings not implemented for v8
        https://bugs.webkit.org/show_bug.cgi?id=44797

        * features.gypi:
        * public/WebSettings.h:
        * src/ChromeClientImpl.cpp:
        (WebKit::ChromeClientImpl::supportsFullScreenForElement):
        (WebKit::ChromeClientImpl::enterFullScreenForElement):
        (WebKit::ChromeClientImpl::exitFullScreenForElement):
        (WebKit::ChromeClientImpl::fullScreenRendererChanged):
        * src/ChromeClientImpl.h:
        * src/WebSettingsImpl.cpp:
        (WebKit::WebSettingsImpl::setFullScreenEnabled):
        * src/WebSettingsImpl.h:

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

Source/WebCore/ChangeLog
Source/WebCore/WebCore.gyp/WebCore.gyp
Source/WebCore/WebCore.gypi
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/features.gypi
Source/WebKit/chromium/public/WebSettings.h
Source/WebKit/chromium/src/ChromeClientImpl.cpp
Source/WebKit/chromium/src/ChromeClientImpl.h
Source/WebKit/chromium/src/WebSettingsImpl.cpp
Source/WebKit/chromium/src/WebSettingsImpl.h

index 6a4f795..0b51d7d 100644 (file)
@@ -1,3 +1,17 @@
+2011-02-26  David Dorwin  <ddorwin@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Enable WebKit Full Screen API in Chromium. The element becomes the full size of the window, but the window is not yet full screen. Support is disabled by default.
+
+        fullscreen javascript bindings not implemented for v8
+        https://bugs.webkit.org/show_bug.cgi?id=44797
+
+        Tested by the existing fullscreen Layout Tests.
+
+        * WebCore.gyp/WebCore.gyp:
+        * WebCore.gypi:
+
 2011-02-26  Tony Gentilcore  <tonyg@chromium.org>
 
         Reviewed by Adam Barth.
index 4af2e9a..7136a04 100644 (file)
         },
         {
           'action_name': 'UserAgentStyleSheets',
+          # The .css files are in the same order as ../DerivedSources.make.
           'inputs': [
             '../css/make-css-file-arrays.pl',
             '../css/html.css',
             '../css/quirks.css',
             '../css/view-source.css',
-            '../css/themeChromiumLinux.css',
-            '../css/themeChromiumSkia.css',
+            '../css/themeChromiumLinux.css', # Chromium only.
+            '../css/themeChromiumSkia.css',  # Chromium only.
             '../css/themeWin.css',
             '../css/themeWinQuirks.css',
             '../css/svg.css',
+            # Skip WML.
             '../css/mathml.css',
             '../css/mediaControls.css',
             '../css/mediaControlsChromium.css',
+            '../css/fullscreen.css',
           ],
           'outputs': [
             '<(SHARED_INTERMEDIATE_DIR)/webkit/UserAgentStyleSheets.h',
index 724291b..f950db9 100644 (file)
             'rendering/RenderFrameBase.h',
             'rendering/RenderFrameSet.cpp',
             'rendering/RenderFrameSet.h',
+            'rendering/RenderFullScreen.cpp',
+            'rendering/RenderFullScreen.h',
             'rendering/RenderHTMLCanvas.cpp',
             'rendering/RenderHTMLCanvas.h',
             'rendering/RenderIFrame.cpp',
index d2fab05..e17c9a1 100644 (file)
@@ -1,3 +1,24 @@
+2011-02-26  David Dorwin  <ddorwin@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Enable WebKit Full Screen API in Chromium. The element becomes the full size of the window, but the window is not yet full screen. Support is disabled by default.
+
+        fullscreen javascript bindings not implemented for v8
+        https://bugs.webkit.org/show_bug.cgi?id=44797
+
+        * features.gypi:
+        * public/WebSettings.h:
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::supportsFullScreenForElement):
+        (WebKit::ChromeClientImpl::enterFullScreenForElement):
+        (WebKit::ChromeClientImpl::exitFullScreenForElement):
+        (WebKit::ChromeClientImpl::fullScreenRendererChanged):
+        * src/ChromeClientImpl.h:
+        * src/WebSettingsImpl.cpp:
+        (WebKit::WebSettingsImpl::setFullScreenEnabled):
+        * src/WebSettingsImpl.h:
+
 2011-02-26  John Mellor  <johnme@chromium.org>
 
         Reviewed by Antonio Gomes.
index d460172..92cce11 100644 (file)
@@ -56,6 +56,7 @@
         'ENABLE_JAVASCRIPT_I18N_API=1',
         'ENABLE_FILE_SYSTEM=1',
         'ENABLE_FILTERS=1',
+        'ENABLE_FULLSCREEN_API=1',
         'ENABLE_GEOLOCATION=1',
         'ENABLE_ICONDATABASE=0',
         'ENABLE_INDEXED_DATABASE=1',
index a6b5bde..966855b 100644 (file)
@@ -111,6 +111,7 @@ public:
     virtual void setCaretBrowsingEnabled(bool) = 0;
     virtual void setInteractiveFormValidationEnabled(bool) = 0;
     virtual void setMinimumTimerInterval(double) = 0;
+    virtual void setFullScreenEnabled(bool) = 0;
 
 protected:
     ~WebSettings() { }
index f95d787..992e26c 100644 (file)
@@ -79,6 +79,7 @@
 #include "WebPopupMenuInfo.h"
 #include "WebPopupType.h"
 #include "WebRect.h"
+#include "WebSettings.h"
 #include "WebTextDirection.h"
 #include "WebURLRequest.h"
 #include "WebViewClient.h"
@@ -860,6 +861,32 @@ void ChromeClientImpl::exitFullscreenForNode(WebCore::Node* node)
         m_webView->client()->exitFullscreenForNode(WebNode(node));
 }
 
+#if ENABLE(FULLSCREEN_API)
+bool ChromeClientImpl::supportsFullScreenForElement(const WebCore::Element* element)
+{
+    return m_webView->page()->settings()->fullScreenEnabled();
+}
+
+void ChromeClientImpl::enterFullScreenForElement(WebCore::Element* element)
+{
+    // FIXME: We may need to call these someplace else when window resizes.
+    element->document()->webkitWillEnterFullScreenForElement(element);
+    element->document()->webkitDidEnterFullScreenForElement(element);
+}
+
+void ChromeClientImpl::exitFullScreenForElement(WebCore::Element* element)
+{
+    // FIXME: We may need to call these someplace else when window resizes.
+    element->document()->webkitWillExitFullScreenForElement(element);
+    element->document()->webkitDidExitFullScreenForElement(element);
+}
+
+void ChromeClientImpl::fullScreenRendererChanged(RenderBox*)
+{
+    notImplemented();
+}
+#endif
+
 bool ChromeClientImpl::selectItemWritingDirectionIsNatural()
 {
     return false;
index d3ccb75..7d43775 100644 (file)
 
 namespace WebCore {
 class AccessibilityObject;
+class Element;
 class FileChooser;
 class PopupContainer;
 class PopupMenuClient;
+class RenderBox;
 class SecurityOrigin;
 struct WindowFeatures;
 }
@@ -163,6 +165,13 @@ public:
     virtual void enterFullscreenForNode(WebCore::Node*);
     virtual void exitFullscreenForNode(WebCore::Node*);
 
+#if ENABLE(FULLSCREEN_API)
+    virtual bool supportsFullScreenForElement(const WebCore::Element*);
+    virtual void enterFullScreenForElement(WebCore::Element*);
+    virtual void exitFullScreenForElement(WebCore::Element*);
+    virtual void fullScreenRendererChanged(WebCore::RenderBox*);
+#endif
+
     // ChromeClientChromium methods:
     virtual void popupOpened(WebCore::PopupContainer* popupContainer,
                              const WebCore::IntRect& bounds,
index 9bd4a35..3f8edc7 100644 (file)
@@ -35,6 +35,7 @@
 #include "Settings.h"
 #include "WebString.h"
 #include "WebURL.h"
+#include <wtf/UnusedParam.h>
 
 #if defined(OS_WIN)
 #include "RenderThemeChromiumWin.h"
@@ -360,4 +361,13 @@ void WebSettingsImpl::setMinimumTimerInterval(double interval)
     m_settings->setMinDOMTimerInterval(interval);
 }
 
+void WebSettingsImpl::setFullScreenEnabled(bool enabled)
+{
+#if ENABLE(FULLSCREEN_API)
+    m_settings->setFullScreenEnabled(enabled);
+#else
+    UNUSED_PARAM(enabled);
+#endif
+}
+
 } // namespace WebKit
index 10564af..c3ed40a 100644 (file)
@@ -104,6 +104,7 @@ public:
     virtual void setCaretBrowsingEnabled(bool);
     virtual void setInteractiveFormValidationEnabled(bool);
     virtual void setMinimumTimerInterval(double);
+    virtual void setFullScreenEnabled(bool);
 
 private:
     WebCore::Settings* m_settings;