Changeset 143474 in webkit
- Timestamp:
- Feb 20, 2013 10:23:42 AM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r143472 r143474 1 2013-02-20 Huang Dongsung <luxtella@company100.net> 2 3 [WK2] Remove m_viewportSize in WebPage. 4 https://bugs.webkit.org/show_bug.cgi?id=110311 5 6 Reviewed by Anders Carlsson. 7 8 EFL and Qt use m_viewSize as a contents size while Apple use it as a viewport 9 size, so EFL and Qt introduced m_viewportSize to make WebPage know a viewport 10 size. 11 12 EFL and Qt use m_viewSize as a contents size because the size of non compositing 13 layer is contents size, and EFL and Qt mark whole non compositing layer as dirty 14 using m_viewSize. Bug 110299 (http://webkit.org/b/110299) changes that it is not 15 necessary to know m_viewSize when marking whole non compositing layer as dirty. 16 So we can make EFL and Qt use m_viewSize as a viewport size also. 17 18 This patch removes m_viewportSize and related methods to increase readability. 19 20 * UIProcess/API/qt/raw/qrawwebview.cpp: 21 (QRawWebView::setSize): 22 * UIProcess/PageViewportController.cpp: 23 (WebKit::PageViewportController::didChangeViewportSize): 24 * UIProcess/WebPageProxy.cpp: 25 (WebKit): 26 * UIProcess/WebPageProxy.h: 27 (WebPageProxy): 28 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 29 (WebKit::WebChromeClient::pageRect): 30 (WebKit::WebChromeClient::contentsSizeChanged): 31 * WebProcess/WebPage/DrawingAreaImpl.cpp: 32 (WebKit::DrawingAreaImpl::updateBackingStoreState): 33 * WebProcess/WebPage/WebPage.cpp: 34 (WebKit::WebPage::setSize): 35 (WebKit::WebPage::sendViewportAttributesChanged): 36 * WebProcess/WebPage/WebPage.h: 37 (WebPage): 38 * WebProcess/WebPage/WebPage.messages.in: 39 1 40 2013-02-20 Huang Dongsung <luxtella@company100.net> 2 41 -
trunk/Source/WebKit2/UIProcess/API/qt/raw/qrawwebview.cpp
r142579 r143474 345 345 346 346 if (d->m_webPageProxy->useFixedLayout()) 347 d ->m_webPageProxy->setViewportSize(size);347 drawingArea->setSize(size, WebCore::IntSize()); 348 348 349 349 d->m_size = size; -
trunk/Source/WebKit2/UIProcess/PageViewportController.cpp
r141770 r143474 252 252 // Let the WebProcess know about the new viewport size, so that 253 253 // it can resize the content accordingly. 254 m_webPageProxy-> setViewportSize(roundedIntSize(newSize));254 m_webPageProxy->drawingArea()->setSize(roundedIntSize(newSize), IntSize()); 255 255 } 256 256 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r143418 r143474 1008 1008 1009 1009 #if USE(TILED_BACKING_STORE) 1010 void WebPageProxy::setViewportSize(const IntSize& size)1011 {1012 if (!isValid())1013 return;1014 1015 m_process->send(Messages::WebPage::SetViewportSize(size), m_pageID);1016 }1017 1018 1010 void WebPageProxy::commitPageTransitionViewport() 1019 1011 { -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r143418 r143474 420 420 #endif 421 421 #if USE(TILED_BACKING_STORE) 422 void setViewportSize(const WebCore::IntSize&);423 422 void commitPageTransitionViewport(); 424 423 #endif -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r143472 r143474 120 120 FloatRect WebChromeClient::pageRect() 121 121 { 122 #if USE(TILED_BACKING_STORE)123 return FloatRect(FloatPoint(), m_page->viewportSize());124 #else125 122 return FloatRect(FloatPoint(), m_page->size()); 126 #endif127 123 } 128 124 … … 447 443 return; 448 444 449 #if PLATFORM(QT) || PLATFORM(EFL) 450 if (m_page->useFixedLayout()) { 451 // The below method updates the size(). 452 m_page->resizeToContentsIfNeeded(); 453 m_page->drawingArea()->layerTreeHost()->sizeDidChange(m_page->size()); 454 } 455 456 m_page->send(Messages::WebPageProxy::DidChangeContentsSize(m_page->size())); 445 #if USE(COORDINATED_GRAPHICS) 446 if (m_page->useFixedLayout()) 447 m_page->drawingArea()->layerTreeHost()->sizeDidChange(size); 448 449 m_page->send(Messages::WebPageProxy::DidChangeContentsSize(size)); 457 450 #endif 458 451 -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
r143472 r143474 395 395 396 396 if (m_layerTreeHost) { 397 // Use the previously set page size instead of the argument. 398 // It gets adjusted properly when using the fixed layout mode. 399 m_layerTreeHost->sizeDidChange(m_webPage->size()); 397 #if USE(COORDINATED_GRAPHICS) 398 // Coordinated Graphics sets the size of the root layer to contents size. 399 if (!m_webPage->useFixedLayout()) 400 #endif 401 m_layerTreeHost->sizeDidChange(m_webPage->size()); 400 402 } else 401 403 m_dirtyRegion = m_webPage->bounds(); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r143472 r143474 980 980 FrameView* view = m_page->mainFrame()->view(); 981 981 982 #if USE(TILED_BACKING_STORE)983 // If we are resizing to content ignore external attempts.984 if (view->useFixedLayout())985 return;986 #endif987 988 982 if (m_viewSize == viewSize) 989 983 return; … … 994 988 995 989 m_viewSize = viewSize; 990 991 #if USE(TILED_BACKING_STORE) 992 if (view->useFixedLayout()) 993 sendViewportAttributesChanged(); 994 #endif 996 995 } 997 996 … … 1004 1003 } 1005 1004 1006 void WebPage:: resizeToContentsIfNeeded()1005 void WebPage::sendViewportAttributesChanged() 1007 1006 { 1008 1007 ASSERT(m_useFixedLayout); 1009 1008 1010 FrameView* view = m_page->mainFrame()->view();1011 1012 if (!view->useFixedLayout())1013 return;1014 1015 IntSize newSize = view->contentsSize().expandedTo(view->fixedLayoutSize());1016 1017 if (newSize == m_viewSize)1018 return;1019 1020 m_viewSize = newSize;1021 view->resize(newSize);1022 view->setNeedsLayout();1023 }1024 1025 void WebPage::sendViewportAttributesChanged()1026 {1027 ASSERT(m_useFixedLayout);1028 1029 1009 // Viewport properties have no impact on zero sized fixed viewports. 1030 if (m_view portSize.isEmpty())1010 if (m_viewSize.isEmpty()) 1031 1011 return; 1032 1012 … … 1034 1014 Settings* settings = m_page->settings(); 1035 1015 1036 int minimumLayoutFallbackWidth = std::max(settings->layoutFallbackWidth(), m_view portSize.width());1016 int minimumLayoutFallbackWidth = std::max(settings->layoutFallbackWidth(), m_viewSize.width()); 1037 1017 1038 1018 // If unset we use the viewport dimensions. This fits with the behavior of desktop browsers. 1039 int deviceWidth = (settings->deviceWidth() > 0) ? settings->deviceWidth() : m_view portSize.width();1040 int deviceHeight = (settings->deviceHeight() > 0) ? settings->deviceHeight() : m_view portSize.height();1041 1042 ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, deviceWidth, deviceHeight, 1, m_view portSize);1019 int deviceWidth = (settings->deviceWidth() > 0) ? settings->deviceWidth() : m_viewSize.width(); 1020 int deviceHeight = (settings->deviceHeight() > 0) ? settings->deviceHeight() : m_viewSize.height(); 1021 1022 ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, deviceWidth, deviceHeight, 1, m_viewSize); 1043 1023 1044 1024 FrameView* view = m_page->mainFrame()->view(); … … 1049 1029 // Put the width and height to the viewport width and height. In css units however. 1050 1030 // Use FloatSize to avoid truncated values during scale. 1051 FloatSize contentFixedSize = m_view portSize;1031 FloatSize contentFixedSize = m_viewSize; 1052 1032 1053 1033 #if ENABLE(CSS_DEVICE_ADAPTATION) … … 1067 1047 send(Messages::WebPageProxy::DidChangeViewportProperties(attr)); 1068 1048 } 1069 1070 void WebPage::setViewportSize(const IntSize& size)1071 {1072 ASSERT(m_useFixedLayout);1073 1074 if (m_viewportSize == size)1075 return;1076 1077 m_viewportSize = size;1078 1079 sendViewportAttributesChanged();1080 }1081 1082 1049 #endif 1083 1050 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r143418 r143474 378 378 void pageDidRequestScroll(const WebCore::IntPoint&); 379 379 void setFixedVisibleContentRect(const WebCore::IntRect&); 380 void resizeToContentsIfNeeded();381 380 void sendViewportAttributesChanged(); 382 void setViewportSize(const WebCore::IntSize&);383 WebCore::IntSize viewportSize() const { return m_viewportSize; }384 381 #endif 385 382 … … 875 872 InjectedBundlePageDiagnosticLoggingClient m_logDiagnosticMessageClient; 876 873 877 #if USE(TILED_BACKING_STORE)878 WebCore::IntSize m_viewportSize;879 #endif880 881 874 FindController m_findController; 882 875 #if ENABLE(TOUCH_EVENTS) && PLATFORM(QT) -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r143418 r143474 117 117 ResumeActiveDOMObjectsAndAnimations() 118 118 119 #if USE(TILED_BACKING_STORE)120 SetViewportSize(WebCore::IntSize size)121 #endif122 123 119 Close() 124 120 TryClose()
Note: See TracChangeset
for help on using the changeset viewer.