Bug 68490 - [Intro] browser navigation not working properly
Summary: [Intro] browser navigation not working properly
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 RC4   Edit
Assignee: Mazen Faraj CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-24 11:50 EDT by Kim Kelley CLA Friend
Modified: 2005-10-03 11:47 EDT (History)
4 users (show)

See Also:


Attachments
fix for setText events (1.40 KB, patch)
2004-06-24 17:48 EDT, Mazen Faraj CLA Friend
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kim Kelley CLA Friend 2004-06-24 11:50:47 EDT
The first time the intro is opened, both the "Home" and "Back" navigation
buttons are enabled.  Selecting "Back" just reloads the home page, since I
haven't visited any other pages yet.  

After the intro is initially loaded, if I browse to a new page and then hit
"back" to return to the previous page, I don't actually go back (I remain on the
current page).  Also, the "Forward" button is suddenly enabled, even though it
shouldn't be since I haven't actually left the current page.  I have to hit
"Back" a second time in order to truly get back to the previous page.
Comment 1 Mazen Faraj CLA Friend 2004-06-24 14:03:11 EDT
reproduced with RC4 :( 
regression bug. 
Im investigating. 
Comment 2 Mazen Faraj CLA Friend 2004-06-24 17:34:59 EDT
This is a regression bug introduced by a change of behavior in the SWT Browser.
It seems to have been introduced in RC3.

Browser.setText() used to fire one navigation event, with url = "about:blank", 
and then display the in memory text.
Now, it fires one more navigation event before the blank one. url = 
res://C:\WINDOWS\System32\shdoclc.dll/navcancl.htm

This url was being treated as a regular url and so it was cached in the 
history of CustomizableIntroPart. 

The fix is to filter out urls with no protocol. 

patch forthcoming...
Comment 3 Mazen Faraj CLA Friend 2004-06-24 17:37:14 EDT
adding Chris for confirmation of change of behavior...

Chris.. can you please confirm change of behavior.
thanks
Comment 4 Mazen Faraj CLA Friend 2004-06-24 17:48:55 EDT
Created attachment 12814 [details]
fix for setText events
Comment 5 Dejan Glozic CLA Friend 2004-06-24 18:00:46 EDT
I verified that the patch works.
Comment 6 Lorne Parsons CLA Friend 2004-06-24 18:09:16 EDT
I hope this doesn't filter out file:///, if so will cause us some problems when 
using static HTML pages from the filesystem?
Comment 7 Christophe Cornu CLA Friend 2004-06-24 18:51:53 EDT
In response to comment 3
The change of behaviour on Windows is the result of the fix for bug 66813 
(calling setText twice) v>20040617. setText now requests IE to stop any 
previous network requests. This can cause IE to go to this URL before rendering 
the HTML in memory.
res://C:\WINDOWS\System32\shdoclc.dll/navcancl.htm


Comment 8 Dejan Glozic CLA Friend 2004-06-24 18:55:15 EDT
Will this patch have a problem with other non-IE browsers?
Comment 9 Dejan Glozic CLA Friend 2004-06-24 18:59:11 EDT
In response to Lorne's comment #6, 'file' is a valid protocol, so it should 
not be affected by this. Mazen, am I correct?
Comment 10 Dejan Glozic CLA Friend 2004-06-24 19:13:44 EDT
Fixed.
Comment 11 Mazen Faraj CLA Friend 2004-06-24 19:19:19 EDT
I just read these updates...

In response to comment 7 :
thanks Chris.. I never got a chance to verify the defect because I actually 
worked around it, and your response got burried in my emails ! 

In response to comment 6 : 
yes we are broken.. but the patch will not affect this defect for now since we 
are broken. Just to clairfy: what is broken is the following scenario: 
navigating to a static html page from a dynamic page works. Navigate back 
works. Now navigate forward to the html page again fails. History skips page. 
This can be addressed in a fixpack.

In response to comment 9 : 
Absolutely Dejan. file _is_ a protocol.. but setting the url in the SWT 
browser to file:///c:\test.html gives you a url navigation event without the 
file protocol. This is actually the cause of our defect above. 
This is defect 59497 to which I opened a defect 66887 and it fell through the 
Intro audits !!



Comment 12 Christophe Cornu CLA Friend 2004-06-24 19:37:50 EDT
Are you building your custom history list based on URLs received from 
LocationListener.changing events?

If so, have you tried building the intro history list based on 
LocationListener.changed events instead? 

LocationListener.changing is mostly for filtering and blocking navigation 
before they happen. They can represent navigation requests that never complete 
and should not be part of a history. 
LocationListener.changed is fired after the navigation to that new location was 
successful - this is the right place to update the back/forward buttons.

res://C:\WINDOWS\System32\shdoclc.dll/navcancl.htm
is emitted in LocationListener.changing, but not in LocationListener.changed on 
the windows systems I have been testing. Building the history on the 
LocationListener.changed notification is preferable. If it is not in your case, 
let me know. I can't judge if this is a safer change at this point for 
tonight's build.
Comment 13 Dejan Glozic CLA Friend 2004-06-24 19:42:34 EDT
This may very well be the right way but we don't have any runaway to test 
possible issues so I would rather that we keep the workaround for now and try 
to use 'changed' in a fixpack.
Comment 14 Mazen Faraj CLA Friend 2004-06-24 21:41:26 EDT
Chris,
yes, the history list is being updated based on urls Im getting from the 
changing event. Using the changed event will most probably solve this defect, 
but it will introduce another defect in the way the intro code today handles 
navigating to an html page that has frames.  
The Intro code today does use a flag to filter out events genereted due to 
frame navigation. A LocationListener sets the flag to true to indicate the 
begining of the navigation. A ProgressListener sets this flag to false on a 
completed event. This was the only handshaking that I can think of at the time 
to filter out all frames nicely. This logic will be broken if we use the 
changed event, and even if we do fix it and use changed, we would still need 
this flag trick. (ps: please let me know if there is a more proper way of 
filtering redundant navigations. 

As for the real remaing defect, which is not getting a protocol from the url 
passed by the location listerner, this also would not be solved by using 
changed event as the url is still without a protocol. 

I can most probably work around this problem and we'll address this in defect 
66887 , but I need to know that having no protocol is the proper design. I 
didint want to work around a defect. 

this defect is closed. 

ps: discussion continues in defect 6687 

 

Comment 15 Mazen Faraj CLA Friend 2004-06-24 21:44:20 EDT
ps: discussion continues in bug 66887 
Comment 16 Kim Kelley CLA Friend 2004-06-24 22:58:36 EDT
just to clarify the part of comment 11 which was a response to comment 6 :)
"what is broken is the following scenario: navigating to a static html page from
a dynamic page works. Navigate back works. Now navigate forward to the html page
again fails. History skips page. "

It seems that more is broken than this. With the patch applied, if you browse
immediately from a dynamic page to a static page, you are stuck there
permanently.  You can't go back, you can't go forward, and you can't go home
(the home button doesn't do anything).  You have to close the intro and re-open
it.  To test this, run the the intro.samples intro from twix, and click on the
"Static page sample" when the intro comes up.