Use existing external resource for <use> while revalidating #20150
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.
When we load a previously cached resource for <use> and it requires
revalidation - and an earlier <use> that references the same resource
hasn't yet generated its shadow tree - we could end up failing to
generate a shadow tree for the the "first" <use> since the resource
appears to be "invalid" while the revalidation is in progress. This
"first" <use> would then not be invalidated when the revalidation
completes.
Consider the resource to be valid while revalidating if it has a
Document already - meaning it has previously finished loading and
successfully parsed a document. This means the "first" <use> might end
up being stale until it's invalidated if the revalidation returned a
newer version of the resource - which is wrong but arguably better than
failing to display at all like was the case previously. (This should
also be consistent with how other types of resources are handled in
cases like this.)
Bug: 593261, 1021530
Change-Id: I9d68a1a60685757a990c2ec811c5ca53afc4fb25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1903200
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716678}