Bug 20306

Summary: [gtk] implements FrameLoaderClient::dispatchDidChangeLocationWithinPage
Product: WebKit Reporter: arno. <a.renevier>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: christian, cosimoc, jmalonzo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Bug Depends on: 17066    
Bug Blocks:    
Attachments:
Description Flags
first attempt patch
none
second attempt
none
style update gustavo: review-

Description arno. 2008-08-06 13:35:10 PDT
Hi,
When a user clicks an internal link on a webpage (a link to an anchor within that page), document location changes, but webkit-gtk embedders are not notified of that change. 

Therefore, it would be nice to implement FrameLoaderClient::dispatchDidChangeLocationWithinPage for gtk, so a signal would be sent to notify location change.
Comment 1 arno. 2008-08-08 05:47:58 PDT
Created attachment 22705 [details]
first attempt patch
Comment 2 arno. 2008-08-08 08:11:07 PDT
Created attachment 22706 [details]
second attempt

emit signal on frame, and on view only if we're in the main frame
Comment 3 Jan Alonzo 2008-09-23 05:27:10 PDT
Hi arno

Is your patch for review? If so can you please change the flag to '?' so it will go to the review queue?

Thanks for the patch!
Comment 4 arno. 2008-09-26 04:23:17 PDT
Comment on attachment 22706 [details]
second attempt

I was waiting for bug 17066, but may be we can still fix this one before
Comment 5 Holger Freyther 2008-11-09 15:26:25 PST
Comment on attachment 22706 [details]
second attempt

Let me comment on the style first:


>  void FrameLoaderClient::dispatchDidChangeLocationWithinPage()
>  {
> -    notImplemented();
> +    /* Update the URI
> +     */

// Update the URI

or

/*
 * Update the URI
 */


> +    if (m_frame == webkit_web_view_get_main_frame(webView))
> +        g_signal_emit_by_name(webView, "location-changed-within-page", m_frame);
>  }

early exits (like found in many places):

if (m_frame != webkit_web_get_main_frame(webView))
   return;

g_signal_emit_by_name(webView, "...
Comment 6 arno. 2008-11-10 14:47:28 PST
Created attachment 25028 [details]
style update

Thanks for your comments. Here is an updated patch
Comment 7 Christian Dywan 2009-01-24 21:54:15 PST
Do we really need a separate signal signal for this? In bug 14807 I'm adding notifications for the URI and title properties, so it should be sufficient to monitor the URI. It is easily distiguishable since no loading or progress information would change.
Comment 8 Gustavo Noronha (kov) 2009-04-20 08:02:07 PDT
Comment on attachment 25028 [details]
style update

I agree with Christian in this matter - there is no need to create a new signal for this, let's just use the properties, and have them notified at dispatchDidChangeLocationWithinPage.