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

HTMLLinkElement load emit timing #1227

Merged
merged 3 commits into from
Jun 25, 2019
Merged

HTMLLinkElement load emit timing #1227

merged 3 commits into from
Jun 25, 2019

Conversation

avaer
Copy link
Member

@avaer avaer commented Jun 25, 2019

This case was not properly triggering load events:

const link = document.createElement('link');
link.href = 'https://fonts.googleapis.com/css?family=Source+Code+Pro';
link.rel = 'stylesheet';
link.onload = () => {
  console.log('got load');
];

This was mainly because of the "run html" flow for HTMLLinkElement, which handled things synchronously on attribute set rather than working on the defer-emits-to-document-load model like HTMLScriptElement.

This PR makes HTMLLinkElement behave like HTMLScriptElement in that regard.

This was needed to boot cryptovoxels.

@avaer avaer merged commit 6b29bae into master Jun 25, 2019
@avaer avaer deleted the link-load branch June 25, 2019 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant