From 6882a04fb36642862b11efe514251d32070c3d65 Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Thu, 25 Aug 2016 19:20:41 +0300 Subject: Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443) Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev --- .../WebProcess/FullScreen/WebFullScreenManager.cpp | 39 ++++++++++++---------- 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp') 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 #include -#include #include +#include #include #include #include @@ -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(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::create(WebPage* page) +Ref 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 -- cgit v1.2.1