RESOLVED FIXED 14806
[gtk] [patch] Implement can_go_backward and can_go_forward in webkitgtkpage.cpp
https://bugs.webkit.org/show_bug.cgi?id=14806
Summary [gtk] [patch] Implement can_go_backward and can_go_forward in webkitgtkpage.cpp
Diego Escalante Urrelo
Reported Sunday, July 29, 2007 10:10:11 PM UTC
Hacking on Epiphany's webkit backend I discovered that webkitgtkpage.h announces the webkit_gtk_page_can_go_backward and webkit_gtk_page_can_go_forward functions but they are not implemented. I just dived into the code and added the corresponding wrappers. Patch attached.
Attachments
Implements the wrappers for can_go_forward|backward (1.08 KB, patch)
2007-07-29 14:11 PDT, Diego Escalante Urrelo
aroben: review-
Updated patch, corrects style (1.50 KB, patch)
2007-07-29 18:45 PDT, Diego Escalante Urrelo
aroben: review+
Diego Escalante Urrelo
Comment 1 Sunday, July 29, 2007 10:11:22 PM UTC
Created attachment 15726 [details] Implements the wrappers for can_go_forward|backward Pretty simple.
Adam Roben (:aroben)
Comment 2 Sunday, July 29, 2007 10:31:02 PM UTC
Comment on attachment 15726 [details] Implements the wrappers for can_go_forward|backward The implementation looks good. Just a few comments to bring this patch in line with <http://webkit.org/coding/coding-style.html> } +gboolean webkit_gtk_page_can_go_backward (WebKitGtkPage* page) +{ There should be an empty line before/after all functions. Please remove the space before the open parenthesis. + WebKitGtkPagePrivate* page_data = WEBKIT_GTK_PAGE_GET_PRIVATE(page); + WebKitGtkFramePrivate* frame_data = WEBKIT_GTK_FRAME_GET_PRIVATE(page_data->main_frame); After talking with Holger, I think we're going to move towards maintaining the WebKit camelCase style for variable names within the WebKit/gtk implementation files. So these variables should be called pageData and frameData. I know it's inconsistent with the rest of the file, but that will be cleaned up later. You also need a ChangeLog entry to go along with your patch. See <http://webkit.org/coding/contributing.html> for instructions on how to generate one. Once these are addressed, I think we can get this landed!
Diego Escalante Urrelo
Comment 3 Monday, July 30, 2007 2:45:34 AM UTC
Created attachment 15735 [details] Updated patch, corrects style This should be enough!
Adam Roben (:aroben)
Comment 4 Monday, July 30, 2007 2:50:16 AM UTC
Comment on attachment 15735 [details] Updated patch, corrects style r=me Thanks for the cleanup!
Diego Escalante Urrelo
Comment 5 Monday, July 30, 2007 3:05:12 AM UTC
Comment on attachment 15735 [details] Updated patch, corrects style >Index: gtk/Api/webkitgtkpage.cpp >=================================================================== >--- gtk/Api/webkitgtkpage.cpp (revision 24766) >+++ gtk/Api/webkitgtkpage.cpp (working copy) >@@ -328,6 +328,20 @@ void webkit_gtk_page_go_forward(WebKitGt > frame_data->frame->loader()->goBackOrForward(1); > } > >+gboolean webkit_gtk_page_can_go_backward(WebKitGtkPage* page) >+{ >+ WebKitGtkPagePrivate* pageData = WEBKIT_GTK_PAGE_GET_PRIVATE(page); >+ WebKitGtkFramePrivate* frameData = WEBKIT_GTK_FRAME_GET_PRIVATE(page_data->main_frame); Oops, should be pageData. >+ return frame_data->frame->loader()->canGoBackOrForward(-1); Oops, should be frameData Same in the other function.
Note You need to log in before you can comment on or make changes to this bug.