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

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

Issue 1293023002: Fix crash when content() url is -webkit-canvas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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/images/content-url-canvas-expected.html ('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 f6d39f0c885c1a734ffba8092e779063de159c56..97407240427f5c3dccd481b505835439ea3a41ee 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -332,8 +332,12 @@ ImageCandidate HTMLImageElement::findBestFitImageFromPictureParent()
LayoutObject* HTMLImageElement::createLayoutObject(const ComputedStyle& style)
{
const ContentData* contentData = style.contentData();
- if (contentData && contentData->isImage() && !toImageContentData(contentData)->image()->cachedImage()->errorOccurred())
- return LayoutObject::createObject(this, style);
+ if (contentData && contentData->isImage()) {
+ const StyleImage* contentImage = toImageContentData(contentData)->image();
+ bool errorOccurred = contentImage && contentImage->cachedImage() && contentImage->cachedImage()->errorOccurred();
+ if (!errorOccurred)
+ return LayoutObject::createObject(this, style);
+ }
if (m_useFallbackContent)
return new LayoutBlockFlow(this);
« no previous file with comments | « LayoutTests/fast/images/content-url-canvas-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698