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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed.
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 if (!imageLoader().image() && !renderImageResource->cachedImage()) 351 if (!imageLoader().image() && !renderImageResource->cachedImage())
352 renderImage->setImageSizeForAltText(); 352 renderImage->setImageSizeForAltText();
353 else 353 else
354 renderImageResource->setImageResource(imageLoader().image()); 354 renderImageResource->setImageResource(imageLoader().image());
355 355
356 } 356 }
357 } 357 }
358 358
359 Node::InsertionNotificationRequest HTMLImageElement::insertedInto(ContainerNode* insertionPoint) 359 Node::InsertionNotificationRequest HTMLImageElement::insertedInto(ContainerNode* insertionPoint)
360 { 360 {
361 if (!document().isActive())
362 return InsertionDone;
bzsolt 2014/10/16 13:01:36 This modification caused to fail a test (fast/dom/
Yoav Weiss 2014/10/16 13:27:17 I don't know that this is correct. There are a lot
363
361 if (!m_formWasSetByParser || NodeTraversal::highestAncestorOrSelf(*insertion Point) != NodeTraversal::highestAncestorOrSelf(*m_form.get())) 364 if (!m_formWasSetByParser || NodeTraversal::highestAncestorOrSelf(*insertion Point) != NodeTraversal::highestAncestorOrSelf(*m_form.get()))
362 resetFormOwner(); 365 resetFormOwner();
363 if (m_listener) 366 if (m_listener)
364 document().mediaQueryMatcher().addViewportListener(m_listener); 367 document().mediaQueryMatcher().addViewportListener(m_listener);
365 368
366 bool imageWasModified = false; 369 bool imageWasModified = false;
367 if (RuntimeEnabledFeatures::pictureEnabled()) { 370 if (RuntimeEnabledFeatures::pictureEnabled()) {
368 ImageCandidate candidate = findBestFitImageFromPictureParent(); 371 ImageCandidate candidate = findBestFitImageFromPictureParent();
369 if (!candidate.isEmpty()) { 372 if (!candidate.isEmpty()) {
370 setBestFitURLAndDPRFromImageCandidate(candidate); 373 setBestFitURLAndDPRFromImageCandidate(candidate);
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 return FloatSize(); 621 return FloatSize();
619 LayoutSize size; 622 LayoutSize size;
620 size = image->imageSizeForRenderer(renderer(), 1.0f); // FIXME: Not sure abo ut this. 623 size = image->imageSizeForRenderer(renderer(), 1.0f); // FIXME: Not sure abo ut this.
621 if (renderer() && renderer()->isRenderImage() && image->image() && !image->i mage()->hasRelativeWidth()) 624 if (renderer() && renderer()->isRenderImage() && image->image() && !image->i mage()->hasRelativeWidth())
622 size.scale(toRenderImage(renderer())->imageDevicePixelRatio()); 625 size.scale(toRenderImage(renderer())->imageDevicePixelRatio());
623 return size; 626 return size;
624 } 627 }
625 628
626 void HTMLImageElement::selectSourceURL(ImageLoader::UpdateFromElementBehavior be havior) 629 void HTMLImageElement::selectSourceURL(ImageLoader::UpdateFromElementBehavior be havior)
627 { 630 {
631 if (!document().isActive())
632 return;
633
628 bool foundURL = false; 634 bool foundURL = false;
629 if (RuntimeEnabledFeatures::pictureEnabled()) { 635 if (RuntimeEnabledFeatures::pictureEnabled()) {
630 ImageCandidate candidate = findBestFitImageFromPictureParent(); 636 ImageCandidate candidate = findBestFitImageFromPictureParent();
631 if (!candidate.isEmpty()) { 637 if (!candidate.isEmpty()) {
632 setBestFitURLAndDPRFromImageCandidate(candidate); 638 setBestFitURLAndDPRFromImageCandidate(candidate);
633 foundURL = true; 639 foundURL = true;
634 } 640 }
635 } 641 }
636 642
637 if (!foundURL) { 643 if (!foundURL) {
(...skipping 15 matching lines...) Expand all
653 } 659 }
654 imageLoader().updateFromElement(behavior); 660 imageLoader().updateFromElement(behavior);
655 } 661 }
656 662
657 const KURL& HTMLImageElement::sourceURL() const 663 const KURL& HTMLImageElement::sourceURL() const
658 { 664 {
659 return cachedImage()->response().url(); 665 return cachedImage()->response().url();
660 } 666 }
661 667
662 } 668 }
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698