Logs for visible content rect
authorChanghyup Jwa <ch.jwa@samsung.com>
Tue, 18 Jun 2013 05:39:52 +0000 (14:39 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Mon, 24 Jun 2013 15:23:00 +0000 (15:23 +0000)
[Title] Logs for visible content rect
[Issue#] N/A
[Problem] N/A
[Cause] N/A
[Solution] N/A

Change-Id: I20e549eb9d32fd7a17ab7296f119ab6be152a77b

Source/WebCore/page/DOMWindow.cpp
Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index cebba14..d0c5b7e 100644 (file)
@@ -1135,7 +1135,14 @@ int DOMWindow::innerHeight() const
 
      // If the device height is overridden, do not include the horizontal scrollbar into the innerHeight (since it is absent on the real device).
     bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenHeightOverride(m_frame);
+
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    int result = view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(includeScrollbars).height()));
+    TIZEN_LOGI(" [%d]", result);
+    return result;
+#else
     return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(includeScrollbars).height()));
+#endif
 }
 
 int DOMWindow::innerWidth() const
@@ -1149,7 +1156,13 @@ int DOMWindow::innerWidth() const
 
     // If the device width is overridden, do not include the vertical scrollbar into the innerWidth (since it is absent on the real device).
     bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWidthOverride(m_frame);
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    int result = view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(includeScrollbars).width()));
+    TIZEN_LOGI(" [%d]", result);
+    return result;
+#else
     return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(includeScrollbars).width()));
+#endif
 }
 
 int DOMWindow::screenX() const
index 1e13fde..cb4b861 100755 (executable)
@@ -189,6 +189,10 @@ double PageClientImpl::adjustScaleWithViewport(double scale)
 #if USE(TILED_BACKING_STORE) && ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
 void PageClientImpl::updateViewportSize(const IntSize& viewportSize, const int angle)
 {
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI(" view size: [%d, %d], angle: [%d]", viewportSize.width(), viewportSize.height(), angle);
+#endif
+
     // update viewport size of webkit
     m_visibleContentRect.setSize(viewportSize);
     m_visibleContentRect = adjustVisibleContentRect(m_visibleContentRect, m_scaleFactor);
@@ -201,6 +205,9 @@ void PageClientImpl::prepareRestoredVisibleContectRect()
 {
     m_restoredScaleFactor = scaleFactor();
     m_restoredScrollPosition = scrollPosition();
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f]", m_restoredScrollPosition.x(), m_restoredScrollPosition.y(), m_restoredScaleFactor);
+#endif
 }
 
 void PageClientImpl::initializeVisibleContentRect()
@@ -224,6 +231,9 @@ void PageClientImpl::initializeVisibleContentRect()
 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
     m_restoredScaleFactor = 0;
 #endif
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f]", initialScrollPosition.x(), initialScrollPosition.y(), initialScaleFactor);
+#endif
 #endif
     setVisibleContentRect(IntRect(initialScrollPosition, m_visibleContentRect.size()), initialScaleFactor);
 #else
@@ -249,6 +259,9 @@ double PageClientImpl::availableMinimumScale()
 
 void PageClientImpl::fitViewportToContent()
 {
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f]", m_visibleContentRect.x(), m_visibleContentRect.y(), m_viewportConstraints.minimumScale);
+#endif
     setVisibleContentRect(m_visibleContentRect, m_viewportConstraints.minimumScale);
 }
 
@@ -399,6 +412,13 @@ void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttribut
         m_viewportConstraints.minimumScale = availableMinimumScale();
     }
 
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI("layout size: [%d, %d], scale: [%.2f, %.2f, %.2f], user scalable: [%s]",
+        m_viewportConstraints.layoutSize.width(), m_viewportConstraints.layoutSize.height(),
+        m_viewportConstraints.initialScale, m_viewportConstraints.minimumScale, m_viewportConstraints.maximumScale,
+        m_viewportConstraints.userScalable ? "TRUE" : "FALSE");
+#endif
+
     // setVisibleContentRect() should be called to adjust visible content rect only when view is resized
     if (!m_pageDidRendered || m_viewImpl->page()->estimatedProgress() <= 0.1)
         return;
@@ -424,6 +444,9 @@ void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttribut
     if (m_waitFrameOfNewViewortSize)
         ewk_view_resume(m_viewImpl->view());
 #endif
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f], rotated: [%s]", m_visibleContentRect.x(), m_visibleContentRect.y(), newScale, isRotated ? "Rotated" : "Not rotated");
+#endif
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
     setVisibleContentRect(IntRect(newScrollPosition, m_visibleContentRect.size()), newScale);
@@ -645,6 +668,9 @@ void PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame()
 
 void PageClientImpl::didChangeContentsSize(const WebCore::IntSize size)
 {
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI(" [%d, %d]", size.width(), size.height());
+#endif
 #if USE(TILED_BACKING_STORE)
     if (size.isEmpty())
         return;
@@ -676,8 +702,12 @@ void PageClientImpl::didChangeContentsSize(const WebCore::IntSize size)
     // adjust visible content rect
     bool needScrollAdjustment = (adjustVisibleContentRect(m_visibleContentRect, scaleFactor()) != m_visibleContentRect);
     bool needScaleAdjustment = (fabs(adjustScaleWithViewport(scaleFactor()) - scaleFactor()) > numeric_limits<float>::epsilon());
-    if (needScrollAdjustment || needScaleAdjustment)
+    if (needScrollAdjustment || needScaleAdjustment) {
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+        TIZEN_LOGI(" setVisibleContentRect: [%d, %d], [%.2f]", m_visibleContentRect.x(), m_visibleContentRect.y(), scaleFactor());
+#endif
         setVisibleContentRect(m_visibleContentRect, scaleFactor());
+    }
 }
 
 void PageClientImpl::pageScaleFactorDidChange()
@@ -758,6 +788,9 @@ void PageClientImpl::pageDidRequestScroll(const IntPoint& point)
     IntPoint newPoint = point;
     newPoint.scale(scaleFactor(), scaleFactor());
 #if ENABLE(TIZEN_WEBKIT2_BEFORE_PAGE_RENDERED_SCROLL_POSITION)
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI("scroll position: [%d, %d], [%s]", newPoint.x(), newPoint.y(), m_pageDidRendered ? "Rendered" : "Before rendered");
+#endif
     if (!m_pageDidRendered)
         m_scrollPositionBeforePageRendered = newPoint;
     else
@@ -776,6 +809,9 @@ void PageClientImpl::pageDidRequestRestoreVisibleContentRect(const IntPoint& poi
     m_restoredScrollPosition = point;
     m_restoredScrollPosition.scale(scale, scale);
     m_restoredScaleFactor = scale;
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f]", m_restoredScrollPosition.x(), m_restoredScrollPosition.y(), m_restoredScaleFactor);
+#endif
 
     // Before contents size is fixed, just update visible content rect's position
     m_visibleContentRect.setLocation(m_restoredScrollPosition);
@@ -972,6 +1008,10 @@ void PageClientImpl::resumeContent()
     if (!m_hasSuspendedContent)
         return;
 
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f]", m_viewImpl->scrollPosition().x(), m_viewImpl->scrollPosition().y(), m_viewImpl->scaleFactor());
+#endif
+
     // FIXME: Update visibleContentRect with m_viewImpl after resuming content.
     // The concept is that the values of EwkViewImpl and PageClient can be different
     // during suspending content and they become same when content is resumed.
index 4772fef..dbd3105 100644 (file)
@@ -2522,6 +2522,10 @@ bool ewk_view_focused_node_adjust(Evas_Object* ewkView, Eina_Bool adjustForExter
             scrollPosition.setX(focusedNodeRect.x());
     }
 
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f]", scrollPosition.x(), scrollPosition.y(), newScaleFactor);
+#endif
+
 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
     impl->pageClient->setVisibleContentRect(IntRect(scrollPosition, impl->size()), newScaleFactor);
 #else
index 73c7146..535829e 100755 (executable)
@@ -1085,6 +1085,13 @@ void WebPage::sendViewportAttributesChanged()
     Settings* settings = m_page->settings();
 
 #if OS(TIZEN)
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI(" args type: [%d], scale: [%.1f, %.1f, %.1f], layout: [%.1f, %.1f], userScalable: [%.1f]"
+        , static_cast<int>(m_page->viewportArguments().type), m_page->viewportArguments().initialScale
+        , m_page->viewportArguments().minimumScale, m_page->viewportArguments().maximumScale
+        , m_page->viewportArguments().width, m_page->viewportArguments().height, m_page->viewportArguments().userScalable);
+#endif
+
     // As android and iphone does, we set layout width to 980 for desktop content
     int minimumLayoutFallbackWidth = settings->layoutFallbackWidth();
 #else
@@ -1141,6 +1148,10 @@ void WebPage::setViewportSize(const IntSize& size)
     if (m_viewportSize == size)
         return;
 
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI(" viewportSize: [%d, %d]", size.width(), size.height());
+#endif
+
      m_viewportSize = size;
 
     sendViewportAttributesChanged();
@@ -1546,6 +1557,9 @@ void WebPage::pageDidScroll()
 #if USE(TILED_BACKING_STORE)
 void WebPage::pageDidRequestScroll(const IntPoint& point)
 {
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI(" scroll position: [%d, %d]", point.x(), point.y());
+#endif
     send(Messages::WebPageProxy::PageDidRequestScroll(point));
 }
 #endif
@@ -1553,6 +1567,9 @@ void WebPage::pageDidRequestScroll(const IntPoint& point)
 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
 void WebPage::pageDidRequestRestoreVisibleContentRect(const IntPoint& point, float scale)
 {
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+    TIZEN_LOGI(" scale factor: [%.2f], scroll position: [%d, %d]", scale, point.x(), point.y());
+#endif
     send(Messages::WebPageProxy::pageDidRequestRestoreVisibleContentRect(point, scale));
 }
 #endif