Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The "onerror" handler for the SVG image that aims at replacing the image with a PNG version created an infinite loop in the (unlikely, granted) event when there are transient network troubles (due to the server or the connection) after the spec has been retrieved but before the SVG image has been retrieved.
In such a scenario, the fetch on the image would trigger the handler, which would change the image source to the URL of the PNG image, which would trigger another fetch, which would trigger the handler, which would change the source to the same value but that's enough to trigger another fetch, etc.
This fix only changes the source URL once.
Actually, the scenario that more directly affects me is that of a crawling tool that wants to render the spec in a headless browser while avoiding unnecessary network requests (typically those on images): the headless browser would keep on issuing network requests, and fail to report that the spec seems "done loading".
The same problem exists on the Magnetometer spec. If that solution works here, I'll create the same pull request there...
Preview | Diff