Closed Bug 1622532 Opened 4 years ago Closed 4 years ago

[wpt-sync] Sync PR 22260 - ImageLoader: Stop storing request KURL in Task

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 22260 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/22260
Details from upstream follow.

Dominic Farolino <dom@chromium.org> wrote:

ImageLoader: Stop storing request KURL in Task

This CL removes |ImageLoader::Task::request_url_| in favor of lazily
parsing the image request's absolute URL when ImageLoader::Task is run.

Currently ImageLoader::Task stores a KURL |request_url_|, which is a
snapshot of the image's absolute URL, parsed relative to the image
element's node document at the time ImageLoader::Task is queued.
We shouldn't have to store a snapshot of the parsed URL, because the
source URL at the time an ImageLoader::Task is run is the same as when
the task is queued.

The reason we stored a snapshot of the parsed URL is because what can
change in between when an ImageLoader::Task is queued and run, is the
document's base URL, via a \<base> element. In https://crbug.com/569760
a CL was landed that takes this snapshot, so that if a \<base> element
was dynamically-inserted before the ImageLoader::Task was run, the URL
would be unaffected by the addition of the \<base>. However, the spec
is very clear that the parsing of an image request's URL 1 happens
after the microtask is run, meaning our snapshot is unnecessary, and
incorrect.

This CL:

  • Removes the snapshot
  • Fixes the associated test
  • Exports the test to external/wpt so other impls can benefit
  • Adds documentation noting that ImageLoader::Task::referrer_policy_ is
    going away soon

Bug: 569760,1061685
Change-Id: I8d9e3dbefd27a26626bb930acc809196753c7506
Reviewed-on: https://chromium-review.googlesource.com/2103987
WPT-Export-Revision: c994a20cd78a3a380c98202f8199ebdbb40fcbcf

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e7688d2242a8
[wpt PR 22260] - ImageLoader: Stop storing request KURL in Task, a=testonly
https://hg.mozilla.org/integration/autoland/rev/f39192e0d225
[wpt PR 22260] - Update wpt metadata, a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.