Skip to content
Permalink
Browse files
[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):

Canonical link: https://commits.webkit.org/105997@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Antonio Gomes committed Jun 2, 2012
1 parent 3ec4bdf commit 7f0d5f8d3f994d369f063601bd07685e0c7ffe85
Showing 3 changed files with 46 additions and 0 deletions.
@@ -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 @@ class WebPagePrivate : public PageClientBlackBerry, public WebSettingsDelegate,
WebCore::TouchEventMode m_touchEventMode;
#endif

#if ENABLE(FULLSCREEN_API)
int m_xScrollOffsetPriorGoingFullScreen;
#endif

Platform::BlackBerryCursor m_currentCursor;

DumpRenderTreeClient* m_dumpRenderTree;
@@ -1,3 +1,26 @@
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)

0 comments on commit 7f0d5f8

Please sign in to comment.