Add bundle API for hit-testing
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Oct 2012 06:05:14 +0000 (06:05 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Oct 2012 06:05:14 +0000 (06:05 +0000)
commit99c5ad8c5cca2d6ec92fc9ab7429c67102482065
tree453877d7fdd52cfa0342bbe243add08a3cd02b91
parent0bea112a842c6fd88804bcd95caf1fe76702169b
Add bundle API for hit-testing
https://bugs.webkit.org/show_bug.cgi?id=99907

Reviewed by Sam Weinig.

Source/WebKit2:

Test: TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest.cpp

* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameCreateHitTestResult): Added this wrapper.
* WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::hitTest): Added. Hit tests at the given point, ignoring clipping.
* WebProcess/WebPage/WebFrame.h:
(WebFrame): Declared hitTest.

Tools:

Added an API test for WKBundleFrameCreateHitTest().

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added InjectedBundleFrameHitTest.cpp,
InjectedBundleFrameHitTest_bundle.cpp, and link-with-title.html.

* TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest.cpp: Added.
(TestWebKitAPI::didReceiveMessageFromInjectedBundle): Checks that the message contains the
title of the link in link-with-title.html.
(TestWebKitAPI::setInjectedBundleClient):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp: Added.
(TestWebKitAPI::InjectedBundleFrameHitTestTest::InjectedBundleFrameHitTestTest):
(TestWebKitAPI::didFinishLoadForFrameCallback): Hit tests at (50, 50) and sends the link title
from the result back to the UI process.
(TestWebKitAPI::InjectedBundleFrameHitTestTest::didCreatePage):
(TestWebKitAPI::InjectedBundleFrameHitTestTest::frameLoadFinished):
* TestWebKitAPI/Tests/WebKit2/link-with-title.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2/link-with-title.html [new file with mode: 0644]