Closed Bug 746380 Opened 12 years ago Closed 12 years ago

Throbber stops too early when loading new page from about:home

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(blocking-fennec1.0 +)

VERIFIED FIXED
Firefox 14
Tracking Status
blocking-fennec1.0 --- +

People

(Reporter: bnicholson, Assigned: bnicholson)

References

Details

(Whiteboard: [testday-20120518])

Attachments

(3 files, 3 obsolete files)

STR:
1) Go to about:home
2) Click AwesomeBar, enter nytimes.com, hit go

Expected result:
Throbber will animate until page is loaded

Actual result:
Throbber stops shortly after entering URL, which is long before the page finishes loading

Loading from any page other than about:home will animate the throbber until the page is finished.
Nom'ing since loading a page after being on about:home is a common case.
blocking-fennec1.0: --- → ?
This could be a regression from bug 738938
Assignee: nobody → bnicholson
blocking-fennec1.0: ? → +
When a document start event is received, the URI of the browser still refers to previous URI. We can pull the URI associated with the document start directly from the nsIChannel.
Attachment #617057 - Flags: review?(mark.finkle)
In bug 738938, we relied on the tab's URL to determine whether the request is for about:home. Unfortunately, we get the document start before the location change, so the URL will refer to the URL of the previous page. This patch checks the URL given by the nsIChannel from the first patch.
Attachment #617058 - Flags: review?(mark.finkle)
If we create a new about:home tab, our tab selected event can fire before we receive the document start. To prevent the throbber from immediately appearing, this patch checks the URI of the tab when it's initialized; if it's about:home, it's immediately set to the success state.
Attachment #617061 - Flags: review?(mark.finkle)
Attachment #617057 - Flags: review?(mark.finkle) → review+
Comment on attachment 617058 [details] [diff] [review]
part 2: Set success state for about:home on document start

>+    void handleDocumentStart(int tabId, final boolean showProgress, String uri) {

>-        tab.setState(Tab.STATE_LOADING);
>+        final boolean isAboutHome = "about:home".equals(uri);
>+        tab.setState(isAboutHome ? Tab.STATE_SUCCESS : Tab.STATE_LOADING);

You don't need to do this. Tab.setState already has a check for "about:home"

http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/Tab.java#326

>-                    if (showProgress)
>+                    if (showProgress && !isAboutHome)
>                         mBrowserToolbar.setProgressVisibility(true);

Let's not use isAboutHome here. Use Tab.getState()

>+                    if (showProgress && tab.getState() == Tab.STATE_LOADING)

The less hard coded "about:home" checks the better

r+ with those fixes
Attachment #617058 - Flags: review?(mark.finkle) → review+
Comment on attachment 617061 [details] [diff] [review]
part 3: Set success state for tabs initialized to about:home

NO WAY!

I refuse to live like this.
Attachment #617061 - Flags: review?(mark.finkle) → review-
Nicer approach that keeps the about:home disease contained.
Attachment #617058 - Attachment is obsolete: true
Attachment #617061 - Attachment is obsolete: true
Attachment #617103 - Flags: review?(mark.finkle)
Attachment #617103 - Flags: review?(mark.finkle) → review+
Since we now set the URL on document start, we need to refresh the browser toolbar.
Attachment #617545 - Flags: review?(mark.finkle)
This patch lets our location change listener know whether the location change was fired on the same document (e.g., anchor tags). This means we don't need to rely on the old URL, which was broken in part 2.
Attachment #617545 - Attachment is obsolete: true
Attachment #617545 - Flags: review?(mark.finkle)
Attachment #617639 - Flags: review?(mark.finkle)
Attachment #617639 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/mozilla-central/rev/04994824992a
https://hg.mozilla.org/mozilla-central/rev/4ab101096ab3
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 14
Backed out: https://hg.mozilla.org/mozilla-central/rev/3a0a2fbe7b47
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to Brian Nicholson (:bnicholson) from comment #13)
> Relanded part 2 and landed the new part 3:
> 
> http://hg.mozilla.org/integration/mozilla-inbound/rev/22d17b21018c
> http://hg.mozilla.org/integration/mozilla-inbound/rev/0df5ff135d64

https://hg.mozilla.org/mozilla-central/rev/22d17b21018c
https://hg.mozilla.org/mozilla-central/rev/0df5ff135d64
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Comment on attachment 617057 [details] [diff] [review]
part 1: Use URI of nsIChannel on state change

[Approval Request Comment]
Regression caused by (bug #): bug 738938
User impact if declined: throbber stops too early
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): causes 2 known regressions that have been fixed: bug 748498 and bug 750130
String changes made by this patch: none
Attachment #617057 - Flags: approval-mozilla-aurora?
Comment on attachment 617103 [details] [diff] [review]
part 2: Set tab URL on document start

[Approval Request Comment]
Regression caused by (bug #): bug 738938
User impact if declined: throbber stops too early
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): causes 2 known regressions that have been fixed: bug 748498 and bug 750130
String changes made by this patch: none
Attachment #617103 - Flags: approval-mozilla-aurora?
Comment on attachment 617639 [details] [diff] [review]
part 3: Add same document flag to location change

[Approval Request Comment]
Regression caused by (bug #): bug 738938
User impact if declined: throbber stops too early
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): causes 2 known regressions that have been fixed: bug 748498 and bug 750130
String changes made by this patch: none
Attachment #617639 - Flags: approval-mozilla-aurora?
Attachment #617057 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Attachment #617103 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Attachment #617639 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Depends on: 750130
Looks like this was already merged into Aurora.
I verify that this bug is fixed on beta version (v14).
Whiteboard: [testday-20120518]
Verified fixed on:
Nightly 15.0a1 (2012-05-29) 
Aurora 14.0a2 (2012-05-29)

Device: Galaxy SII (Android 2.3.4)
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: