Bug 35412 - 2.1 RC3; Searh result not loaded/highlighted when browser already opened
Summary: 2.1 RC3; Searh result not loaded/highlighted when browser already opened
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 2.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 2.1 RC4   Edit
Assignee: Konrad Kolosowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-20 16:24 EST by Wassim Melhem CLA
Modified: 2003-03-27 11:42 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wassim Melhem CLA 2003-03-20 16:24:50 EST
RedHat 8.0, Mozilla 1.0.1, Eclipse 2.1 RC3 build.

Performing search from the workbench, and double clicking result opens help,
shows search results in search view, highlight selected topic in the list and
display the topic on the right.  An example of URL displayed in the address is:
http://127.0.0.1:33524/help/index.jsp?tab=search&searchWord=%6a%61%76%61&maxHits=500&lang=en_US&fieldSearch=false&topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fhelp_infocenter.html%3Fresultof%3D%2522%256a%2561%2576%2561%2522%2520

Doing the same when browser (mozilla) is already opened results in results being
shown, but the selected topic is not highlighted in the list.  It is not shown
in the content area either (welcome page is displayed).  The URL for the same
hit is displayed by Mozilla as:
http://127.0.0.1:33524/help/index.jsp?tab=search&searchWord=java&maxHits=500&lang=en_US&fieldSearch=false&topic=/org.eclipse.platform.doc.isv/reference/misc/help_infocenter.html?resultof=%22%6a%61%76%61%22%20
which is different then the URL before.  The encoded parameters are somewhat
corrupted.
Comment 1 Konrad Kolosowski CLA 2003-03-20 17:53:57 EST
Sorry Wassim, I think this bug was reported by me, but bugzilla does not let me 
change the reported.

The problem affects Mozilla, but not Netscape 4.
It was introduced in M5 build, with the code for bug 23750 that is intended to 
go around Mozilla bug that does not restore Mozilla from minimized.  We should 
see whether the workaround can be fixed, or consider backing it out as I think 
this bug is more important than 23750 one.
Comment 2 Konrad Kolosowski CLA 2003-03-21 13:59:31 EST
This problem will be more pronounced with search for DBCS words.  The search 
word is encoded in the URL and that would be corrupted.

Rather than completely removing the workaround for bug 23750 to fix this 
problem with Mozilla it is possible to restored the code to open a browser to 
its original state (pre M5) and place the window.focus() javascript call in our 
index.jsp.  It has the same effect on Mozilla - it restores it from minimized, 
without affecting how the browser opens.

The 2 patches to apply to RC3a are:


Index: MozillaBrowserAdapter.java
===================================================================
RCS 
file: /home/eclipse/org.eclipse.help/src/org/eclipse/help/internal/browser/Mozil
laBrowserAdapter.java,v
retrieving revision 1.5
diff -u -r1.5 MozillaBrowserAdapter.java
--- MozillaBrowserAdapter.java	11 Mar 2003 20:38:34 -0000	1.5
+++ MozillaBrowserAdapter.java	21 Mar 2003 18:48:04 -0000
@@ -210,12 +210,7 @@
 			waitForBrowser();
 			if (exitRequested)
 				return;
-			//workaround for bug 23750, mozilla bug 159092
-			// instead of simply -remote openURL(" + url + ")", 
call a javascript
-			if (openBrowser(executable
-				+ " -remote openURL(javascript:window.focus
();window.location=\'"
-				+ url
-				+ "\')")
+			if (openBrowser(executable + " -remote openURL(" + url 
+ ")")
 				== 0) {
 				return;
 			}


Index: index.jsp
===================================================================
RCS file: /home/eclipse/org.eclipse.help.webapp/advanced/index.jsp,v
retrieving revision 1.14
diff -u -r1.14 index.jsp
--- index.jsp	11 Mar 2003 22:05:33 -0000	1.14
+++ index.jsp	21 Mar 2003 18:48:36 -0000
@@ -37,6 +37,14 @@
 
 function onloadHandler(e)
 {
+<%
+if (data.isMozilla()){
+// restore mozilla from minimized
+%>
+	window.focus();
+<%
+}
+%>
 	window.frames["SearchFrame"].document.getElementById("searchWord").focus
();
 }
 



The patch is very safe, as it does not affect Windows in any way, it will 
restore Netscape launching code to the original state, and the line of code 
added to index.jsp will only run on Mozilla (that has the problem).

Please review and approve for releasing into RC4.
Comment 3 Dorian Birsan CLA 2003-03-21 14:06:10 EST
I did a code review and tests with the proposed fixed and find it safe for 
releasing into RC4. It is an important fix to have for the Linux platform and 
recommend having it fixed in RC4.
Comment 4 Dejan Glozic CLA 2003-03-21 14:38:12 EST
Approved for fixing for RC4.
Comment 5 Dorian Birsan CLA 2003-03-21 14:58:25 EST
Since the patch may look a bit unreadable, what the fix is doing is:
replacing the command:

mozilla -remote openURL(javascript:window.focus();window.location=help_url)

by

mozilla -remote openURL(help_url)

and moving the window.focus() inside the url that we open (i.e. inside the 
index.jsp file).


Comment 6 Jeff McAffer CLA 2003-03-24 15:30:12 EST
+1
Comment 7 Konrad Kolosowski CLA 2003-03-24 15:49:38 EST
Fixed.
Comment 8 Konrad Kolosowski CLA 2003-03-27 11:42:46 EST
Verified using I20030326 build.