Properly hide the header and footer banners if they are set to null.
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Jul 2013 20:45:17 +0000 (20:45 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Jul 2013 20:45:17 +0000 (20:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=118219

Reviewed by Beth Dakin.

Call Page::addFooterWithHeight(0) to remove the parent layer that hosts the banner when
the footer banner is detached. Similarly for the header banner.

* WebProcess/WebPage/mac/PageBannerMac.mm:
(WebKit::PageBanner::detachFromPage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@152249 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/PageBannerMac.mm

index 608d3f3..fb25392 100644 (file)
@@ -1,3 +1,16 @@
+2013-07-01  Ada Chan  <adachan@apple.com>
+
+        Properly hide the header and footer banners if they are set to null.
+        https://bugs.webkit.org/show_bug.cgi?id=118219
+
+        Reviewed by Beth Dakin.
+        
+        Call Page::addFooterWithHeight(0) to remove the parent layer that hosts the banner when
+        the footer banner is detached. Similarly for the header banner.
+
+        * WebProcess/WebPage/mac/PageBannerMac.mm:
+        (WebKit::PageBanner::detachFromPage):
+
 2013-07-01  Jochen Eisinger  <jochen@chromium.org>
 
         Remove support for consumable user gestures
index c84bd6d..1e42b35 100644 (file)
@@ -81,6 +81,12 @@ void PageBanner::didAddParentLayer(GraphicsLayer* parentLayer)
 
 void PageBanner::detachFromPage()
 {
+    // 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_type = NotSet;
     m_webPage = 0;
 }