Closed Bug 305167 Opened 19 years ago Closed 19 years ago

bfcache stops javascript ticker on bbc homepage

Categories

(Core :: DOM: Navigation, defect)

1.8 Branch
x86
Windows XP
defect
Not set
minor

Tracking

()

VERIFIED FIXED

People

(Reporter: m.h.perris, Assigned: bryner)

References

()

Details

(Keywords: regression, verified1.8, Whiteboard: [needs review+SR jst])

Attachments

(4 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050818 Firefox/1.6a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050818 Firefox/1.6a1

after using the back button (with bfcache) to return to the bbc news homepage
(news.bbc.co.uk), the ticker has stopped.

Reproducible: Always

Steps to Reproduce:
1.visit http://news.bbc.co.uk
2.visit a different site
3.use the back button to return to bbc news

Actual Results:  
the ticker has stopped at the exact point in time where the new page was opened

Expected Results:  
the ticker should have returned to action from the said point in time
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b4) Gecko/20050820
Firefox/1.0+ ID:2005082003
I see this too.
Status: UNCONFIRMED → NEW
Component: General → History: Session
Ever confirmed: true
Flags: blocking1.8b4?
Product: Firefox → Core
QA Contact: general → history.session
Version: unspecified → 1.0 Branch
Keywords: regression
Severity: normal → minor
Version: 1.0 Branch → 1.8 Branch
Keywords: qawanted
Bryner - looks like this is related to 304860 and bfcache - can you take a look
to figure out what is going on here?
Assignee: nobody → bryner
Flags: blocking1.8b4? → blocking1.8b4+
Flags: blocking1.8b5+
Oops, as of bug 301516 we're no longer restoring timeouts correctly for 
iframes (we're trying to restore them _before_ restoring the docshell tree).  
Fix coming up.
Attached patch patchSplinter Review
I think it's still desirable to restore the Javascript properties of the window
before we dispatch DOMTitleChanged, so I split the restoration of the state and
resuming the timeouts into two separate methods.  We don't resume the timeouts
until after the docshell tree is returned to its original state.
Attachment #193757 - Flags: superreview?(cbiesinger)
Attachment #193757 - Flags: review?(cbiesinger)
Comment on attachment 193757 [details] [diff] [review]
patch

r=biesi (I'm not a super-reviewer)
Attachment #193757 - Flags: superreview?(cbiesinger)
Attachment #193757 - Flags: superreview?
Attachment #193757 - Flags: review?(cbiesinger)
Attachment #193757 - Flags: review+
Attachment #193757 - Flags: superreview? → superreview?(jst)
Comment on attachment 193757 [details] [diff] [review]
patch

sr=jst
Attachment #193757 - Flags: superreview?(jst) → superreview+
Attachment #193757 - Flags: approval1.8b4?
checked in on the trunk, leaving open for branch checkin
Thanks for the hard work, but unfortunatly i believe there's still a bug,
although its a little more obscure.

To reproduce:

1: Visit the BBC News homepage (http://news.bbc.co.uk)
2: Visit any link on the page
3: Return to the homepage using the back button
4: Wait until the ticker has typed out to the end of the line
5: Press 'forward', then 'back'
6: The ticker has stopped.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050825
Firefox/1.6a1 (Pacifica Hourly, with the fix above checked in)
Confirmed, it's not 100% reproduceable for me but I do see the problem.
Did some more investigation... it seems that the timer is getting restored, 
but with a wildly incorrect unit of time remaining.  If you let it sit for say 
3 minutes, the ticker will resume.  Obviously not correct... and the problem 
seems to be in the calculation of time-remaining when we suspend the timer in 
the first place.
Attached patch additional patchSplinter Review
This is needed in addition to the first set of changes.

The root problem here is that we weren't converting PRIntervalTime units to
milliseconds, and on Windows at least they can be different... so the timer was
restored for much later than it should have been.  While figuring all of this
out, I found that we keep nsTimeout::mWhen as a PRInt64, which is _very_
confusing given that it only ever stores PRIntervalTime values (32-bit).  I
can't see any reason to keep this as a PRInt64 since it doesn't buy us any
useful overflow protection... so I changed it to be a PRIntervalTime.

If you think this is risky in some way for 1.5, I can make a version of this
that just fixes the ResumeTimeouts problem.
Attachment #193891 - Flags: superreview?(jst)
Attachment #193891 - Flags: review?(jst)
Attachment #193757 - Flags: approval1.8b4? → approval1.8b4+
Comment on attachment 193757 [details] [diff] [review]
patch

Checked in on the branch.  I'm not closing the bug or marking it fixed1.8 until
the second patch is addressed.
Whiteboard: [needs review+SR jst]
Comment on attachment 193891 [details] [diff] [review]
additional patch

r+sr=jst
Attachment #193891 - Flags: superreview?(jst)
Attachment #193891 - Flags: superreview+
Attachment #193891 - Flags: review?(jst)
Attachment #193891 - Flags: review+
Comment on attachment 193891 [details] [diff] [review]
additional patch

checked in on the trunk, requesting branch approval.
Attachment #193891 - Flags: approval1.8b4?
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Again, thanks for the hard work on this, I noticed on tinderbox that the fix for
the ticker's very long end of line pauses has been checked in, and I can confirm
it works as expected on the latest trunk build, however, it seems the original
bug has arisen again, navigating forwards or backwards when the ticker has
half-printed its line causes the ticker to stop.

if anyone can confirm, feel free to re-open.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050831
Firefox/1.6a1
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b4) Gecko/20050830
Firefox/1.0+ ID:2005083023
this was checked in on branch 2005-08-26 16:05
verified fixed on branch
kwd->fixed1.8
Keywords: fixed1.8
confirmed regression
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
There were two problems with the last patch:

1. mWhen is now unsigned, so we need to change the way we cap off mWhen if the
timeout was supposed to have already fired when we suspend it.
2. DOM_MIN_TIMEOUT_VALUE is in milliseconds, so it needs to be compared against
the output of PR_IntervalToMilliseconds, not the input to it.
Attachment #194448 - Flags: superreview?(jst)
Attachment #194448 - Flags: review?(jst)
Comment on attachment 194448 [details] [diff] [review]
fix a couple of problems with the last patch

r+sr=jst
Attachment #194448 - Flags: superreview?(jst)
Attachment #194448 - Flags: superreview+
Attachment #194448 - Flags: review?(jst)
Attachment #194448 - Flags: review+
checked in on the trunk
Status: REOPENED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → FIXED
This combines the last two patches
Attachment #194468 - Flags: approval1.8b4?
Attachment #193891 - Flags: approval1.8b4?
verified on trunk with: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.9a1) Gecko/20050901 Firefox/1.6a1
Status: RESOLVED → VERIFIED
Comment on attachment 194468 [details] [diff] [review]
combined patch for the branch

Please file a followup bug to get rid of < (formerly LL_CMP) comparisons of
mWhen to now or deadline.

The TIMER_LESS_THAN macro from xpcom/threads/nsTimerImpl.h and related macros
should be copied or moved to a common place, and the maximum delay constrained
to be < DELAY_INTERVAL_LIMIT.

This allows wrap-safe testing of whether one PRIntervalTime denotes a time
prior to another PRIntervalTime.

/be
Attachment #194468 - Flags: approval1.8b4? → approval1.8b4+
Filed bug 306759 on the wrapping.
Checked in all of the patches on the branch (fixed1.8 already there, maybe 
should have been taken off when the bug was reopened).
verified on Firefox 1.4 -mozilla1.8 branch- Win, Lin and Mac : 2005-09-07
Keywords: fixed1.8verified1.8
Keywords: qawanted
Component: History: Session → Document Navigation
QA Contact: history.session → docshell
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: