Closed Bug 298291 Opened 20 years ago Closed 20 years ago

Anchor information does not append to URL after navigating to an anchor

Categories

(Camino Graveyard :: Location Bar & Autocomplete, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino0.9

People

(Reporter: signups, Assigned: sfraser_bugs)

References

()

Details

(Keywords: regression)

User-Agent:       Mozilla/4.0 (compatible; MSIE 5.2; Mac_PowerPC)
Build Identifier: 2005062008 (0.9a1)

After clicking on an anchor link within a page, the url does not change to
correctly represent the correct url path.  This makes it impossible to copy the
url with the correct anchor information so that it can be pasted or sent to others.

Reproducible: Always

Steps to Reproduce:
1.Go to the webpage indicated above.
2. Click on "Directions" it is an anchor within the page
3.

Actual Results:  
Described above

Expected Results:  
Described above
Well, this is sure odd. Temporary workaround: After clicking the link and moving
to the anchor, click in the location field and press escape; the correct URL
will show up.

->NEW
Status: UNCONFIRMED → NEW
Ever confirmed: true
Is this a dupe of bug 149817?  smfr notes that bug affects session history  and
bookmarks; is the location bar part of session history?

An additional work-around is to switch tabs and return to the original one.
(In reply to comment #2)
> Is this a dupe of bug 149817?  smfr notes that bug affects session history  and
> bookmarks; is the location bar part of session history?
> 
> An additional work-around is to switch tabs and return to the original one.

I don't think it's the same; I can't reproduce that one.
is this a regression?
(In reply to comment #4)
> is this a regression?

Yep.  Worked in 0.8.4 (after a slight delay to post the anchor part)
Keywords: regression
Flags: camino0.9? → camino0.9+
Target Milestone: --- → Camino0.9
Assignee: pinkerton → sfraser_bugs
This happened because of an over-zealous null check on the nsIRequest.

Patch:

Index: CHBrowserListener.mm
===================================================================
RCS file: /cvsroot/mozilla/camino/src/embedding/CHBrowserListener.mm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- CHBrowserListener.mm	26 May 2005 04:32:26 -0000	1.17
+++ CHBrowserListener.mm	28 Jun 2005 03:43:09 -0000	1.18
@@ -600,7 +600,7 @@
 CHBrowserListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest
*aRequest, 
                                           nsIURI *aLocation)
 {
-  if (!aLocation || !aWebProgress || !aRequest)
+  if (!aLocation || !aWebProgress)
     return NS_ERROR_FAILURE;
 
   // only pay attention to location change for our nsIDOMWindow
@@ -610,9 +610,13 @@
   if (windowForProgress != ourWindow)
     return NS_OK;
 
-  nsresult requestStatus = NS_OK;
-  aRequest->GetStatus(&requestStatus);
-  BOOL requestOK = NS_SUCCEEDED(requestStatus);
+  BOOL requestOK = YES;
+  if (aRequest)  // aRequest can be null (e.g. for relative anchors)
+  {
+    nsresult requestStatus = NS_OK;
+    aRequest->GetStatus(&requestStatus);
+    requestOK = NS_SUCCEEDED(requestStatus);
+  }
   
   nsCAutoString spec;
   aLocation->GetSpec(spec);

Checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
*** Bug 300341 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.