Title: [96672] trunk
Revision
96672
Author
[email protected]
Date
2011-10-04 18:32:19 -0700 (Tue, 04 Oct 2011)

Log Message

Fix FrameView::scrollElementToRect to take already scrolled amount into consideration.
https://bugs.webkit.org/show_bug.cgi?id=69220

Patch by Sadrul Habib Chowdhury <[email protected]> on 2011-10-04
Reviewed by Simon Fraser.

Source/WebCore:

* page/FrameView.cpp:
(WebCore::FrameView::scrollElementToRect):

LayoutTests:

* fast/dom/scroll-element-to-rect.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (96671 => 96672)


--- trunk/LayoutTests/ChangeLog	2011-10-05 01:32:18 UTC (rev 96671)
+++ trunk/LayoutTests/ChangeLog	2011-10-05 01:32:19 UTC (rev 96672)
@@ -1,3 +1,12 @@
+2011-10-04  Sadrul Habib Chowdhury  <[email protected]>
+
+        Fix FrameView::scrollElementToRect to take already scrolled amount into consideration.
+        https://bugs.webkit.org/show_bug.cgi?id=69220
+
+        Reviewed by Simon Fraser.
+
+        * fast/dom/scroll-element-to-rect.html:
+
 2011-10-04  David Barr  <[email protected]>
 
         Update test expectations after http://trac.webkit.org/changeset/96449

Modified: trunk/LayoutTests/fast/dom/scroll-element-to-rect.html (96671 => 96672)


--- trunk/LayoutTests/fast/dom/scroll-element-to-rect.html	2011-10-05 01:32:18 UTC (rev 96671)
+++ trunk/LayoutTests/fast/dom/scroll-element-to-rect.html	2011-10-05 01:32:19 UTC (rev 96672)
@@ -9,8 +9,10 @@
     <script src=""
     <script>
 	  var box = document.getElementById('textbox');
-      if (window.internals)
+      if (window.internals) {
+        window.internals.scrollElementToRect(box, 0, 100, 300, 300);
         window.internals.scrollElementToRect(box, 0, 0, 300, 300);
+      }
 
       var rect = box.getBoundingClientRect();
       var computedLeft = Math.floor((300 - rect.width) / 2);

Modified: trunk/Source/WebCore/ChangeLog (96671 => 96672)


--- trunk/Source/WebCore/ChangeLog	2011-10-05 01:32:18 UTC (rev 96671)
+++ trunk/Source/WebCore/ChangeLog	2011-10-05 01:32:19 UTC (rev 96672)
@@ -1,3 +1,13 @@
+2011-10-04  Sadrul Habib Chowdhury  <[email protected]>
+
+        Fix FrameView::scrollElementToRect to take already scrolled amount into consideration.
+        https://bugs.webkit.org/show_bug.cgi?id=69220
+
+        Reviewed by Simon Fraser.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollElementToRect):
+
 2011-10-04  Anders Carlsson  <[email protected]>
 
         Ignore the warning about using 'override'.

Modified: trunk/Source/WebCore/page/FrameView.cpp (96671 => 96672)


--- trunk/Source/WebCore/page/FrameView.cpp	2011-10-05 01:32:18 UTC (rev 96671)
+++ trunk/Source/WebCore/page/FrameView.cpp	2011-10-05 01:32:19 UTC (rev 96672)
@@ -1641,7 +1641,7 @@
     LayoutRect bounds = element->getRect();
     int centeringOffsetX = (rect.width() - bounds.width()) / 2;
     int centeringOffsetY = (rect.height() - bounds.height()) / 2;
-    scrollBy(IntSize(bounds.x() - centeringOffsetX - rect.x(), bounds.y() - centeringOffsetY - rect.y()));
+    setScrollPosition(LayoutPoint(bounds.x() - centeringOffsetX - rect.x(), bounds.y() - centeringOffsetY - rect.y()));
 }
 
 void FrameView::setScrollPosition(const LayoutPoint& scrollPoint)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to