2011-04-05 John Mellor <johnme@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2011 08:12:11 +0000 (08:12 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2011 08:12:11 +0000 (08:12 +0000)
        Reviewed by Darin Fisher.

        [chromium] Minor cleanup: simplify WebFrameImpl by using contentsToWindow instead of convertToContainingWindow.
        https://bugs.webkit.org/show_bug.cgi?id=55681

        * src/WebFrameImpl.cpp:
        (WebKit::WebFrameImpl::find):
        (WebKit::WebFrameImpl::scopeStringMatches):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@82912 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebFrameImpl.cpp

index b443c4b..6a1594a 100644 (file)
@@ -1,3 +1,14 @@
+2011-04-05  John Mellor  <johnme@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [chromium] Minor cleanup: simplify WebFrameImpl by using contentsToWindow instead of convertToContainingWindow.
+        https://bugs.webkit.org/show_bug.cgi?id=55681
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::find):
+        (WebKit::WebFrameImpl::scopeStringMatches):
+
 2011-04-05  Adam Barth  <abarth@webkit.org>
 
         Roll Chromium DEPS.
index fdfb14e..9c5e05f 100644 (file)
@@ -1482,12 +1482,8 @@ bool WebFrameImpl::find(int identifier,
                     m_activeMatchIndex = m_lastMatchCount - 1;
             }
             if (selectionRect) {
-                WebRect rect = frame()->view()->convertToContainingWindow(currSelectionRect);
-                rect.x -= frameView()->scrollOffset().width();
-                rect.y -= frameView()->scrollOffset().height();
-                *selectionRect = rect;
-
-                reportFindInPageSelection(rect, m_activeMatchIndex + 1, identifier);
+                *selectionRect = frameView()->contentsToWindow(currSelectionRect);
+                reportFindInPageSelection(*selectionRect, m_activeMatchIndex + 1, identifier);
             }
         }
     } else {
@@ -1624,10 +1620,8 @@ void WebFrameImpl::scopeStringMatches(int identifier,
                 m_locatingActiveRect = false;
 
                 // Notify browser of new location for the selected rectangle.
-                resultBounds.move(-frameView()->scrollOffset().width(),
-                                  -frameView()->scrollOffset().height());
                 reportFindInPageSelection(
-                    frame()->view()->convertToContainingWindow(resultBounds),
+                    frameView()->contentsToWindow(resultBounds),
                     m_activeMatchIndex + 1,
                     identifier);
             }