WKHitTestResult API's are added. These API's can be used to
get the hover'ed link/image/media URL as well as link lable and
title.
https://bugs.webkit.org/show_bug.cgi?id=68426
Patch by Nayan Kumar K <nayankk@motorola.com> on 2011-09-26
Reviewed by Anders Carlsson.
* CMakeLists.txt:
* GNUmakefile.am:
* UIProcess/API/C/WKHitTestResult.cpp: Added.
(WKHitTestResultGetTypeID):
(WKHitTestResultCopyAbsoluteImageURL):
(WKHitTestResultCopyAbsoluteLinkURL):
(WKHitTestResultCopyAbsoluteMediaURL):
(WKHitTestResultCopyLinkLabel):
(WKHitTestResultCopyLinkTitle):
* UIProcess/API/C/WKHitTestResult.h: Added.
* UIProcess/API/C/WebKit2.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebKit2API.pri:
* win/WebKit2.vcproj:
* win/WebKit2Generated.make:
Tools: Get hover'ed element URL from HitTest.
mouseDidMoveOverElement now gets the hover'ed element link using
WKHitTestResult API's.
https://bugs.webkit.org/show_bug.cgi?id=68426
Patch by Nayan Kumar K <nayankk@motorola.com> on 2011-09-26
Reviewed by Anders Carlsson.
* MiniBrowser/gtk/BrowserWindow.c:
(mouseDidMoveOverElement):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95999
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
UIProcess/API/C/WKFormSubmissionListener.cpp
UIProcess/API/C/WKFrame.cpp
UIProcess/API/C/WKFramePolicyListener.cpp
+ UIProcess/API/C/WKHitTestResult.cpp
UIProcess/API/C/WKIconDatabase.cpp
UIProcess/API/C/WKInspector.cpp
UIProcess/API/C/WKKeyValueStorageManager.cpp
+2011-09-26 Nayan Kumar K <nayankk@motorola.com>
+
+ Added WKHitTestResult API's.
+
+ WKHitTestResult API's are added. These API's can be used to
+ get the hover'ed link/image/media URL as well as link lable and
+ title.
+ https://bugs.webkit.org/show_bug.cgi?id=68426
+
+ Reviewed by Anders Carlsson.
+
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * UIProcess/API/C/WKHitTestResult.cpp: Added.
+ (WKHitTestResultGetTypeID):
+ (WKHitTestResultCopyAbsoluteImageURL):
+ (WKHitTestResultCopyAbsoluteLinkURL):
+ (WKHitTestResultCopyAbsoluteMediaURL):
+ (WKHitTestResultCopyLinkLabel):
+ (WKHitTestResultCopyLinkTitle):
+ * UIProcess/API/C/WKHitTestResult.h: Added.
+ * UIProcess/API/C/WebKit2.h:
+ * WebKit2.xcodeproj/project.pbxproj:
+ * WebKit2API.pri:
+ * win/WebKit2.vcproj:
+ * win/WebKit2Generated.make:
+
2011-09-26 Csaba Osztrogonác <ossy@webkit.org>
[Qt][WK2]Unreviewed speculative buildfix after r95968.
$(WebKit2)/UIProcess/API/C/WKFormSubmissionListener.h \
$(WebKit2)/UIProcess/API/C/WKFrame.h \
$(WebKit2)/UIProcess/API/C/WKFramePolicyListener.h \
+ $(WebKit2)/UIProcess/API/C/WKHitTestResult.h \
$(WebKit2)/UIProcess/API/C/WKInspector.h \
$(WebKit2)/UIProcess/API/C/WKKeyValueStorageManager.h \
$(WebKit2)/UIProcess/API/C/WKMediaCacheManager.h \
Source/WebKit2/UIProcess/API/C/WKFrame.h \
Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp \
Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.h \
+ Source/WebKit2/UIProcess/API/C/WKHitTestResult.cpp \
+ Source/WebKit2/UIProcess/API/C/WKHitTestResult.h \
Source/WebKit2/UIProcess/API/C/WKIconDatabase.cpp \
Source/WebKit2/UIProcess/API/C/WKIconDatabase.h \
Source/WebKit2/UIProcess/API/C/WKInspector.cpp \
--- /dev/null
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKHitTestResult.h"
+
+#include "WKAPICast.h"
+#include "WebHitTestResult.h"
+
+using namespace WebKit;
+
+WKTypeID WKHitTestResultGetTypeID()
+{
+ return toAPI(WebHitTestResult::APIType);
+}
+
+WKURLRef WKHitTestResultCopyAbsoluteImageURL(WKHitTestResultRef hitTestResultRef)
+{
+ return toCopiedURLAPI(toImpl(hitTestResultRef)->absoluteImageURL());
+}
+
+WKURLRef WKHitTestResultCopyAbsoluteLinkURL(WKHitTestResultRef hitTestResultRef)
+{
+ return toCopiedURLAPI(toImpl(hitTestResultRef)->absoluteLinkURL());
+}
+
+WKURLRef WKHitTestResultCopyAbsoluteMediaURL(WKHitTestResultRef hitTestResultRef)
+{
+ return toCopiedURLAPI(toImpl(hitTestResultRef)->absoluteMediaURL());
+}
+
+WKStringRef WKHitTestResultCopyLinkLabel(WKHitTestResultRef hitTestResultRef)
+{
+ return toCopiedAPI(toImpl(hitTestResultRef)->linkLabel());
+}
+
+WKStringRef WKHitTestResultCopyLinkTitle(WKHitTestResultRef hitTestResultRef)
+{
+ return toCopiedAPI(toImpl(hitTestResultRef)->linkTitle());
+}
--- /dev/null
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKHitTestResult_h
+#define WKHitTestResult_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKHitTestResultGetTypeID();
+
+WK_EXPORT WKURLRef WKHitTestResultCopyAbsoluteImageURL(WKHitTestResultRef hitTestResult);
+WK_EXPORT WKURLRef WKHitTestResultCopyAbsoluteLinkURL(WKHitTestResultRef hitTestResult);
+WK_EXPORT WKURLRef WKHitTestResultCopyAbsoluteMediaURL(WKHitTestResultRef hitTestResult);
+
+WK_EXPORT WKStringRef WKHitTestResultCopyLinkLabel(WKHitTestResultRef hitTestResult);
+WK_EXPORT WKStringRef WKHitTestResultCopyLinkTitle(WKHitTestResultRef hitTestResult);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKHitTestResult_h */
#include <WebKit2/WKGeolocationPermissionRequest.h>
#include <WebKit2/WKGeolocationPosition.h>
#include <WebKit2/WKGraphicsContext.h>
+#include <WebKit2/WKHitTestResult.h>
#include <WebKit2/WKMutableArray.h>
#include <WebKit2/WKMutableDictionary.h>
#include <WebKit2/WKNavigationData.h>
93FC67BE12D3CCF200A60610 /* DecoderAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FC679E12D3CC7400A60610 /* DecoderAdapter.h */; };
93FC67BF12D3CCF200A60610 /* EncoderAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93FC679F12D3CC7400A60610 /* EncoderAdapter.cpp */; };
93FC67C012D3CCF200A60610 /* EncoderAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FC67A012D3CC7400A60610 /* EncoderAdapter.h */; };
+ B62E7310143047A60069EC35 /* WKHitTestResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B62E730F143047A60069EC35 /* WKHitTestResult.cpp */; };
+ B62E7312143047B00069EC35 /* WKHitTestResult.h in Headers */ = {isa = PBXBuildFile; fileRef = B62E7311143047B00069EC35 /* WKHitTestResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
B878B615133428DC006888E9 /* CorrectionPanel.h in Headers */ = {isa = PBXBuildFile; fileRef = B878B613133428DC006888E9 /* CorrectionPanel.h */; };
B878B616133428DC006888E9 /* CorrectionPanel.mm in Sources */ = {isa = PBXBuildFile; fileRef = B878B614133428DC006888E9 /* CorrectionPanel.mm */; };
BC0092F7115837A300E0AE2A /* RunLoopMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC0092F5115837A300E0AE2A /* RunLoopMac.mm */; };
93FC67A012D3CC7400A60610 /* EncoderAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EncoderAdapter.h; sourceTree = "<group>"; };
A72D5D7F1236CBA800A88B15 /* WebSerializedScriptValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSerializedScriptValue.h; sourceTree = "<group>"; };
B396EA5512E0ED2D00F4FEB7 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
+ B62E730F143047A60069EC35 /* WKHitTestResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKHitTestResult.cpp; sourceTree = "<group>"; };
+ B62E7311143047B00069EC35 /* WKHitTestResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKHitTestResult.h; sourceTree = "<group>"; };
B878B613133428DC006888E9 /* CorrectionPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CorrectionPanel.h; sourceTree = "<group>"; };
B878B614133428DC006888E9 /* CorrectionPanel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CorrectionPanel.mm; sourceTree = "<group>"; };
BC0092F5115837A300E0AE2A /* RunLoopMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RunLoopMac.mm; sourceTree = "<group>"; };
BC0C376610F807660076D7CB /* C */ = {
isa = PBXGroup;
children = (
+ B62E7311143047B00069EC35 /* WKHitTestResult.h */,
+ B62E730F143047A60069EC35 /* WKHitTestResult.cpp */,
5123CF18133D25E60056F800 /* cg */,
6EE849C41368D9040038D481 /* mac */,
BCB63477116BF10600603215 /* WebKit2.h */,
1A2BB6D114117B4D000F35D4 /* PluginProcessConnectionMessages.h in Headers */,
7801C09A142290C400FAF9AF /* WebHitTestResult.h in Headers */,
0F174AA3142A4CB70039250F /* WebGeometry.h in Headers */,
+ B62E7312143047B00069EC35 /* WKHitTestResult.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1A2BB6D014117B4D000F35D4 /* PluginProcessConnectionMessageReceiver.cpp in Sources */,
7801C099142290C400FAF9AF /* WebHitTestResult.cpp in Sources */,
0F174AA7142AAC610039250F /* WKGeometry.cpp in Sources */,
+ B62E7310143047A60069EC35 /* WKHitTestResult.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
$$SOURCE_DIR/WebKit2/UIProcess/API/C/WKGeolocationManager.cpp \
$$SOURCE_DIR/WebKit2/UIProcess/API/C/WKGeolocationPermissionRequest.cpp \
$$SOURCE_DIR/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp \
+ $$SOURCE_DIR/WebKit2/UIProcess/API/C/WKHitTestResult.cpp \
$$SOURCE_DIR/WebKit2/UIProcess/API/C/WKIconDatabase.cpp \
$$SOURCE_DIR/WebKit2/UIProcess/API/C/WKInspector.cpp \
$$SOURCE_DIR/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp \
$$SOURCE_DIR/WebKit2/UIProcess/API/C/WKGeolocationManager.h \
$$SOURCE_DIR/WebKit2/UIProcess/API/C/WKGeolocationPermissionRequest.h \
$$SOURCE_DIR/WebKit2/UIProcess/API/C/WKGeolocationPosition.h \
+ $$SOURCE_DIR/WebKit2/UIProcess/API/C/WKHitTestResult.h \
$$SOURCE_DIR/WebKit2/UIProcess/API/C/WKIconDatabase.h \
$$SOURCE_DIR/WebKit2/UIProcess/API/C/WKInspector.h \
$$SOURCE_DIR/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h \
>
</File>
<File
+ RelativePath="..\UIProcess\API\C\WKHitTestResult.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\UIProcess\API\C\WKHitTestResult.h"
+ >
+ </File>
+ <File
RelativePath="..\UIProcess\API\C\WKIconDatabase.cpp"
>
</File>
xcopy /y /d "..\UIProcess\API\C\WKGeolocationManager.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\UIProcess\API\C\WKGeolocationPermissionRequest.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\UIProcess\API\C\WKGeolocationPosition.h" "%ConfigurationBuildDir%\include\WebKit2"
+ xcopy /y /d "..\UIProcess\API\C\WKHitTestResult.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\UIProcess\API\C\WKInspector.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\UIProcess\API\C\WKIconDatabase.h" "%ConfigurationBuildDir%\include\WebKit2"
xcopy /y /d "..\UIProcess\API\C\WKKeyValueStorageManager.h" "%ConfigurationBuildDir%\include\WebKit2"
+2011-09-26 Nayan Kumar K <nayankk@motorola.com>
+
+ Get hover'ed element URL from HitTest.
+
+ mouseDidMoveOverElement now gets the hover'ed element link using
+ WKHitTestResult API's.
+ https://bugs.webkit.org/show_bug.cgi?id=68426
+
+ Reviewed by Anders Carlsson.
+
+ * MiniBrowser/gtk/BrowserWindow.c:
+ (mouseDidMoveOverElement):
+
2011-09-26 David Levin <levin@chromium.org>
Add skeleton parsing for a WatchList.
return returnValue;
}
-static void mouseDidMoveOverElement(WKPageRef page, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo)
+static void mouseDidMoveOverElement(WKPageRef page, WKHitTestResultRef hitTestResult, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo)
{
BrowserWindow *window = BROWSER_WINDOW(clientInfo);
gtk_statusbar_pop(GTK_STATUSBAR(window->statusBar), window->statusBarContextId);
- if (!userData)
+ WKURLRef linkUrlRef = WKHitTestResultCopyAbsoluteLinkURL(hitTestResult);
+ if (!linkUrlRef)
return;
- if (WKGetTypeID(userData) != WKURLGetTypeID())
- return;
-
- gchar *link = WKURLGetCString((WKURLRef)userData);
+ gchar *link = WKURLGetCString(linkUrlRef);
+ WKRelease(linkUrlRef);
gtk_statusbar_push(GTK_STATUSBAR(window->statusBar), window->statusBarContextId, link);
g_free(link);
}