Bug 174554 - The anchor is ignored in this particular URL
Summary: The anchor is ignored in this particular URL
Status: RESOLVED MOVED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-15 19:54 PDT by Dan Jacobson
Modified: 2017-07-16 10:32 PDT (History)
3 users (show)

See Also:


Attachments
Test with a link to that URL (93 bytes, text/html)
2017-07-15 20:49 PDT, Brady Eidson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Jacobson 2017-07-15 19:54:56 PDT
$ /usr/lib/i386-linux-gnu/webkit2gtk-4.0/MiniBrowser https://bugzilla.mozilla.org/page.cgi?id=quicksearch.html#shortcuts
Or just enter it from the URL bar.

Anchor ignored!

You know anchors are as old as the web. They are basic. Hence a major bug.
Checking the bug database, they used to work, but not anymore.

Any fixes should also work for local file:/// 's , too, from the UNIX command line or from the URL bar.

libwebkit2gtk-4.0-37:
  Installed: 2.17.4-1
https://bugzilla.gnome.org/show_bug.cgi?id=784930
Comment 1 Dan Jacobson 2017-07-15 19:57:58 PDT
https://bugzilla.gnome.org/show_bug.cgi?id=784432
Comment 2 Brady Eidson 2017-07-15 20:45:58 PDT
Trying to navigate to this URL from the location field of any browser available to me (Chrome, Firefox, Safari), none of them scroll directly to the anchor.
Comment 3 Brady Eidson 2017-07-15 20:49:06 PDT
Created attachment 315583 [details]
Test with a link to that URL

Attaching an HTML file with a link to that URL

Opening this HTML file and then clicking that link also doesn't work in WebKit. But, it also doesn't work in any other browser.
Comment 4 Brady Eidson 2017-07-15 20:50:57 PDT
Also, anchors work fine in WebKit in general, so retitling this bug to make that clear.
Comment 5 Brady Eidson 2017-07-15 20:52:04 PDT
I'm guessing this is because in absolute URLs, once you start the query parameter with '?', any '#' after that is part of the query.

But then once you're on the page, clicking the "#shortcuts" link works fine because it's a relative URL, not absolute.

(This is a theory, checking the URL parser now)
Comment 6 Brady Eidson 2017-07-15 20:56:00 PDT
(In reply to Brady Eidson from comment #5)
> I'm guessing this is because in absolute URLs, once you start the query
> parameter with '?', any '#' after that is part of the query.
> 
> But then once you're on the page, clicking the "#shortcuts" link works fine
> because it's a relative URL, not absolute.
> 
> (This is a theory, checking the URL parser now)

This seems wrong. Hmmm. I dunno. It's probably not a coincidence that this also doesn't work in any other browser.

CC'ed Alex the URL guy.
Comment 7 Dan Jacobson 2017-07-15 20:59:32 PDT
Opens fine in the lynx and w3m. 

OK
http://jidanni.org/location/directions/index.html#chain
works OK in webkit.
file:///home/jidanni/jidanni.org/location/directions/index.html#chain
ends up with the #chain removed before processing.(Not by the shell.)
Comment 8 Michael Catanzaro 2017-07-16 04:28:52 PDT
(In reply to Brady Eidson from comment #4)
> Also, anchors work fine in WebKit in general, so retitling this bug to make
> that clear.

Anchors have been super broken in WebKitGTK+ for as long as I remember.
Comment 9 Dan Jacobson 2017-07-16 10:32:07 PDT
OK sorry. It must be due to some javascript in their page. So I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1381333 .