Changeset 97462 in webkit
- Timestamp:
- Oct 14, 2011 7:09:43 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r97458 r97462 1 2011-10-14 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 3 Do not cache m_resizesToContentsLayoutSize on WebKit2's WebPage 4 https://bugs.webkit.org/show_bug.cgi?id=66134 5 6 Reviewed by Simon Hausmann. 7 8 Do the resize to contents on the web process side. 9 10 Based on patch by Zalan Bujtas. 11 12 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 13 (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): 14 * WebProcess/WebPage/WebPage.cpp: 15 (WebKit::WebPage::setSize): 16 (WebKit::WebPage::setResizesToContentsUsingLayoutSize): 17 (WebKit::WebPage::resizeToContentsIfNeeded): 18 * WebProcess/WebPage/WebPage.h: 19 1 20 2011-10-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 21 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r95968 r97462 1114 1114 WebPage* webPage = m_frame->page(); 1115 1115 Color backgroundColor = webPage->drawsTransparentBackground() ? Color::transparent : Color::white; 1116 FrameView* view = m_frame->coreFrame()->view(); 1116 1117 1117 1118 bool isMainFrame = webPage->mainWebFrame() == m_frame; 1118 1119 1119 1120 #if ENABLE(TILED_BACKING_STORE) 1120 IntSize currentVisibleContentSize = m_frame->coreFrame()->view() ? m_frame->coreFrame()->view()->visibleContentRect().size() : IntSize(); 1121 m_frame->coreFrame()->createView(webPage->size(), backgroundColor, false, webPage->resizesToContentsLayoutSize(), isMainFrame && webPage->resizesToContentsEnabled()); 1122 1123 if (isMainFrame && webPage->resizesToContentsEnabled()) { 1121 IntSize currentVisibleContentSize; 1122 IntSize fixedLayoutSize; 1123 1124 if (view) { 1125 currentVisibleContentSize = view->visibleContentRect().size(); 1126 fixedLayoutSize = view->fixedLayoutSize(); 1127 } 1128 1129 m_frame->coreFrame()->createView(webPage->size(), backgroundColor, false, fixedLayoutSize, !fixedLayoutSize.isEmpty()); 1130 1131 if (isMainFrame && !fixedLayoutSize.isEmpty()) { 1124 1132 m_frame->coreFrame()->view()->setDelegatesScrolling(true); 1125 1133 m_frame->coreFrame()->view()->setPaintsEntireContents(true); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r97405 r97462 666 666 void WebPage::setSize(const WebCore::IntSize& viewSize) 667 667 { 668 FrameView* view = m_page->mainFrame()->view(); 669 668 670 #if ENABLE(TILED_BACKING_STORE) 669 671 // If we are resizing to content ignore external attempts. 670 if ( !m_resizesToContentsLayoutSize.isEmpty())672 if (view->useFixedLayout()) 671 673 return; 672 674 #endif … … 675 677 return; 676 678 677 Frame* frame = m_page->mainFrame(); 678 679 frame->view()->resize(viewSize); 680 frame->view()->setNeedsLayout(); 679 view->resize(viewSize); 680 view->setNeedsLayout(); 681 681 m_drawingArea->setNeedsDisplay(IntRect(IntPoint(0, 0), viewSize)); 682 682 … … 694 694 void WebPage::setResizesToContentsUsingLayoutSize(const IntSize& targetLayoutSize) 695 695 { 696 if (m_resizesToContentsLayoutSize == targetLayoutSize) 697 return; 698 699 m_resizesToContentsLayoutSize = targetLayoutSize; 700 701 Frame* frame = m_page->mainFrame(); 702 if (m_resizesToContentsLayoutSize.isEmpty()) { 703 frame->view()->setDelegatesScrolling(false); 704 frame->view()->setUseFixedLayout(false); 705 frame->view()->setPaintsEntireContents(false); 706 } else { 707 frame->view()->setDelegatesScrolling(true); 708 frame->view()->setUseFixedLayout(true); 709 frame->view()->setPaintsEntireContents(true); 710 frame->view()->setFixedLayoutSize(m_resizesToContentsLayoutSize); 711 } 712 frame->view()->forceLayout(); 696 FrameView* view = m_page->mainFrame()->view(); 697 698 if (view->fixedLayoutSize() == targetLayoutSize) 699 return; 700 701 bool fixedLayout = !targetLayoutSize.isEmpty(); 702 703 if (fixedLayout) 704 view->setFixedLayoutSize(targetLayoutSize); 705 706 // Set view attributes based on whether fixed layout is used. 707 view->setDelegatesScrolling(fixedLayout); 708 view->setUseFixedLayout(fixedLayout); 709 view->setPaintsEntireContents(fixedLayout); 710 711 // Schedule a layout to use the new target size. 712 if (!view->layoutPending()) { 713 view->setNeedsLayout(); 714 view->scheduleRelayout(); 715 } 713 716 } 714 717 715 718 void WebPage::resizeToContentsIfNeeded() 716 719 { 717 if (m_resizesToContentsLayoutSize.isEmpty())718 return; 719 720 Frame* frame = m_page->mainFrame();721 722 IntSize contentSize = frame->view()->contentsSize();720 FrameView* view = m_page->mainFrame()->view(); 721 722 if (!view->useFixedLayout()) 723 return; 724 725 IntSize contentSize = view->contentsSize(); 723 726 if (contentSize == m_viewSize) 724 727 return; 725 728 726 729 m_viewSize = contentSize; 727 frame->view()->resize(m_viewSize);728 frame->view()->setNeedsLayout();730 view->resize(m_viewSize); 731 view->setNeedsLayout(); 729 732 } 730 733 #endif -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r97405 r97462 309 309 void pageDidRequestScroll(const WebCore::IntPoint&); 310 310 void setFixedVisibleContentRect(const WebCore::IntRect&); 311 312 bool resizesToContentsEnabled() const { return !m_resizesToContentsLayoutSize.isEmpty(); }313 WebCore::IntSize resizesToContentsLayoutSize() const { return m_resizesToContentsLayoutSize; }314 311 void setResizesToContentsUsingLayoutSize(const WebCore::IntSize& targetLayoutSize); 315 312 void resizeToContentsIfNeeded();
Note: See TracChangeset
for help on using the changeset viewer.