Title: [97641] trunk/Source/WebCore
Revision
97641
Author
[email protected]
Date
2011-10-17 13:29:59 -0700 (Mon, 17 Oct 2011)

Log Message

Widget window coordinate functions should use root view coordinate functions
https://bugs.webkit.org/show_bug.cgi?id=70152

Reviewed by Darin Adler.

No new tests, no changes to functionality.

* platform/Widget.cpp:
(WebCore::Widget::convertFromContainingWindow): Use convertFromRootView().
(WebCore::Widget::convertToContainingWindow): Use convertToRootView().

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (97640 => 97641)


--- trunk/Source/WebCore/ChangeLog	2011-10-17 20:15:01 UTC (rev 97640)
+++ trunk/Source/WebCore/ChangeLog	2011-10-17 20:29:59 UTC (rev 97641)
@@ -1,3 +1,16 @@
+2011-10-17  Jeff Miller  <[email protected]>
+
+        Widget window coordinate functions should use root view coordinate functions
+        https://bugs.webkit.org/show_bug.cgi?id=70152
+
+        Reviewed by Darin Adler.
+
+        No new tests, no changes to functionality.
+
+        * platform/Widget.cpp:
+        (WebCore::Widget::convertFromContainingWindow): Use convertFromRootView().
+        (WebCore::Widget::convertToContainingWindow): Use convertToRootView().
+
 2011-10-14  Chris Marrin  <[email protected]>
 
         Throttle rate of requestAnimationFrame when page is not visible

Modified: trunk/Source/WebCore/platform/Widget.cpp (97640 => 97641)


--- trunk/Source/WebCore/platform/Widget.cpp	2011-10-17 20:15:01 UTC (rev 97640)
+++ trunk/Source/WebCore/platform/Widget.cpp	2011-10-17 20:29:59 UTC (rev 97641)
@@ -107,38 +107,22 @@
 
 IntRect Widget::convertFromContainingWindow(const IntRect& windowRect) const
 {
-    if (const ScrollView* parentScrollView = parent()) {
-        IntRect parentRect = parentScrollView->convertFromContainingWindow(windowRect);
-        return convertFromContainingView(parentRect);
-    }
-    return convertFromContainingWindowToRoot(this, windowRect);
+    return convertFromRootView(convertFromContainingWindowToRoot(this, windowRect));
 }
 
 IntRect Widget::convertToContainingWindow(const IntRect& localRect) const
 {
-    if (const ScrollView* parentScrollView = parent()) {
-        IntRect parentRect = convertToContainingView(localRect);
-        return parentScrollView->convertToContainingWindow(parentRect);
-    }
-    return convertFromRootToContainingWindow(this, localRect);
+    return convertFromRootToContainingWindow(this, convertToRootView(localRect));
 }
 
 IntPoint Widget::convertFromContainingWindow(const IntPoint& windowPoint) const
 {
-    if (const ScrollView* parentScrollView = parent()) {
-        IntPoint parentPoint = parentScrollView->convertFromContainingWindow(windowPoint);
-        return convertFromContainingView(parentPoint);
-    }
-    return convertFromContainingWindowToRoot(this, windowPoint);
+    return convertFromRootView(convertFromContainingWindowToRoot(this, windowPoint));
 }
 
 IntPoint Widget::convertToContainingWindow(const IntPoint& localPoint) const
 {
-    if (const ScrollView* parentScrollView = parent()) {
-        IntPoint parentPoint = convertToContainingView(localPoint);
-        return parentScrollView->convertToContainingWindow(parentPoint);
-    }
-    return convertFromRootToContainingWindow(this, localPoint);
+    return convertFromRootToContainingWindow(this, convertToRootView(localPoint));
 }
 
 #if !PLATFORM(MAC)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to