diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
commit | 881da28418d380042aa95a97f0cbd42560a64f7c (patch) | |
tree | a794dff3274695e99c651902dde93d934ea7a5af /Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp | |
parent | 7e104c57a70fdf551bb3d22a5d637cdcbc69dbea (diff) | |
parent | 0fcedcd17cc00d3dd44c718b3cb36c1033319671 (diff) | |
download | qtwebkit-881da28418d380042aa95a97f0cbd42560a64f7c.tar.gz |
Merge 'wip/next' into dev
Change-Id: Iff9ee5e23bb326c4371ec8ed81d56f2f05d680e9
Diffstat (limited to 'Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp index 0becc77eb..fffa8b2d5 100644 --- a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp +++ b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp @@ -34,8 +34,8 @@ #include "WebPage.h" #include <WebCore/Color.h> #include <WebCore/Element.h> -#include <WebCore/Frame.h> #include <WebCore/FrameView.h> +#include <WebCore/MainFrame.h> #include <WebCore/Page.h> #include <WebCore/RenderLayer.h> #include <WebCore/RenderLayerBacking.h> @@ -50,23 +50,23 @@ namespace WebKit { static IntRect screenRectOfContents(Element* element) { ASSERT(element); -#if USE(ACCELERATED_COMPOSITING) if (element->renderer() && element->renderer()->hasLayer() && element->renderer()->enclosingLayer()->isComposited()) { FloatQuad contentsBox = static_cast<FloatRect>(element->renderer()->enclosingLayer()->backing()->contentsBox()); contentsBox = element->renderer()->localToAbsoluteQuad(contentsBox); - return element->renderer()->view()->frameView()->contentsToScreen(contentsBox.enclosingBoundingBox()); + return element->renderer()->view().frameView().contentsToScreen(contentsBox.enclosingBoundingBox()); } -#endif + return element->screenRect(); } -PassRefPtr<WebFullScreenManager> WebFullScreenManager::create(WebPage* page) +Ref<WebFullScreenManager> WebFullScreenManager::create(WebPage* page) { - return adoptRef(new WebFullScreenManager(page)); + return adoptRef(*new WebFullScreenManager(page)); } WebFullScreenManager::WebFullScreenManager(WebPage* page) - : m_page(page) + : m_topContentInset(0) + , m_page(page) { } @@ -79,14 +79,14 @@ WebCore::Element* WebFullScreenManager::element() return m_element.get(); } -void WebFullScreenManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageDecoder& decoder) +void WebFullScreenManager::didReceiveMessage(IPC::Connection& connection, IPC::MessageDecoder& decoder) { didReceiveWebFullScreenManagerMessage(connection, decoder); } bool WebFullScreenManager::supportsFullScreen(bool withKeyboard) { - if (!m_page->corePage()->settings()->fullScreenEnabled()) + if (!m_page->corePage()->settings().fullScreenEnabled()) return false; return m_page->injectedBundleFullScreenClient().supportsFullScreen(m_page.get(), withKeyboard); @@ -108,9 +108,9 @@ void WebFullScreenManager::exitFullScreenForElement(WebCore::Element* element) void WebFullScreenManager::willEnterFullScreen() { ASSERT(m_element); - m_element->document()->webkitWillEnterFullScreenForElement(m_element.get()); + m_element->document().webkitWillEnterFullScreenForElement(m_element.get()); m_page->hidePageBanners(); - m_element->document()->updateLayout(); + m_element->document().updateLayout(); m_page->forceRepaintWithoutCallback(); m_finalFrame = screenRectOfContents(m_element.get()); m_page->injectedBundleFullScreenClient().beganEnterFullScreen(m_page.get(), m_initialFrame, m_finalFrame); @@ -119,14 +119,14 @@ void WebFullScreenManager::willEnterFullScreen() void WebFullScreenManager::didEnterFullScreen() { ASSERT(m_element); - m_element->document()->webkitDidEnterFullScreenForElement(m_element.get()); + m_element->document().webkitDidEnterFullScreenForElement(m_element.get()); } void WebFullScreenManager::willExitFullScreen() { ASSERT(m_element); m_finalFrame = screenRectOfContents(m_element.get()); - m_element->document()->webkitWillExitFullScreenForElement(m_element.get()); + m_element->document().webkitWillExitFullScreenForElement(m_element.get()); m_page->showPageBanners(); m_page->injectedBundleFullScreenClient().beganExitFullScreen(m_page.get(), m_finalFrame, m_initialFrame); } @@ -134,19 +134,19 @@ void WebFullScreenManager::willExitFullScreen() void WebFullScreenManager::didExitFullScreen() { ASSERT(m_element); - m_element->document()->webkitDidExitFullScreenForElement(m_element.get()); + m_element->document().webkitDidExitFullScreenForElement(m_element.get()); } void WebFullScreenManager::setAnimatingFullScreen(bool animating) { ASSERT(m_element); - m_element->document()->setAnimatingFullScreen(animating); + m_element->document().setAnimatingFullScreen(animating); } void WebFullScreenManager::requestExitFullScreen() { ASSERT(m_element); - m_element->document()->webkitCancelFullScreen(); + m_element->document().webkitCancelFullScreen(); } void WebFullScreenManager::close() @@ -156,12 +156,15 @@ void WebFullScreenManager::close() void WebFullScreenManager::saveScrollPosition() { - m_scrollPosition = m_page->corePage()->mainFrame()->view()->scrollPosition(); + m_scrollPosition = m_page->corePage()->mainFrame().view()->scrollPosition(); + m_topContentInset = m_page->corePage()->topContentInset(); + m_page->corePage()->setTopContentInset(0); } void WebFullScreenManager::restoreScrollPosition() { - m_page->corePage()->mainFrame()->view()->setScrollPosition(m_scrollPosition); + m_page->corePage()->setTopContentInset(m_topContentInset); + m_page->corePage()->mainFrame().view()->setScrollPosition(m_scrollPosition); } } // namespace WebKit |