Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web reality: Load/error events for <link> not firing on rel="icon" #6122

Closed
andreubotella opened this issue Nov 4, 2020 · 1 comment · Fixed by #6156
Closed

Web reality: Load/error events for <link> not firing on rel="icon" #6122

andreubotella opened this issue Nov 4, 2020 · 1 comment · Fixed by #6156

Comments

@andreubotella
Copy link
Member

andreubotella commented Nov 4, 2020

While trying to write some tests for #3483, I noticed that per the spec <link rel="icon"> should fire a load or error event, but none of the major browsers implement this, even when the icon is showing in the browser chrome.

By the spec, the default process the linked resource algorithm fires the load and error events, but that algorithm only runs if all of these conditions hold:

  • the <link> element represents an external resource link
  • the link type defines an appropriate time to fetch and process the linked resource (presumably rel="icon"'s "should be used by the user agent when representing the page in the user interface" counts here)
  • the link type doesn't override the fetch and process the linked resource algorithm (since it calls process the linked resource)
  • the link type doesn't override the process the linked resource algorithm

The only currently defined link type that fulfills all of those conditions is rel="icon", so it might be best to make the default process the linked resource algorithm a noop, though I'd be fine with defining custom process the linked resource steps for rel="icon". Other link types that fire the load and error events, such as rel="stylesheet" and rel="prefetch", do so in their overriden "process the linked resource" algorithms, and so aren't affected.

See also web-platform-tests/wpt#21352, which points out the lack of tests.

@domenic
Copy link
Member

domenic commented Nov 4, 2020

Great find.

Upon reflection, I think making the default steps a no-op is probably best. Most links will need custom handling, and so the default steps don't buy us much.

/cc @domfarolino

andreubotella pushed a commit to andreubotella/html that referenced this issue Nov 17, 2020
This removes the requirement for <link rel="icon"> to fire load and
error events, which no implementation followed.

Closes whatwg#6122.
domenic pushed a commit to web-platform-tests/wpt that referenced this issue Nov 18, 2020
domenic pushed a commit that referenced this issue Nov 18, 2020
This removes the requirement for <link rel="icon"> to fire load and
error events, which no implementation followed.

Closes #6122.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Nov 26, 2020
…or <link rel="icon">, a=testonly

Automatic update from web-platform-tests
Test that no load or error events fire for <link rel="icon">

Test for whatwg/html#6122.
--

wpt-commits: 43cb8f728ebfd5f312200d18bbe718fea62c1442
wpt-pr: 26557
sidvishnoi pushed a commit to sidvishnoi/gecko-webmonetization that referenced this issue Nov 27, 2020
…or <link rel="icon">, a=testonly

Automatic update from web-platform-tests
Test that no load or error events fire for <link rel="icon">

Test for whatwg/html#6122.
--

wpt-commits: 43cb8f728ebfd5f312200d18bbe718fea62c1442
wpt-pr: 26557
sylvestre pushed a commit to sylvestre/gecko-dev that referenced this issue Nov 28, 2020
…or <link rel="icon">, a=testonly

Automatic update from web-platform-tests
Test that no load or error events fire for <link rel="icon">

Test for whatwg/html#6122.
--

wpt-commits: 43cb8f728ebfd5f312200d18bbe718fea62c1442
wpt-pr: 26557
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants