Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(977)

Unified Diff: Source/core/html/HTMLImageElement.cpp

Issue 653023002: ASSERTION FAILED: factor > 0 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/HTMLImageElement/image-sizes-viewport-with-template-parent-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « LayoutTests/fast/dom/HTMLImageElement/image-sizes-viewport-with-template-parent-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698