After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732713 - Download handled link remains in the URL bar instead of the original one
Download handled link remains in the URL bar instead of the original one
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Interface
3.12.x (obsolete)
Other Mac OS
: Normal normal
: ---
Assigned To: Michael Catanzaro
Epiphany Maintainers
Depends on:
Blocks: 734952
 
 
Reported: 2014-07-04 00:59 UTC by Andres Gomez
Modified: 2014-09-17 14:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Let the location controller control the title box address (7.71 KB, patch)
2014-08-28 13:43 UTC, Michael Catanzaro
reviewed Details | Review
Let the location controller control the title box address (7.74 KB, patch)
2014-08-30 23:55 UTC, Michael Catanzaro
none Details | Review
Let the location controller control the title box address (7.77 KB, patch)
2014-08-30 23:58 UTC, Michael Catanzaro
none Details | Review
Let the location controller control the title box address (7.77 KB, patch)
2014-08-31 00:18 UTC, Michael Catanzaro
committed Details | Review
Fix partially-typed address appearing in subtitle (3.64 KB, patch)
2014-09-07 15:06 UTC, Michael Catanzaro
none Details | Review
Fix partially-typed address appearing in subtitle (1.73 KB, patch)
2014-09-08 23:16 UTC, Michael Catanzaro
committed Details | Review

Description Andres Gomez 2014-07-04 00:59:02 UTC
This is related to bug 732679

Web 3.12.1 and WebKit 2.4.3

Go to a page with content which is handled as a download upon clicking.

Click on the link, the download starts automatically, the URL in the bar is updated to the one of the downloading file.

Click in the bar to edit the visiting URL, the URL is the original one from the visiting page.

Click outside of the editable URL bar, the URL is the one from the downloaded content.

For example, got to bug 731298 and try with the attachment.
Comment 1 Michael Catanzaro 2014-08-28 13:43:41 UTC
Created attachment 284696 [details] [review]
Let the location controller control the title box address

By binding the title box's address directly to the URI property of the
web view, we bypass all our custom logic for displaying the URI,
sometimes leading to desyncs between the URI shown by the location entry
and the URI shown by the title box.

Also, with this change the title of the page now changes at the same
time the displayed address does, whereas previously we would change the
address on the start of load and the title on completion, which looked
odd.

Fair warning: this patch will result in incorrect URIs being displayed unless the patches in bug #734952 are merged first.
Comment 2 Carlos Garcia Campos 2014-08-29 13:27:51 UTC
Review of attachment 284696 [details] [review]:

::: src/ephy-location-controller.c
@@ +693,3 @@
+	*
+	* The #EphyLocationController sets the address of this title box.
+	*/

This looks bad indented.

::: src/ephy-title-box.c
@@ +685,3 @@
+  char *uri;
+
+  g_return_if_fail (EPHY_IS_TITLE_BOX (title_box));

do we allow a NULL address?

@@ +691,3 @@
+
+  if (mode == EPHY_EMBED_SHELL_MODE_APPLICATION) {
+    uri = g_strdup (address);

I think we can avoid this allocation now, with something like:

if (mode == EPHY_EMBED_SHELL_MODE_APPLICATION) {
    gtk_label_set_text (GTK_LABEL (priv->uri), address);
} else {
    gboolean rtl;
    char *uri;
    
    ....
    gtk_label_set_text (GTK_LABEL (priv->uri), uri);
    g_free (uri);
}

@@ +694,3 @@
+  } else {
+    gboolean rtl;
+    rtl = gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL;

I know it's just copy paste, but leave a space between variable decls block and the body, please.
Comment 3 Michael Catanzaro 2014-08-30 23:55:13 UTC
(In reply to comment #2)
> Review of attachment 284696 [details] [review]:
> 
> ::: src/ephy-location-controller.c
> @@ +693,3 @@
> +    *
> +    * The #EphyLocationController sets the address of this title box.
> +    */
> 
> This looks bad indented.

It looks like the surrounding code?

> ::: src/ephy-title-box.c
> @@ +685,3 @@
> +  char *uri;
> +
> +  g_return_if_fail (EPHY_IS_TITLE_BOX (title_box));
> 
> do we allow a NULL address?

No, it's guaranteed to be non-null.

Fixed the other two.
Comment 4 Michael Catanzaro 2014-08-30 23:55:51 UTC
Created attachment 284913 [details] [review]
Let the location controller control the title box address
Comment 5 Michael Catanzaro 2014-08-30 23:56:44 UTC
(In reply to comment #3)
> > do we allow a NULL address?
> 
> No, it's guaranteed to be non-null.

Er, whoops, I'll add the assertion.
Comment 6 Michael Catanzaro 2014-08-30 23:58:17 UTC
Created attachment 284914 [details] [review]
Let the location controller control the title box address
Comment 7 Michael Catanzaro 2014-08-31 00:18:36 UTC
Created attachment 284915 [details] [review]
Let the location controller control the title box address

Third time's the charm? The address can be null. The address property of the web view will never be null, but if it matches one of the do_not_show_address addresses in ephy-embed-utils.c then the location controller will receive a null address.
Comment 8 Carlos Garcia Campos 2014-08-31 11:10:59 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Review of attachment 284696 [details] [review] [details]:
> > 
> > ::: src/ephy-location-controller.c
> > @@ +693,3 @@
> > +    *
> > +    * The #EphyLocationController sets the address of this title box.
> > +    */
> > 
> > This looks bad indented.
> 
> It looks like the surrounding code?

I mean the *, they are usually lined up
Comment 9 Carlos Garcia Campos 2014-08-31 11:13:54 UTC
Comment on attachment 284915 [details] [review]
Let the location controller control the title box address

Ok
Comment 10 Michael Catanzaro 2014-08-31 14:05:06 UTC
(In reply to comment #8)
> I mean the *, they are usually lined up

Usually, but in that file they don't. :/
Comment 11 Michael Catanzaro 2014-08-31 14:05:58 UTC
Attachment 284915 [details] pushed as db37eb4 - Let the location controller control the title box address
Comment 12 Michael Catanzaro 2014-09-02 01:12:11 UTC
We need to not update the address in the title box if the user has typed an address manually into the location entry.
Comment 13 Michael Catanzaro 2014-09-07 15:06:40 UTC
Created attachment 285615 [details] [review]
Fix partially-typed address appearing in subtitle

Now that the EphyLocationController manages the address of the
EphyTitleBox in addition to the EphyLocationEntry, it's no longer safe
to update its address when the address of the location entry changes,
since we want the title box to display the address of the current page,
not whatever the user has typed into the location entry. This is easy to
fix by simply not subscribing to address updates from the location
entry, which are no longer needed.

(I think I've finally got this right. This patch leaves location entry locking in place. It will discard what the user has typed in the location entry only if the title box switches from location entry mode to title mode.)
Comment 14 Michael Catanzaro 2014-09-08 21:39:04 UTC
Comment on attachment 285615 [details] [review]
Fix partially-typed address appearing in subtitle

This breaks autocompletion.
Comment 15 Michael Catanzaro 2014-09-08 23:16:50 UTC
Created attachment 285692 [details] [review]
Fix partially-typed address appearing in subtitle

Now that the EphyLocationController manages the address of the
EphyTitleBox in addition to the EphyLocationEntry, it's no longer safe
to update its address when the address of the location entry changes,
since we want the title box to display the address of the current page,
not whatever the user has typed into the location entry. This is easy to
fix by simply not updating the location controller's address with the
location entry's address.
Comment 16 Carlos Garcia Campos 2014-09-17 13:00:45 UTC
Comment on attachment 285692 [details] [review]
Fix partially-typed address appearing in subtitle

Ok, sorry for the delay.
Comment 17 Michael Catanzaro 2014-09-17 14:08:13 UTC
Attachment 285692 [details] pushed as d6b767b - Fix partially-typed address appearing in subtitle