../WebCore: InjectedBundleHitTestResult::imageRect() should return rect in WKView...
authorjeffm@apple.com <jeffm@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Oct 2011 22:11:12 +0000 (22:11 +0000)
committerjeffm@apple.com <jeffm@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Oct 2011 22:11:12 +0000 (22:11 +0000)
commitbc4d4810c32446c9b4a5b3af179ce876e848276a
treec1c716f52c39befd0153da3bcd21e18d4119500c
parent39836a7f40c2ec186782648a170a512d43ed2d37
../WebCore: InjectedBundleHitTestResult::imageRect() should return rect in WKView coordinates
https://bugs.webkit.org/show_bug.cgi?id=69963

Add infrastructure to convert from any frame view's coordinate system to the
root view's coordinate system.

Reviewed by Simon Fraser.

No new tests (yet), this is covered by <https://bugs.webkit.org/show_bug.cgi?id=70136>.

* WebCore.exp.in: Exported WebCore::ScrollView::contentsToRootView(), used by InjectedBundleHitTestResult.cpp.

* platform/ScrollView.cpp:
(WebCore::ScrollView::rootViewToContents): Added (both point and rect versions).
(WebCore::ScrollView::contentsToRootView): Ditto.

* platform/ScrollView.h: Added member functions to convert to/from root view coordinates.

* platform/Widget.cpp:
(WebCore::Widget::convertFromRootView): Added (both point and rect versions).
(WebCore::Widget::convertToRootView): Ditto.

* platform/Widget.h: Added member functions to convert to/from root view coordinates.

../WebKit2: InjectedBundleHitTestResult::imageRect() should return rect in WKView coordinates
https://bugs.webkit.org/show_bug.cgi?id=69963

WebKit2 clients only have knowledge of the WKView's coordinate system, they have no way to
convert from subframe view coordinates , so any rect that we expose through WK2 APIs should
be in WKView coordinates.

Reviewed by Simon Fraser.

* WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
(WebKit::InjectedBundleHitTestResult::imageRect): Use WebCore::FrameView::contentsToRootView() to convert the image rect to WKView coordinates.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/ScrollView.h
Source/WebCore/platform/Widget.cpp
Source/WebCore/platform/Widget.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp