Title: [97462] trunk/Source/WebKit2
- Revision
- 97462
- Author
- [email protected]
- Date
- 2011-10-14 07:09:43 -0700 (Fri, 14 Oct 2011)
Log Message
Do not cache m_resizesToContentsLayoutSize on WebKit2's WebPage
https://bugs.webkit.org/show_bug.cgi?id=66134
Reviewed by Simon Hausmann.
Do the resize to contents on the web process side.
Based on patch by Zalan Bujtas.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setSize):
(WebKit::WebPage::setResizesToContentsUsingLayoutSize):
(WebKit::WebPage::resizeToContentsIfNeeded):
* WebProcess/WebPage/WebPage.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (97461 => 97462)
--- trunk/Source/WebKit2/ChangeLog 2011-10-14 13:55:45 UTC (rev 97461)
+++ trunk/Source/WebKit2/ChangeLog 2011-10-14 14:09:43 UTC (rev 97462)
@@ -1,3 +1,22 @@
+2011-10-14 Kenneth Rohde Christiansen <[email protected]>
+
+ Do not cache m_resizesToContentsLayoutSize on WebKit2's WebPage
+ https://bugs.webkit.org/show_bug.cgi?id=66134
+
+ Reviewed by Simon Hausmann.
+
+ Do the resize to contents on the web process side.
+
+ Based on patch by Zalan Bujtas.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::setSize):
+ (WebKit::WebPage::setResizesToContentsUsingLayoutSize):
+ (WebKit::WebPage::resizeToContentsIfNeeded):
+ * WebProcess/WebPage/WebPage.h:
+
2011-10-14 Carlos Garcia Campos <[email protected]>
[GTK] Build is broken with new ld
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (97461 => 97462)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2011-10-14 13:55:45 UTC (rev 97461)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2011-10-14 14:09:43 UTC (rev 97462)
@@ -1113,14 +1113,22 @@
{
WebPage* webPage = m_frame->page();
Color backgroundColor = webPage->drawsTransparentBackground() ? Color::transparent : Color::white;
+ FrameView* view = m_frame->coreFrame()->view();
bool isMainFrame = webPage->mainWebFrame() == m_frame;
#if ENABLE(TILED_BACKING_STORE)
- IntSize currentVisibleContentSize = m_frame->coreFrame()->view() ? m_frame->coreFrame()->view()->visibleContentRect().size() : IntSize();
- m_frame->coreFrame()->createView(webPage->size(), backgroundColor, false, webPage->resizesToContentsLayoutSize(), isMainFrame && webPage->resizesToContentsEnabled());
+ IntSize currentVisibleContentSize;
+ IntSize fixedLayoutSize;
- if (isMainFrame && webPage->resizesToContentsEnabled()) {
+ if (view) {
+ currentVisibleContentSize = view->visibleContentRect().size();
+ fixedLayoutSize = view->fixedLayoutSize();
+ }
+
+ m_frame->coreFrame()->createView(webPage->size(), backgroundColor, false, fixedLayoutSize, !fixedLayoutSize.isEmpty());
+
+ if (isMainFrame && !fixedLayoutSize.isEmpty()) {
m_frame->coreFrame()->view()->setDelegatesScrolling(true);
m_frame->coreFrame()->view()->setPaintsEntireContents(true);
// The HistoryController will update the scroll position later if needed.
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (97461 => 97462)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2011-10-14 13:55:45 UTC (rev 97461)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2011-10-14 14:09:43 UTC (rev 97462)
@@ -665,19 +665,19 @@
void WebPage::setSize(const WebCore::IntSize& viewSize)
{
+ FrameView* view = m_page->mainFrame()->view();
+
#if ENABLE(TILED_BACKING_STORE)
// If we are resizing to content ignore external attempts.
- if (!m_resizesToContentsLayoutSize.isEmpty())
+ if (view->useFixedLayout())
return;
#endif
if (m_viewSize == viewSize)
return;
- Frame* frame = m_page->mainFrame();
-
- frame->view()->resize(viewSize);
- frame->view()->setNeedsLayout();
+ view->resize(viewSize);
+ view->setNeedsLayout();
m_drawingArea->setNeedsDisplay(IntRect(IntPoint(0, 0), viewSize));
m_viewSize = viewSize;
@@ -693,39 +693,42 @@
void WebPage::setResizesToContentsUsingLayoutSize(const IntSize& targetLayoutSize)
{
- if (m_resizesToContentsLayoutSize == targetLayoutSize)
+ FrameView* view = m_page->mainFrame()->view();
+
+ if (view->fixedLayoutSize() == targetLayoutSize)
return;
- m_resizesToContentsLayoutSize = targetLayoutSize;
+ bool fixedLayout = !targetLayoutSize.isEmpty();
- Frame* frame = m_page->mainFrame();
- if (m_resizesToContentsLayoutSize.isEmpty()) {
- frame->view()->setDelegatesScrolling(false);
- frame->view()->setUseFixedLayout(false);
- frame->view()->setPaintsEntireContents(false);
- } else {
- frame->view()->setDelegatesScrolling(true);
- frame->view()->setUseFixedLayout(true);
- frame->view()->setPaintsEntireContents(true);
- frame->view()->setFixedLayoutSize(m_resizesToContentsLayoutSize);
+ if (fixedLayout)
+ view->setFixedLayoutSize(targetLayoutSize);
+
+ // Set view attributes based on whether fixed layout is used.
+ view->setDelegatesScrolling(fixedLayout);
+ view->setUseFixedLayout(fixedLayout);
+ view->setPaintsEntireContents(fixedLayout);
+
+ // Schedule a layout to use the new target size.
+ if (!view->layoutPending()) {
+ view->setNeedsLayout();
+ view->scheduleRelayout();
}
- frame->view()->forceLayout();
}
void WebPage::resizeToContentsIfNeeded()
{
- if (m_resizesToContentsLayoutSize.isEmpty())
+ FrameView* view = m_page->mainFrame()->view();
+
+ if (!view->useFixedLayout())
return;
- Frame* frame = m_page->mainFrame();
-
- IntSize contentSize = frame->view()->contentsSize();
+ IntSize contentSize = view->contentsSize();
if (contentSize == m_viewSize)
return;
m_viewSize = contentSize;
- frame->view()->resize(m_viewSize);
- frame->view()->setNeedsLayout();
+ view->resize(m_viewSize);
+ view->setNeedsLayout();
}
#endif
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (97461 => 97462)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2011-10-14 13:55:45 UTC (rev 97461)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2011-10-14 14:09:43 UTC (rev 97462)
@@ -308,9 +308,6 @@
#if ENABLE(TILED_BACKING_STORE)
void pageDidRequestScroll(const WebCore::IntPoint&);
void setFixedVisibleContentRect(const WebCore::IntRect&);
-
- bool resizesToContentsEnabled() const { return !m_resizesToContentsLayoutSize.isEmpty(); }
- WebCore::IntSize resizesToContentsLayoutSize() const { return m_resizesToContentsLayoutSize; }
void setResizesToContentsUsingLayoutSize(const WebCore::IntSize& targetLayoutSize);
void resizeToContentsIfNeeded();
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes