Empty href for favicon link element causes page to be fetched twice
Reported by
greg.f...@gmail.com,
Nov 29 2016
|
||||||
Issue descriptionUserAgent: 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
,
Nov 29 2016
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.
,
Dec 1 2016
,
Dec 4 2016
I haven't made any changes to third_party/WebKit/Source/ yet - would like to try tackling this bug if possible.
,
Dec 6 2016
Was able to confirm on Ubuntu as well.
,
Dec 7 2016
Weird, the second request shows up in the Network panel of the inspector but it doesn't show up when I call performance.getEntries().
,
Dec 12 2016
,
Dec 14 2016
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.
,
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
,
Dec 15 2016
Close as fixed. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by ellyjo...@chromium.org
, Nov 29 2016Status: Untriaged (was: Unconfirmed)