URLs for internal links are constructed wrongly when there is a <base> tag




3 years ago
3 years ago


(Reporter: gareth.adamson, Unassigned)


46 Branch

Firefox Tracking Flags

(Not tracked)



(1 attachment)



3 years ago
Created attachment 8761210 [details]

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
Build ID: 20160502172042

Steps to reproduce:

Clicked an internal link (<a href="#m_-8912122876563913334_1" ... ) on page which had a <base> tag in its header. (<base href="https://mail.google.com/mail/h/1tr54oypn5vq9/">)

Actual results:

The browser moved to the page specified in the base tag (a different page).

I noticed that when I hovered over the link, the URL was constructed using the URL in the base tag, as if it were a local link rather than an internal one.

Expected results:

The browser should have moved to the corresponding anchor on the same page.

(<a name="m_-8912122876563913334_1" ... )


3 years ago
Attachment #8761210 - Attachment mime type: text/plain → text/html


3 years ago
Component: Untriaged → DOM
Product: Firefox → Core
Boris, WDYT?
Flags: needinfo?(bzbarsky)
Whiteboard: btpp-followup-2016-06-15
> The browser moved to the page specified in the base tag (a different page).

Yes, that's the correct behavior per spec and I believe interoperably implemented across all browsers...
Last Resolved: 3 years ago
Flags: needinfo?(bzbarsky)
Resolution: --- → INVALID
Whiteboard: btpp-followup-2016-06-15

Comment 3

3 years ago
This is not correct, and is not the behaviour when the same page is tested on Internet Explorer.

The standard states:

When present, the BASE element must appear in the HEAD section of an HTML document, before any element that refers to an external source.


Note this only refers to elements with an *external* source. An link to an anchor on the same page does not refer to an external source.

If this is the behaviour per Firefox spec, then the Firefox spec implements the HTML standard wrongly.

Comment 5

3 years ago
OK, I'm convinced! Thanks for taking the trouble.

Now attempting to report as a bug to Google...
I hope you mean Microsoft, if you're reporting the Internet Explorer bug...

Comment 7

3 years ago
I don't really use Explorer, and I'm not sure what it's doing. It might be more of a tolerance than a bug. The page you referred me didn't strike me as a model of clarity, and it's a changed behaviour which might break many old pages, so perhaps Explorer has a heuristic to interpret it either way, depending.

No, I meant reporting the faulty construction of conversation pages in Gmail.

IF it gets fixed and IF that then breaks Gmail in Explorer, someone may report it. Unlikely to be me, though.

I also now tested in Chrome, which behaves the same way as Firefox. So Gmail doesn't work properly in Chrome. That might convince them it's a bug!
You need to log in before you can comment on or make changes to this bug.