If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

nsISHistoryListener::OnHistoryGotoIndex() isn't called when the abs(current index - goToIndex) <= 1

VERIFIED FIXED in mozilla0.9.5

Status

()

Core
Embedding: APIs
P3
normal
VERIFIED FIXED
16 years ago
16 years ago

People

(Reporter: David Epstein, Assigned: Radha on family leave (not reading bugmail))

Tracking

Trunk
mozilla0.9.5
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
1. cd ../mozilla/dist/WIN32_D.OBJ/bin
2. launch testembed.exe
(you can interchange steps 3 & 4: same result)
3. Select Tests > Add History Listener
4. Enter a url.
5. Select Tools > Test Your Method; 
or Interfaces > nsIWebNav and run through nsIWebNavitation::GotoIndex() test.
6. Check TestOutput.txt logfile in C:/Temp folder. Also display prompt.

Result: Indicates that nsISHistoryListener::OnHistoryGoBack(). If index for
GotoIndex()test is greater than current index, we get
nsISHistoryListener::OnHistoryGoForward().

Expected: History listener should call nsISHistoryListener::OnHistoryGotoIndex().

Note: GotoIndex() navigation is working OK.

Logfile contents:

TestEmbed started up.
nsIWebBrowserChrome::SetWebBrowser().
AddWebBrowserListener(). Add History Lstnr test passed.
nsIHistoryListener::OnHistoryNewEntry()
nsIURI::GetSpec() test passed.
the uri = http://www.nokia.com/main.html
nsIHistoryListener::OnHistoryGoBack()
nsIURI::GetSpec() test passed.
the uri = http://www.netscape.com/
OnHistoryGoBack() notification = 1
GotoIndex() test passed.
TestEmbed shut down.
onHistoryGotoIndex() is working. Please see the JS testcase that is up in
http://bubblegum. I do get callbacks in onHistorygotoIndex().
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → WORKSFORME
(Reporter)

Comment 2

16 years ago
Change qa contact to depstein. Reopening this bug after changing the summary to
more accurately reflect the problem. nsISHistoryListener::OnHistoryGotoIndex()
is called when the difference between the current and the navigated index is
greater than 1. So if 3 urls have been loaded, and index = 0 inside goToIndex(),
then the listener method will be called; but not when index = 2 or 4. In
testEmbed, the goToIndex() is set to 0, so after running the nsIWebNav
goForward() test, it will call nsISHistoryListener::OnHistoryGoBack().
Status: RESOLVED → REOPENED
QA Contact: mdunn → depstein
Resolution: WORKSFORME → ---
Summary: nsISHistoryListener::OnHistoryGotoIndex() isn't called for GotoIndex() → nsISHistoryListener::OnHistoryGotoIndex() isn't called when the abs(current index - goToIndex) <= 1
Created attachment 49235 [details] [diff] [review]
patch to nsSHistory.cpp
Status: REOPENED → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9.5

Comment 4

16 years ago
r=mcafee

Comment 5

16 years ago
Comment on attachment 49235 [details] [diff] [review]
patch to nsSHistory.cpp

sr=alecf
Attachment #49235 - Flags: superreview+
Fix checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 16 years ago16 years ago
Resolution: --- → FIXED
(Reporter)

Comment 7

16 years ago
nsISHistoryListener::OnHistoryGotoIndex()is called, but the index of the last
url is always passed to it, not the true value from GoToIndex(). So if we load 3
urls, and the index is set to 0, it still passes 2 to OnHistoryGotoIndex(). I'll
verify this one as fixed and will investigate this other one.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.