Summary: | Calling WKBundlePageSetFooterBanner() API to set a banner to null does not actually hide the banner | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ada Chan <adachan> | ||||||||||
Component: | Layout and Rendering | Assignee: | Ada Chan <adachan> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | bdakin, eflews.bot, gyuyoung.kim, jeffm, rego+ews, sam, webkit-ews, xan.lopez | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Attachments: |
|
Description
Ada Chan
2013-06-30 08:53:41 PDT
Created attachment 205775 [details]
Patch
Comment on attachment 205775 [details] Patch Attachment 205775 [details] did not pass efl-wk2-ews (efl-wk2): Output: http://webkit-queues.appspot.com/results/995956 Comment on attachment 205775 [details] Patch Attachment 205775 [details] did not pass qt-wk2-ews (qt-wk2): Output: http://webkit-queues.appspot.com/results/927397 Created attachment 205776 [details]
Patch
Replaced m_page with corePage().
Comment on attachment 205776 [details] Patch Attachment 205776 [details] did not pass qt-wk2-ews (qt-wk2): Output: http://webkit-queues.appspot.com/results/919584 Comment on attachment 205776 [details] Patch Attachment 205776 [details] did not pass efl-wk2-ews (efl-wk2): Output: http://webkit-queues.appspot.com/results/943800 Created attachment 205777 [details]
Patch
Wrap the calls with #if ENABLE(RUBBER_BANDING).
Ideally this would all be in the PageBanner class. Any reason we can't do this in PageBanner::detachFromPage()? (In reply to comment #8) > Ideally this would all be in the PageBanner class. Any reason we can't do this in PageBanner::detachFromPage()? PageBanner::detachFromPage() is also called on the header and footer banners in WebPage's destructor. I don't know if it's necessary to hide the banners also for that case, and if there would be issues trying to hide the banners at that point. Another thing I can do is this: void WebPage::setHeaderPageBanner(PassRefPtr<PageBanner> pageBanner) { if (m_headerBanner) { m_headerBanner->hide(); m_headerBanner->detachFromPage(); } m_headerBanner = pageBanner; if (m_headerBanner) m_headerBanner->addToPage(PageBanner::Header, this); } In the common case where we are setting the page banner to another instance, the above code would remove the parent layer that hosts the banner and then recreate it again when we add in the new banner. What I had earlier in my patch would avoid that. I'm not sure if that optimization is worth the trouble though. If it's really worth not removing the parent layer that hosts the banner unless it's necessary, I could do this: void WebPage::setHeaderPageBanner(PassRefPtr<PageBanner> pageBanner) { if (m_headerBanner) { if (!pageBanner) m_headerBanner->hide(); m_headerBanner->detachFromPage(); } m_headerBanner = pageBanner; if (m_headerBanner) m_headerBanner->addToPage(PageBanner::Header, this); } Please let me know what you think. By the way, should we add a check in the beginning of the method to see if pageBanner is the same as m_headerBanner and bail early if it is? Created attachment 205831 [details]
Patch
Fix this in PageBanner::detachFromPage() as suggested by Sam.
Committed: https://trac.webkit.org/changeset/152249 |