Title: [151661] trunk/Source
Revision
151661
Author
bda...@apple.com
Date
2013-06-17 17:41:43 -0700 (Mon, 17 Jun 2013)

Log Message

PageBanners appear over HTML5 video when media element is in full screen mode
https://bugs.webkit.org/show_bug.cgi?id=117721
-and corresponding-
<rdar://problem/13686998>

Reviewed by Sam Weinig.

Source/WebCore: 

Update the scrolling tree when a header/footer has been removed.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):

Source/WebKit2: 

When an element enters fullscreen, hide the banners. Show them again when the 
element exits fullscreen.
* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::willEnterFullScreen):
(WebKit::WebFullScreenManager::willExitFullScreen):

Handle hiding and showing by removing or re-creating a parent layer for m_layer.
* WebProcess/WebPage/PageBanner.cpp:
(WebKit::PageBanner::hide):
(WebKit::PageBanner::showIfHidden):
* WebProcess/WebPage/PageBanner.h:
* WebProcess/WebPage/mac/PageBannerMac.mm:
(WebKit::PageBanner::PageBanner):
(WebKit::PageBanner::hide):
(WebKit::PageBanner::showIfHidden):
(WebKit::PageBanner::mouseEvent):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hidePageBanners):
(WebKit::WebPage::showPageBanners):
* WebProcess/WebPage/WebPage.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (151660 => 151661)


--- trunk/Source/WebCore/ChangeLog	2013-06-18 00:23:38 UTC (rev 151660)
+++ trunk/Source/WebCore/ChangeLog	2013-06-18 00:41:43 UTC (rev 151661)
@@ -1,3 +1,17 @@
+2013-06-17  Beth Dakin  <bda...@apple.com>
+
+        PageBanners appear over HTML5 video when media element is in full screen mode
+        https://bugs.webkit.org/show_bug.cgi?id=117721
+        -and corresponding-
+        <rdar://problem/13686998>
+
+        Reviewed by Sam Weinig.
+
+        Update the scrolling tree when a header/footer has been removed.
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::updateLayerForHeader):
+        (WebCore::RenderLayerCompositor::updateLayerForFooter):
+
 2013-06-17  Roger Fong  <roger_f...@apple.com>
 
         Modify Windows makefiles to copy some bin output into Program Files.

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (151660 => 151661)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2013-06-18 00:23:38 UTC (rev 151660)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2013-06-18 00:41:43 UTC (rev 151661)
@@ -2572,6 +2572,11 @@
         if (m_layerForHeader) {
             m_layerForHeader->removeFromParent();
             m_layerForHeader = nullptr;
+
+            // The ScrollingTree knows about the header layer, and the position of the root layer is affected
+            // by the header layer, so if we remove the header, we need to tell the scrolling tree.
+            if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
+                scrollingCoordinator->frameViewRootLayerDidChange(m_renderView->frameView());
         }
         return 0;
     }
@@ -2607,6 +2612,11 @@
         if (m_layerForFooter) {
             m_layerForFooter->removeFromParent();
             m_layerForFooter = nullptr;
+
+            // The ScrollingTree knows about the footer layer, and the total scrollable size is affected
+            // by the footer layer, so if we remove the footer, we need to tell the scrolling tree.
+            if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
+                scrollingCoordinator->frameViewRootLayerDidChange(m_renderView->frameView());
         }
         return 0;
     }

Modified: trunk/Source/WebKit2/ChangeLog (151660 => 151661)


--- trunk/Source/WebKit2/ChangeLog	2013-06-18 00:23:38 UTC (rev 151660)
+++ trunk/Source/WebKit2/ChangeLog	2013-06-18 00:41:43 UTC (rev 151661)
@@ -1,3 +1,33 @@
+2013-06-17  Beth Dakin  <bda...@apple.com>
+
+        PageBanners appear over HTML5 video when media element is in full screen mode
+        https://bugs.webkit.org/show_bug.cgi?id=117721
+        -and corresponding-
+        <rdar://problem/13686998>
+
+        Reviewed by Sam Weinig.
+
+        When an element enters fullscreen, hide the banners. Show them again when the 
+        element exits fullscreen.
+        * WebProcess/FullScreen/WebFullScreenManager.cpp:
+        (WebKit::WebFullScreenManager::willEnterFullScreen):
+        (WebKit::WebFullScreenManager::willExitFullScreen):
+
+        Handle hiding and showing by removing or re-creating a parent layer for m_layer.
+        * WebProcess/WebPage/PageBanner.cpp:
+        (WebKit::PageBanner::hide):
+        (WebKit::PageBanner::showIfHidden):
+        * WebProcess/WebPage/PageBanner.h:
+        * WebProcess/WebPage/mac/PageBannerMac.mm:
+        (WebKit::PageBanner::PageBanner):
+        (WebKit::PageBanner::hide):
+        (WebKit::PageBanner::showIfHidden):
+        (WebKit::PageBanner::mouseEvent):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::hidePageBanners):
+        (WebKit::WebPage::showPageBanners):
+        * WebProcess/WebPage/WebPage.h:
+
 2013-06-17  Ruth Fong  <ruth_f...@apple.com>
 
         REGRESSION: Important controls are missing from <video> element UI, when compared to QuickTime

Modified: trunk/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp (151660 => 151661)


--- trunk/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp	2013-06-18 00:23:38 UTC (rev 151660)
+++ trunk/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp	2013-06-18 00:41:43 UTC (rev 151661)
@@ -106,6 +106,7 @@
 {
     ASSERT(m_element);
     m_element->document()->webkitWillEnterFullScreenForElement(m_element.get());
+    m_page->hidePageBanners();
     m_element->document()->updateLayout();
     m_page->forceRepaintWithoutCallback();
     m_finalFrame = screenRectOfContents(m_element.get());
@@ -123,6 +124,7 @@
     ASSERT(m_element);
     m_finalFrame = screenRectOfContents(m_element.get());
     m_element->document()->webkitWillExitFullScreenForElement(m_element.get());
+    m_page->showPageBanners();
     m_page->injectedBundleFullScreenClient().beganExitFullScreen(m_page.get(), m_finalFrame, m_initialFrame);
 }
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/PageBanner.cpp (151660 => 151661)


--- trunk/Source/WebKit2/WebProcess/WebPage/PageBanner.cpp	2013-06-18 00:23:38 UTC (rev 151660)
+++ trunk/Source/WebKit2/WebProcess/WebPage/PageBanner.cpp	2013-06-18 00:41:43 UTC (rev 151661)
@@ -46,6 +46,14 @@
 {
 }
 
+void PageBanner::hide()
+{
+}
+
+void PageBanner::showIfHidden()
+{
+}
+
 void PageBanner::didChangeDeviceScaleFactor(float)
 {
 }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/PageBanner.h (151660 => 151661)


--- trunk/Source/WebKit2/WebProcess/WebPage/PageBanner.h	2013-06-18 00:23:38 UTC (rev 151660)
+++ trunk/Source/WebKit2/WebProcess/WebPage/PageBanner.h	2013-06-18 00:41:43 UTC (rev 151661)
@@ -70,6 +70,9 @@
     void addToPage(Type, WebPage*);
     void detachFromPage();
 
+    void hide();
+    void showIfHidden();
+
     bool mouseEvent(const WebMouseEvent&);
     void didChangeDeviceScaleFactor(float scaleFactor);
 
@@ -85,6 +88,7 @@
     WebPage* m_webPage;
 
     bool m_mouseDownInBanner;
+    bool m_isHidden;
 
 #if PLATFORM(MAC)
     RetainPtr<CALayer> m_layer;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (151660 => 151661)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-06-18 00:23:38 UTC (rev 151660)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-06-18 00:41:43 UTC (rev 151661)
@@ -1487,6 +1487,22 @@
     return m_footerBanner.get();
 }
 
+void WebPage::hidePageBanners()
+{
+    if (m_headerBanner)
+        m_headerBanner->hide();
+    if (m_footerBanner)
+        m_footerBanner->hide();
+}
+
+void WebPage::showPageBanners()
+{
+    if (m_headerBanner)
+        m_headerBanner->showIfHidden();
+    if (m_footerBanner)
+        m_footerBanner->showIfHidden();
+}
+
 PassRefPtr<WebImage> WebPage::scaledSnapshotWithOptions(const IntRect& rect, double scaleFactor, SnapshotOptions options)
 {
     FrameView* frameView = m_mainFrame->coreFrame()->view();

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (151660 => 151661)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-06-18 00:23:38 UTC (rev 151660)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-06-18 00:41:43 UTC (rev 151661)
@@ -384,6 +384,8 @@
     void setFooterPageBanner(PassRefPtr<PageBanner>);
     PageBanner* footerPageBanner();
 
+    void hidePageBanners();
+    void showPageBanners();
 
     WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
     WebCore::IntRect windowToScreen(const WebCore::IntRect&);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PageBannerMac.mm (151660 => 151661)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PageBannerMac.mm	2013-06-18 00:23:38 UTC (rev 151660)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PageBannerMac.mm	2013-06-18 00:41:43 UTC (rev 151661)
@@ -44,6 +44,7 @@
     , m_client(client)
     , m_webPage(0)
     , m_mouseDownInBanner(false)
+    , m_isHidden(false)
     , m_layer(layer)
     , m_height(height)
 {
@@ -84,6 +85,28 @@
     m_webPage = 0;
 }
 
+void PageBanner::hide()
+{
+    // We can hide the banner by removing the parent layer that hosts it.
+    if (m_type == Header)
+        m_webPage->corePage()->addHeaderWithHeight(0);
+    else if (m_type == Footer)
+        m_webPage->corePage()->addFooterWithHeight(0);
+
+    m_isHidden = true;
+}
+
+void PageBanner::showIfHidden()
+{
+    if (!m_isHidden)
+        return;
+    m_isHidden = false;
+
+    // This will re-create a parent layer in the WebCore layer tree, and we will re-add
+    // m_layer as a child of it. 
+    addToPage(m_type, m_webPage);
+}
+
 void PageBanner::didChangeDeviceScaleFactor(float scaleFactor)
 {
     m_layer.get().contentsScale = scaleFactor;
@@ -92,6 +115,9 @@
 
 bool PageBanner::mouseEvent(const WebMouseEvent& mouseEvent)
 {
+    if (m_isHidden)
+        return false;
+
     FrameView* frameView = m_webPage->mainFrameView();
     if (!frameView)
         return false;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to