Index: Source/core/html/HTMLImageElement.cpp |
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp |
index 74e7d1350790183f293fd66801efb85ce4ee3ea6..f2b2659a855277772a6b28f4a28db5f690682359 100644 |
--- a/Source/core/html/HTMLImageElement.cpp |
+++ b/Source/core/html/HTMLImageElement.cpp |
@@ -364,7 +364,7 @@ Node::InsertionNotificationRequest HTMLImageElement::insertedInto(ContainerNode* |
document().mediaQueryMatcher().addViewportListener(m_listener); |
bool imageWasModified = false; |
- if (RuntimeEnabledFeatures::pictureEnabled()) { |
+ if (RuntimeEnabledFeatures::pictureEnabled() && document().isActive()) { |
ImageCandidate candidate = findBestFitImageFromPictureParent(); |
if (!candidate.isEmpty()) { |
setBestFitURLAndDPRFromImageCandidate(candidate); |
@@ -625,6 +625,9 @@ FloatSize HTMLImageElement::defaultDestinationSize() const |
void HTMLImageElement::selectSourceURL(ImageLoader::UpdateFromElementBehavior behavior) |
{ |
+ if (!document().isActive()) |
+ return; |
+ |
bool foundURL = false; |
if (RuntimeEnabledFeatures::pictureEnabled()) { |
ImageCandidate candidate = findBestFitImageFromPictureParent(); |