diff options
author | Steve Block <steveblock@google.com> | 2010-02-15 12:23:52 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-16 11:48:32 +0000 |
commit | 8a0914b749bbe7da7768e07a7db5c6d4bb09472b (patch) | |
tree | 73f9065f370435d6fde32ae129d458a8c77c8dff /WebKit/gtk/webkit | |
parent | bf14be70295513b8076f3fa47a268a7e42b2c478 (diff) | |
download | external_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.zip external_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.tar.gz external_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.tar.bz2 |
Merge webkit.org at r54731 : Initial merge by git
Change-Id: Ia79977b6cf3b0b00c06ef39419989b28e57e4f4a
Diffstat (limited to 'WebKit/gtk/webkit')
-rw-r--r-- | WebKit/gtk/webkit/webkitprivate.h | 3 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitwebframe.cpp | 26 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitwebview.cpp | 63 |
3 files changed, 73 insertions, 19 deletions
diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h index e9d61a6..44b4d0c 100644 --- a/WebKit/gtk/webkit/webkitprivate.h +++ b/WebKit/gtk/webkit/webkitprivate.h @@ -298,6 +298,9 @@ extern "C" { WEBKIT_API gchar* webkit_web_frame_counter_value_for_element_by_id (WebKitWebFrame* frame, const gchar* id); + WEBKIT_API int + webkit_web_frame_page_number_for_element_by_id(WebKitWebFrame* frame, const gchar* id, float pageWidth, float pageHeight); + WEBKIT_API guint webkit_web_frame_get_pending_unload_event_count(WebKitWebFrame* frame); diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp index 35d9524..fbd246d 100644 --- a/WebKit/gtk/webkit/webkitwebframe.cpp +++ b/WebKit/gtk/webkit/webkitwebframe.cpp @@ -269,6 +269,9 @@ static void webkit_web_frame_class_init(WebKitWebFrameClass* frameClass) * WebKitWebFrame:horizontal-scrollbar-policy and * WebKitWebFrame:vertical-scrollbar-policy properties. * + * Return value: %TRUE to stop other handlers from being invoked for the + * event. %FALSE to propagate the event further. + * * Since: 1.1.14 */ webkit_web_frame_signals[SCROLLBARS_POLICY_CHANGED] = g_signal_new("scrollbars-policy-changed", @@ -841,6 +844,29 @@ gchar* webkit_web_frame_counter_value_for_element_by_id(WebKitWebFrame* frame, c } /** + * webkit_web_frame_page_number_for_element_by_id + * @frame: a #WebKitWebFrame + * @id: an element ID string + * @pageWidth: width of a page + * @pageHeight: height of a page + * + * Return value: The number of page where the specified element will be put + */ +int webkit_web_frame_page_number_for_element_by_id(WebKitWebFrame* frame, const gchar* id, float pageWidth, float pageHeight) +{ + g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL); + + Frame* coreFrame = core(frame); + if (!coreFrame) + return -1; + + Element* coreElement = coreFrame->document()->getElementById(AtomicString(id)); + if (!coreElement) + return -1; + return PrintContext::pageNumberForElement(coreElement, FloatSize(pageWidth, pageHeight)); +} + +/** * webkit_web_frame_get_pending_unload_event_count: * @frame: a #WebKitWebFrame * diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp index ad13895..8c5b802 100644 --- a/WebKit/gtk/webkit/webkitwebview.cpp +++ b/WebKit/gtk/webkit/webkitwebview.cpp @@ -1325,7 +1325,6 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * WebKitWebView::create-web-view: * @web_view: the object on which the signal is emitted * @frame: the #WebKitWebFrame - * @return: a newly allocated #WebKitWebView or %NULL * * Emitted when the creation of a new window is requested. * If this signal is handled the signal handler should return the @@ -1338,6 +1337,8 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * the new #WebKitWebView. The widget to which the widget is added will * handle that. * + * Return value: a newly allocated #WebKitWebView, or %NULL + * * Since: 1.0.3 */ webkit_web_view_signals[CREATE_WEB_VIEW] = g_signal_new("create-web-view", @@ -1353,8 +1354,6 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) /** * WebKitWebView::web-view-ready: * @web_view: the object on which the signal is emitted - * @return: %TRUE to stop other handlers from being invoked for - * the event, %FALSE to propagate the event further * * Emitted after #WebKitWebView::create-web-view when the new #WebKitWebView * should be displayed to the user. When this signal is emitted @@ -1367,6 +1366,9 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * time of the window, so you may want to connect to the ::notify * signal of the #WebKitWebWindowFeatures object to handle those. * + * Return value: %TRUE to stop handlers from being invoked for the event or + * %FALSE to propagate the event furter + * * Since: 1.0.3 */ webkit_web_view_signals[WEB_VIEW_READY] = g_signal_new("web-view-ready", @@ -1381,14 +1383,15 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) /** * WebKitWebView::close-web-view: * @web_view: the object on which the signal is emitted - * @return: %TRUE to stop handlers from being invoked for the event or - * %FALSE to propagate the event furter * * Emitted when closing a #WebKitWebView is requested. This occurs when a * call is made from JavaScript's window.close function. The default * signal handler does not do anything. It is the owner's responsibility * to hide or delete the web view, if necessary. * + * Return value: %TRUE to stop handlers from being invoked for the event or + * %FALSE to propagate the event furter + * * Since: 1.1.11 */ webkit_web_view_signals[CLOSE_WEB_VIEW] = g_signal_new("close-web-view", @@ -1405,10 +1408,11 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * @web_view: the object on which the signal is emitted * @frame: the #WebKitWebFrame that required the navigation * @request: a #WebKitNetworkRequest - * @return: a WebKitNavigationResponse * * Emitted when @frame requests a navigation to another page. * + * Return value: a #WebKitNavigationResponse + * * Deprecated: Use WebKitWebView::navigation-policy-decision-requested * instead */ @@ -1430,8 +1434,6 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * @request: a #WebKitNetworkRequest * @navigation_action: a #WebKitWebNavigation * @policy_decision: a #WebKitWebPolicyDecision - * @return: TRUE if a decision was made, FALSE to have the - * default behavior apply * * Emitted when @frame requests opening a new window. With this * signal the browser can use the context of the request to decide @@ -1453,6 +1455,9 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * webkit_web_policy_decision_download() on the @policy_decision * object. * + * Return value: %TRUE if a decision was made, %FALSE to have the + * default behavior apply + * * Since: 1.1.4 */ webkit_web_view_signals[NEW_WINDOW_POLICY_DECISION_REQUESTED] = @@ -1476,8 +1481,6 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * @request: a #WebKitNetworkRequest * @navigation_action: a #WebKitWebNavigation * @policy_decision: a #WebKitWebPolicyDecision - * @return: TRUE if a decision was made, FALSE to have the - * default behavior apply * * Emitted when @frame requests a navigation to another page. * If this signal is not handled, the default behavior is to allow the @@ -1490,6 +1493,9 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * webkit_web_policy_decision_download() on the @policy_decision * object. * + * Return value: %TRUE if a decision was made, %FALSE to have the + * default behavior apply + * * Since: 1.0.3 */ webkit_web_view_signals[NAVIGATION_POLICY_DECISION_REQUESTED] = g_signal_new("navigation-policy-decision-requested", @@ -1512,8 +1518,6 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * @request: a WebKitNetworkRequest * @mimetype: the MIME type attempted to load * @policy_decision: a #WebKitWebPolicyDecision - * @return: TRUE if a decision was made, FALSE to have the - * default behavior apply * * Decide whether or not to display the given MIME type. If this * signal is not handled, the default behavior is to show the @@ -1531,6 +1535,9 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * webkit_web_policy_decision_download() on the @policy_decision * object. * + * Return value: %TRUE if a decision was made, %FALSE to have the + * default behavior apply + * * Since: 1.0.3 */ webkit_web_view_signals[MIME_TYPE_POLICY_DECISION_REQUESTED] = g_signal_new("mime-type-policy-decision-requested", @@ -1578,7 +1585,6 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * @web_view: the object on which the signal is emitted * @download: a #WebKitDownload object that lets you control the * download process - * @return: %TRUE if the download should be performed, %FALSE to cancel it. * * A new Download is being requested. By default, if the signal is * not handled, the download is cancelled. If you handle the download @@ -1601,6 +1607,9 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * is to download anything that WebKit can't handle, which you can * figure out by using webkit_web_view_can_show_mime_type()). * + * Return value: TRUE if the download should be performed, %FALSE to + * cancel it + * * Since: 1.1.2 */ webkit_web_view_signals[DOWNLOAD_REQUESTED] = g_signal_new("download-requested", @@ -1681,6 +1690,9 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * handle the signal if you want to provide your own error page. * * Since: 1.1.6 + * + * Return value: %TRUE to stop other handlers from being invoked for the + * event. %FALSE to propagate the event further. */ webkit_web_view_signals[LOAD_ERROR] = g_signal_new("load-error", G_TYPE_FROM_CLASS(webViewClass), @@ -1774,8 +1786,6 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * WebKitWebView::print-requested * @web_view: the object in which the signal is emitted * @web_frame: the frame that is requesting to be printed - * @return: %TRUE if the print request has been handled, %FALSE if - * the default handler should run * * Emitted when printing is requested by the frame, usually * because of a javascript call. When handling this signal you @@ -1787,6 +1797,9 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * ignore a print request you must connect to this signal, and * return %TRUE. * + * Return value: %TRUE if the print request has been handled, %FALSE if + * the default handler should run + * * Since: 1.1.5 */ webkit_web_view_signals[PRINT_REQUESTED] = g_signal_new("print-requested", @@ -1843,9 +1856,11 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * @message: the message text * @line: the line where the error occured * @source_id: the source id - * @return: TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further. * * A JavaScript console message was created. + * + * Return value: %TRUE to stop other handlers from being invoked for the + * event. %FALSE to propagate the event further. */ webkit_web_view_signals[CONSOLE_MESSAGE] = g_signal_new("console-message", G_TYPE_FROM_CLASS(webViewClass), @@ -1862,9 +1877,11 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * @web_view: the object on which the signal is emitted * @frame: the relevant frame * @message: the message text - * @return: TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further. * * A JavaScript alert dialog was created. + * + * Return value: %TRUE to stop other handlers from being invoked for the + * event. %FALSE to propagate the event further. */ webkit_web_view_signals[SCRIPT_ALERT] = g_signal_new("script-alert", G_TYPE_FROM_CLASS(webViewClass), @@ -1882,9 +1899,11 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * @frame: the relevant frame * @message: the message text * @confirmed: whether the dialog has been confirmed - * @return: TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further. * * A JavaScript confirm dialog was created, providing Yes and No buttons. + * + * Return value: %TRUE to stop other handlers from being invoked for the + * event. %FALSE to propagate the event further. */ webkit_web_view_signals[SCRIPT_CONFIRM] = g_signal_new("script-confirm", G_TYPE_FROM_CLASS(webViewClass), @@ -1903,9 +1922,11 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * @message: the message text * @default: the default value * @text: To be filled with the return value or NULL if the dialog was cancelled. - * @return: TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further. * * A JavaScript prompt dialog was created, providing an entry to input text. + * + * Return value: %TRUE to stop other handlers from being invoked for the + * event. %FALSE to propagate the event further. */ webkit_web_view_signals[SCRIPT_PROMPT] = g_signal_new("script-prompt", G_TYPE_FROM_CLASS(webViewClass), @@ -2032,6 +2053,8 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * * The #WebKitWebView::move-cursor will be emitted to apply the * cursor movement described by its parameters to the @view. + * + * Return value: %TRUE or %FALSE * * Since: 1.1.4 */ @@ -2059,6 +2082,8 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * to set the property value of "webkit-widget-is-selected". This can * be used to draw a visual indicator of the selection. * + * Return value: a new #GtkWidget, or %NULL + * * Since: 1.1.8 */ webkit_web_view_signals[PLUGIN_WIDGET] = g_signal_new("create-plugin-widget", |