Commit 78e88f52 authored by tonikitoo@webkit.org's avatar tonikitoo@webkit.org

[BlackBerry] browser video player fullscreen mode (portrait) - out of...

[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 <agomes@rim.com>

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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7a4748f9
......@@ -357,6 +357,9 @@ WebPagePrivate::WebPagePrivate(WebPage* webPage, WebPageClient* client, const In
#if ENABLE(EVENT_MODE_METATAGS)
, m_cursorEventMode(ProcessedCursorEvents)
, m_touchEventMode(ProcessedTouchEvents)
#endif
#if ENABLE(FULLSCREEN_API)
, m_xScrollOffsetPriorGoingFullScreen(-1)
#endif
, m_currentCursor(Platform::CursorNone)
, m_dumpRenderTree(0) // Lazy initialization.
......@@ -6083,6 +6086,15 @@ void WebPagePrivate::enterFullScreenForElement(Element* element)
// 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 @@ void WebPagePrivate::exitFullScreenForElement(Element* element)
// 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();
......
......@@ -490,6 +490,10 @@ public:
WebCore::TouchEventMode m_touchEventMode;
#endif
#if ENABLE(FULLSCREEN_API)
int m_xScrollOffsetPriorGoingFullScreen;
#endif
Platform::BlackBerryCursor m_currentCursor;
DumpRenderTreeClient* m_dumpRenderTree;
......
2012-06-02 Antonio Gomes <agomes@rim.com>
[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 <agomes@rim.com>
[BlackBerry] browser video player fullscreen mode (portrait) - out of screen/focus - cannot navigate or use the buttons on the screen (PART I)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment