<link> elements should be able to fire more than one load / error event.
Created attachment 442494 [details]
Comment on attachment 442494 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=442494&action=review
> + We had logic to only fire a single load / error event for <link> elements, even
> + though they could do several loads. This logic is not part of the specification
> + and was causing us to fail some WPT tests.
I remember that such booleans, long ago, were used to work around various bugs. However that’s a really old memory, more like 15 years ago. I hope this is no longer the case, and this doesn’t re-expose a bug in some case.
Committed r284883 (243560@main): <https://commits.webkit.org/243560@main>
All reviewed patches have been landed. Closing bug and clearing flags on attachment 442494 [details].
I have a problem for this change.
Bug 232691 – REGRESSION(r284883): load event of link element is fired repeatedly on https://cmake.org/
Reverted r284883 for reason:
Caused high energy use on wsj.com <rdar://85156874>
Committed r285417 (243974@main): <https://commits.webkit.org/243974@main>
*** Bug 232691 has been marked as a duplicate of this bug. ***
I am not sure on web-spec but it seems Safari and Chrome are still failing these tests:
Just wanted to share updated results. Thanks!
Maybe we need to modify the spec to mandate this behavior if wsj.com and other websites are relying on the current behavior of WebKit.
https://www.wsj.com/ has the code like this:
> <link href="https://video-api.wsj.com/api-video/audio/css/audioplayer.min.css" rel="preload" as="style" onload="this.rel='stylesheet'">
I don't know why changing 'rel' attribute should fire infinite load events.
Given that, it looks like we might have avoided the high energy use at wsj.com if changing the value of the 'rel' attribute caused a new load only if the value is a different one. I wonder if it’s a mistake that re-setting the 'rel' attribute to the same value triggers a load.
Gecko & Chrome don't seem to reload when setting rel to stylesheet (same value) so that might be the fix.
Pull request: https://github.com/WebKit/WebKit/pull/2805
Filed https://github.com/whatwg/html/issues/8138 to track the issue with the HTML spec.
Committed 252943@main (a697ed80d982): <https://commits.webkit.org/252943@main>
Reviewed commits have been landed. Closing PR #2805 and removing active labels.