Bug 1337264 - Don't depend on page title changes for updating the displayed URL. r?sebastian draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 11 Feb 2017 17:12:48 +0100
changeset 482215 d2b1a96e2f52978d8cd7830f6f0f4f70a140c579
parent 482190 e4c327986df7c9722aa851bf9fa64c1a47c2813f
child 545387 70983000aee644371ac0512d63f0e543476ec3ff
push id45031
push usermozilla@buttercookie.de
push dateSat, 11 Feb 2017 16:16:58 +0000
reviewerssebastian
bugs1337264
milestone54.0a1
Bug 1337264 - Don't depend on page title changes for updating the displayed URL. r?sebastian We've been displaying the URL in place of the page title in the toolbar for quite some time now, but still had the old logic in place whereby only title changes would trigger an update of the displayed text. Most of the time this works fine, because - page navigation usually goes hand in hand with a DOMTitleChanged event, and - when our loading progress bar stops, we update the displayed text anyway however a page doing its navigation in-place using some fancy JS logic and the corresponding history APIs etc. can bypass both of these provisions, since it might trigger neither a title change nor a full browser-side page load. MozReview-Commit-ID: KRrTSmz1xxi
mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
@@ -465,21 +465,20 @@ public abstract class BrowserToolbar ext
                     updateNavigationButtons(tab);
                     break;
 
                 case SELECTED:
                     flags.add(UpdateFlags.PRIVATE_MODE);
                     setPrivateMode(tab.isPrivate());
                     // Fall through.
                 case LOAD_ERROR:
+                case LOCATION_CHANGE:
+                    // We're displaying the tab URL in place of the title,
+                    // so we always need to update our "title" here as well.
                     flags.add(UpdateFlags.TITLE);
-                    // Fall through.
-                case LOCATION_CHANGE:
-                    // A successful location change will cause Tab to notify
-                    // us of a title change, so we don't update the title here.
                     flags.add(UpdateFlags.FAVICON);
                     flags.add(UpdateFlags.SITE_IDENTITY);
 
                     updateNavigationButtons(tab);
                     break;
 
                 case TITLE:
                     flags.add(UpdateFlags.TITLE);