New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 669351 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Dec 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Compat



Sign in to add a comment

Empty href for favicon link element causes page to be fetched twice

Reported by greg.f...@gmail.com, Nov 29 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. Add the following code to the <head> of a page:
<link rel="icon" type="image/ico" href="" />

2.  Open the network panel of the dev console

3. Load the page.

Note that shortly after the page load completes you will see a second GET request for the original page.

Changing the href to a valid favicon or even a URI that returns 404 prevents the problem from occuring.

What is the expected behavior?
If the href on favicon <link> is empty Chrome should not fetch anything.

What went wrong?
While our GET page loads are idempotent, we did see a significant increase in database calls on pages that personalise content, show shopping cart details etc.

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? No
 Internet Explorer

Chrome version: 54.0.2840.98  Channel: stable
OS Version: OS X 10.12.0
Flash Version: Shockwave Flash 23.0 r0
 
Components: Blink
Status: Untriaged (was: Unconfirmed)
mac triage:

I reproduced this locally using this test page:

<html>
 <head>
  <link rel="icon" type="image/ico" href="" />
 </head>
</html>

On the server side I see:

127.0.0.1 GET /index.html
127.0.0.1 GET /index.html

But if I have no favicon at all like this:

<html>
 <head>
  <!-- <link rel="icon" type="image/ico" href="" /> -->
 </head>
</html>

I see:

127.0.0.1 GET /index.html
127.0.0.1 GET /favicon.ico

So, I think chromium is resolving the href="" relative to the page it's being referenced from. It's odd that we allow this at all.

Sending this bug over to blink team for triage.

Comment 2 by rbyers@chromium.org, Nov 29 2016

Components: -Blink Blink>HTML>Link
HTML spec is clear that empty hrefs should be ignored: https://html.spec.whatwg.org/multipage/semantics.html#the-link-element:
"The destination of the link(s) is given by the href attribute, which must be present and must contain a valid non-empty URL potentially surrounded by spaces. If the href attribute is absent, then the element does not define a link.
...
If the href attribute's value is the empty string, then abort these steps."

Most of the favicon handling is in the browser, but since this is html semantics, there's probably a bug to be fixed in blink's html handling.

Comment 3 by tkent@chromium.org, Dec 1 2016

Labels: Hotlist-GoodFirstBug
Status: Available (was: Untriaged)
I haven't made any changes to third_party/WebKit/Source/ yet - would like to try tackling this bug if possible.
Was able to confirm on Ubuntu as well.
Weird, the second request shows up in the Network panel of the inspector but it doesn't show up when I call performance.getEntries().

Comment 7 by l...@chromium.org, Dec 12 2016

Owner: jeffcarp@chromium.org
Status: Assigned (was: Available)
Owner: l...@chromium.org
Hey +lpy@chromium.org I have a bunch of other stuff coming up this week, do you want to take this? I can find another GoodFirstBug.
Project Member

Comment 9 by bugdroid1@chromium.org, Dec 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/24d87e2f1a18e9cc58a37126b85c921ea37ba695

commit 24d87e2f1a18e9cc58a37126b85c921ea37ba695
Author: lpy <lpy@chromium.org>
Date: Thu Dec 15 05:54:47 2016

Fix empty href for favicon link element causing page to be fetched twice.

Accroding to HTML spec
https://html.spec.whatwg.org/multipage/semantics.html#the-link-element, if the
href attribute in link element is empty, then the element does not define a link
and should be ignored.

BUG= 669351 

Review-Url: https://codereview.chromium.org/2575273002
Cr-Commit-Position: refs/heads/master@{#438762}

[modify] https://crrev.com/24d87e2f1a18e9cc58a37126b85c921ea37ba695/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/24d87e2f1a18e9cc58a37126b85c921ea37ba695/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
[add] https://crrev.com/24d87e2f1a18e9cc58a37126b85c921ea37ba695/third_party/WebKit/Source/core/html/HTMLLinkElementTest.cpp

Comment 10 by l...@chromium.org, Dec 15 2016

Status: Fixed (was: Assigned)
Close as fixed.

Sign in to add a comment