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 [1]: https://html.spec.whatwg.org/multipage/images.html#updating-the-image-data:parse-a-url-2 Bug: 569760,1061685 Change-Id: I8d9e3dbefd27a26626bb930acc809196753c7506 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2103987 Commit-Queue: Dominic Farolino <dom@chromium.org> Reviewed-by:Kinuko Yasuda <kinuko@chromium.org> Reviewed-by:
Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#756376}
Showing
Please register or sign in to comment