Commit 63481682 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Signal document move to ImageLoader before attempting to load the image

In the DidMoveToNewDocument() override in HTMLImageElement and
SVGImageElement, initiate the load as the last thing rather than the
first, since ImageLoader::ElementDidMoveToNewDocument() will clear out
the image content, thus requiring a new load to take place later on
(when the element gets the "inserted into document" callback).

Bug: 1000273
Change-Id: I977d63bb8e14d7f8fbd1e7004b788d09b7b897fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1789394Reviewed-by: default avatarHiroshige Hayashizaki <hiroshige@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#706892}
parent 60f3e975
......@@ -626,9 +626,9 @@ bool HTMLImageElement::complete() const {
}
void HTMLImageElement::DidMoveToNewDocument(Document& old_document) {
SelectSourceURL(ImageLoader::kUpdateIgnorePreviousError);
GetImageLoader().ElementDidMoveToNewDocument();
HTMLElement::DidMoveToNewDocument(old_document);
SelectSourceURL(ImageLoader::kUpdateIgnorePreviousError);
}
bool HTMLImageElement::IsServerMap() const {
......
......@@ -223,9 +223,9 @@ const AtomicString SVGImageElement::ImageSourceURL() const {
}
void SVGImageElement::DidMoveToNewDocument(Document& old_document) {
GetImageLoader().UpdateFromElement(ImageLoader::kUpdateIgnorePreviousError);
GetImageLoader().ElementDidMoveToNewDocument();
SVGGraphicsElement::DidMoveToNewDocument(old_document);
GetImageLoader().UpdateFromElement(ImageLoader::kUpdateIgnorePreviousError);
}
} // namespace blink
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment