Title: [159864] trunk/Source/WebKit2
Revision
159864
Author
[email protected]
Date
2013-11-28 23:51:24 -0800 (Thu, 28 Nov 2013)

Log Message

[CoordinatedGraphics][WK2] Correct wrong usage of m_contentPosition variable in the WebView.
https://bugs.webkit.org/show_bug.cgi?id=118548

Patch by Eunmi Lee <[email protected]> on 2013-11-28
Reviewed by Noam Rosenthal.

CoordinatedGraphics uses its own scaling logic - contents scaling - and
WebView of CoordinatedGraphics maintains contents position by scaling
with contents scaling factor.
However transformToScene() and updateViewportSize() of WebView regard
the contents position as a non-scaled value, so it should be fixed.

* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::transformToScene):
(WebKit::WebView::updateViewportSize):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (159863 => 159864)


--- trunk/Source/WebKit2/ChangeLog	2013-11-29 03:42:04 UTC (rev 159863)
+++ trunk/Source/WebKit2/ChangeLog	2013-11-29 07:51:24 UTC (rev 159864)
@@ -1,3 +1,20 @@
+2013-11-28  Eunmi Lee  <[email protected]>
+
+        [CoordinatedGraphics][WK2] Correct wrong usage of m_contentPosition variable in the WebView.
+        https://bugs.webkit.org/show_bug.cgi?id=118548
+
+        Reviewed by Noam Rosenthal.
+
+        CoordinatedGraphics uses its own scaling logic - contents scaling - and
+        WebView of CoordinatedGraphics maintains contents position by scaling
+        with contents scaling factor.
+        However transformToScene() and updateViewportSize() of WebView regard
+        the contents position as a non-scaled value, so it should be fixed.
+
+        * UIProcess/CoordinatedGraphics/WebView.cpp:
+        (WebKit::WebView::transformToScene):
+        (WebKit::WebView::updateViewportSize):
+
 2013-11-28  Ryuan Choi  <[email protected]>
 
         [EFL] PageViewportController does not need to be unique_ptr instance

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp (159863 => 159864)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp	2013-11-29 03:42:04 UTC (rev 159863)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp	2013-11-29 07:51:24 UTC (rev 159864)
@@ -236,7 +236,7 @@
 {
     FloatPoint position = -m_contentPosition;
     float effectiveScale = m_contentScaleFactor * m_page->deviceScaleFactor();
-    position.scale(effectiveScale, effectiveScale);
+    position.scale(m_page->deviceScaleFactor(), m_page->deviceScaleFactor());
 
     TransformationMatrix transform = m_userViewportTransform;
     transform.translate(position.x(), position.y());
@@ -258,7 +258,9 @@
     if (CoordinatedDrawingAreaProxy* drawingArea = static_cast<CoordinatedDrawingAreaProxy*>(page()->drawingArea())) {
         // Web Process expects sizes in UI units, and not raw device units.
         drawingArea->setSize(roundedIntSize(dipSize()), IntSize(), IntSize());
-        FloatRect visibleContentsRect(contentPosition(), visibleContentsSize());
+        FloatPoint position = contentPosition();
+        position.scale(1 / m_contentScaleFactor, 1 / m_contentScaleFactor);
+        FloatRect visibleContentsRect(position, visibleContentsSize());
         visibleContentsRect.intersect(FloatRect(FloatPoint(), contentsSize()));
         drawingArea->setVisibleContentsRect(visibleContentsRect, FloatPoint());
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to