Title: [119321] trunk/Source/WebKit/blackberry
Revision
119321
Author
[email protected]
Date
2012-06-02 07:52:55 -0700 (Sat, 02 Jun 2012)

Log Message

[BlackBerry] browser video player fullscreen mode (portrait) - out of screen/focus - cannot navigate or use the buttons on the screen (PART II)
https://bugs.webkit.org/show_bug.cgi?id=88019

Reviewed by George Staikos.
Patch by Antonio Gomes <[email protected]>

When an element goes fullscreen, its wrapper/container obeys all
BlackBerry specific fixed position customizations: we fixed
against Y, but not X. Then, in order to have the wrapper element
properly positioned when entering fullscreen mode, we
temporarily scroll x to 0.

The original x scroll position is restored when we leave
fullscreen.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::enterFullScreenForElement):
(BlackBerry::WebKit::WebPagePrivate::exitFullScreenForElement):
* Api/WebPage_p.h:
(WebPagePrivate):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (119320 => 119321)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-06-02 14:52:45 UTC (rev 119320)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-06-02 14:52:55 UTC (rev 119321)
@@ -358,6 +358,9 @@
     , m_cursorEventMode(ProcessedCursorEvents)
     , m_touchEventMode(ProcessedTouchEvents)
 #endif
+#if ENABLE(FULLSCREEN_API)
+    , m_xScrollOffsetPriorGoingFullScreen(-1)
+#endif
     , m_currentCursor(Platform::CursorNone)
     , m_dumpRenderTree(0) // Lazy initialization.
     , m_initialScale(-1.0)
@@ -6083,6 +6086,15 @@
         // is so that exitFullScreenForElement() gets called later.
         enterFullscreenForNode(element);
     } else {
+        // When an element goes fullscreen, it gets cloned and added to a higher index
+        // wrapper/container node, created out of the DOM tree. This wrapper is fixed
+        // position, but since our fixed position logic respects only the 'y' coordinate,
+        // we temporarily scroll the WebPage to x:0 so that the wrapper gets properly
+        // positioned. The original scroll position is restored once element leaves fullscreen.
+        WebCore::IntPoint scrollPosition = m_mainFrame->view()->scrollPosition();
+        m_xScrollOffsetPriorGoingFullScreen = scrollPosition.x();
+        m_mainFrame->view()->setScrollPosition(WebCore::IntPoint(0, scrollPosition.y()));
+
         // No fullscreen video widget has been made available by the Browser
         // chrome, or this is not a video element. The webkitRequestFullScreen
         // _javascript_ call is often made on a div element.
@@ -6103,6 +6115,13 @@
         // The Browser chrome has its own fullscreen video widget.
         exitFullscreenForNode(element);
     } else {
+        // When leaving fullscreen mode, we need to restore the 'x' scroll position
+        // prior going full screen.
+        WebCore::IntPoint scrollPosition = m_mainFrame->view()->scrollPosition();
+        m_mainFrame->view()->setScrollPosition(
+            WebCore::IntPoint(m_xScrollOffsetPriorGoingFullScreen, scrollPosition.y()));
+        m_xScrollOffsetPriorGoingFullScreen = -1;
+
         // This is where we would restore the browser's chrome
         // if hidden above.
         client()->fullscreenStop();

Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (119320 => 119321)


--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-06-02 14:52:45 UTC (rev 119320)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-06-02 14:52:55 UTC (rev 119321)
@@ -490,6 +490,10 @@
     WebCore::TouchEventMode m_touchEventMode;
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+    int m_xScrollOffsetPriorGoingFullScreen;
+#endif
+
     Platform::BlackBerryCursor m_currentCursor;
 
     DumpRenderTreeClient* m_dumpRenderTree;

Modified: trunk/Source/WebKit/blackberry/ChangeLog (119320 => 119321)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-06-02 14:52:45 UTC (rev 119320)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-06-02 14:52:55 UTC (rev 119321)
@@ -1,5 +1,28 @@
 2012-06-02  Antonio Gomes  <[email protected]>
 
+        [BlackBerry] browser video player fullscreen mode (portrait) - out of screen/focus - cannot navigate or use the buttons on the screen (PART II)
+        https://bugs.webkit.org/show_bug.cgi?id=88019
+
+        Reviewed by George Staikos.
+
+        When an element goes fullscreen, its wrapper/container obeys all
+        BlackBerry specific fixed position customizations: we fixed
+        against Y, but not X. Then, in order to have the wrapper element
+        properly positioned when entering fullscreen mode, we
+        temporarily scroll x to 0.
+
+        The original x scroll position is restored when we leave
+        fullscreen.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
+        (BlackBerry::WebKit::WebPagePrivate::enterFullScreenForElement):
+        (BlackBerry::WebKit::WebPagePrivate::exitFullScreenForElement):
+        * Api/WebPage_p.h:
+        (WebPagePrivate):
+
+2012-06-02  Antonio Gomes  <[email protected]>
+
         [BlackBerry] browser video player fullscreen mode (portrait) - out of screen/focus - cannot navigate or use the buttons on the screen (PART I)
         https://bugs.webkit.org/show_bug.cgi?id=88019
         PR #158266
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to