<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.
This was reverted again, https://commits.webkit.org/254213@main
aa.com has this markup:
<link rel="stylesheet" href="/booking/resources/styles.6eed4fecbbccb98e596b.css" media="all" onload="this.media='all'">
cbsnews.com also has this markup:
<link rel="stylesheet" href="/fly/bundles/cbsnewscontent/css/responsive.min.css?v=8bc2e0f78408a4b8086da85d60d8c0a5" media="print" onload="this.media='all'">
I guess this is some kind of a pattern used by some framework / library.
Pull request: https://github.com/WebKit/WebKit/pull/4123
(In reply to Ryosuke Niwa from comment #17)
> aa.com has this markup:
> <link rel="stylesheet"
> href="/booking/resources/styles.6eed4fecbbccb98e596b.css" media="all"
> cbsnews.com also has this markup:
> <link rel="stylesheet"
> css?v=8bc2e0f78408a4b8086da85d60d8c0a5" media="print"
> I guess this is some kind of a pattern used by some framework / library.
I raised similar bug where the website was flashing and it has similar "onload..." as Bug 244154.
If Bug 244154 is indeed because of this bug, we can mark the other as "DUPLICATE OF" bug. Just wanted to confirm. Thanks!
Committed 254290@main (3775c2edb230): <https://commits.webkit.org/254290@main>
Reviewed commits have been landed. Closing PR #4123 and removing active labels.
*** Bug 245133 has been marked as a duplicate of this bug. ***