Changeset 119321 in webkit


Ignore:
Timestamp:
Jun 2, 2012 7:52:55 AM (12 years ago)
Author:
tonikitoo@webkit.org
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 <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):

Location:
trunk/Source/WebKit/blackberry
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/Api/WebPage.cpp

    r119239 r119321  
    358358    , m_cursorEventMode(ProcessedCursorEvents)
    359359    , m_touchEventMode(ProcessedTouchEvents)
     360#endif
     361#if ENABLE(FULLSCREEN_API)
     362    , m_xScrollOffsetPriorGoingFullScreen(-1)
    360363#endif
    361364    , m_currentCursor(Platform::CursorNone)
     
    60846087        enterFullscreenForNode(element);
    60856088    } else {
     6089        // When an element goes fullscreen, it gets cloned and added to a higher index
     6090        // wrapper/container node, created out of the DOM tree. This wrapper is fixed
     6091        // position, but since our fixed position logic respects only the 'y' coordinate,
     6092        // we temporarily scroll the WebPage to x:0 so that the wrapper gets properly
     6093        // positioned. The original scroll position is restored once element leaves fullscreen.
     6094        WebCore::IntPoint scrollPosition = m_mainFrame->view()->scrollPosition();
     6095        m_xScrollOffsetPriorGoingFullScreen = scrollPosition.x();
     6096        m_mainFrame->view()->setScrollPosition(WebCore::IntPoint(0, scrollPosition.y()));
     6097
    60866098        // No fullscreen video widget has been made available by the Browser
    60876099        // chrome, or this is not a video element. The webkitRequestFullScreen
     
    61046116        exitFullscreenForNode(element);
    61056117    } else {
     6118        // When leaving fullscreen mode, we need to restore the 'x' scroll position
     6119        // prior going full screen.
     6120        WebCore::IntPoint scrollPosition = m_mainFrame->view()->scrollPosition();
     6121        m_mainFrame->view()->setScrollPosition(
     6122            WebCore::IntPoint(m_xScrollOffsetPriorGoingFullScreen, scrollPosition.y()));
     6123        m_xScrollOffsetPriorGoingFullScreen = -1;
     6124
    61066125        // This is where we would restore the browser's chrome
    61076126        // if hidden above.
  • trunk/Source/WebKit/blackberry/Api/WebPage_p.h

    r119239 r119321  
    491491#endif
    492492
     493#if ENABLE(FULLSCREEN_API)
     494    int m_xScrollOffsetPriorGoingFullScreen;
     495#endif
     496
    493497    Platform::BlackBerryCursor m_currentCursor;
    494498
  • trunk/Source/WebKit/blackberry/ChangeLog

    r119320 r119321  
     12012-06-02  Antonio Gomes  <agomes@rim.com>
     2
     3        [BlackBerry] browser video player fullscreen mode (portrait) - out of screen/focus - cannot navigate or use the buttons on the screen (PART II)
     4        https://bugs.webkit.org/show_bug.cgi?id=88019
     5
     6        Reviewed by George Staikos.
     7
     8        When an element goes fullscreen, its wrapper/container obeys all
     9        BlackBerry specific fixed position customizations: we fixed
     10        against Y, but not X. Then, in order to have the wrapper element
     11        properly positioned when entering fullscreen mode, we
     12        temporarily scroll x to 0.
     13
     14        The original x scroll position is restored when we leave
     15        fullscreen.
     16
     17        * Api/WebPage.cpp:
     18        (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
     19        (BlackBerry::WebKit::WebPagePrivate::enterFullScreenForElement):
     20        (BlackBerry::WebKit::WebPagePrivate::exitFullScreenForElement):
     21        * Api/WebPage_p.h:
     22        (WebPagePrivate):
     23
    1242012-06-02  Antonio Gomes  <agomes@rim.com>
    225
Note: See TracChangeset for help on using the changeset viewer.