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

Unified Diff: third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h

Issue 2703393012: CSSStyleImageValue::imageLayoutSize() shouldn't crash if no ImageResourceContent (Closed)
Patch Set: Remove file and instead add test to existing file Created 3 years, 10 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 | « third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/background-image.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h b/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h
index 667d4dfad43261af48f57415120476463c610e3e..e075f54aca4e57de77464eba5d62cbf85e6bd80d 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h
@@ -56,8 +56,12 @@ class CORE_EXPORT CSSStyleImageValue : public CSSResourceValue,
virtual LayoutSize imageLayoutSize() const {
DCHECK(!isCachePending());
- return m_imageValue->cachedImage()->cachedImage()->imageSize(
- DoNotRespectImageOrientation, 1, ImageResourceContent::IntrinsicSize);
+ ImageResourceContent* resourceContent =
+ m_imageValue->cachedImage()->cachedImage();
+ return resourceContent
+ ? resourceContent->imageSize(DoNotRespectImageOrientation, 1,
+ ImageResourceContent::IntrinsicSize)
+ : LayoutSize(0, 0);
}
virtual bool isCachePending() const { return m_imageValue->isCachePending(); }
« no previous file with comments | « third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/background-image.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698