Title: [148149] trunk/Source/WebCore
Revision
148149
Author
[email protected]
Date
2013-04-10 16:25:53 -0700 (Wed, 10 Apr 2013)

Log Message

Inspector highlights are offset when the WKView has a header
https://bugs.webkit.org/show_bug.cgi?id=114389
-and corresponding-
<rdar://problem/13522434>

Reviewed by Sam Weinig.

rootViewToContents() and contentsToRootView() need to factor in the 
headerHeight(), much like windowToContents() and contentsToWindow() do already. 
* platform/ScrollView.cpp:
(WebCore::ScrollView::rootViewToContents):
(WebCore::ScrollView::contentsToRootView):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (148148 => 148149)


--- trunk/Source/WebCore/ChangeLog	2013-04-10 23:22:02 UTC (rev 148148)
+++ trunk/Source/WebCore/ChangeLog	2013-04-10 23:25:53 UTC (rev 148149)
@@ -1,3 +1,18 @@
+2013-04-10  Beth Dakin  <[email protected]>
+
+        Inspector highlights are offset when the WKView has a header
+        https://bugs.webkit.org/show_bug.cgi?id=114389
+        -and corresponding-
+        <rdar://problem/13522434>
+
+        Reviewed by Sam Weinig.
+
+        rootViewToContents() and contentsToRootView() need to factor in the 
+        headerHeight(), much like windowToContents() and contentsToWindow() do already. 
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::rootViewToContents):
+        (WebCore::ScrollView::contentsToRootView):
+
 2013-04-10  Simon Fraser  <[email protected]>
 
         Flesh out the Animations logging

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (148148 => 148149)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2013-04-10 23:22:02 UTC (rev 148148)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2013-04-10 23:25:53 UTC (rev 148149)
@@ -713,26 +713,26 @@
 IntPoint ScrollView::rootViewToContents(const IntPoint& rootViewPoint) const
 {
     IntPoint viewPoint = convertFromRootView(rootViewPoint);
-    return viewPoint + scrollOffset();
+    return viewPoint + scrollOffsetRelativeToDocument();
 }
 
 IntPoint ScrollView::contentsToRootView(const IntPoint& contentsPoint) const
 {
-    IntPoint viewPoint = contentsPoint - scrollOffset();
+    IntPoint viewPoint = contentsPoint + IntSize(0, headerHeight()) - scrollOffset();
     return convertToRootView(viewPoint);  
 }
 
 IntRect ScrollView::rootViewToContents(const IntRect& rootViewRect) const
 {
     IntRect viewRect = convertFromRootView(rootViewRect);
-    viewRect.move(scrollOffset());
+    viewRect.move(scrollOffsetRelativeToDocument());
     return viewRect;
 }
 
 IntRect ScrollView::contentsToRootView(const IntRect& contentsRect) const
 {
     IntRect viewRect = contentsRect;
-    viewRect.move(-scrollOffset());
+    viewRect.move(-scrollOffset() + IntSize(0, headerHeight()));
     return convertToRootView(viewRect);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to