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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutImage.cpp

Issue 1527453003: Fix ImageResource null-check in LayoutImage::foregroundIsKnownToBeOpaqueInRect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | 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 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com)
6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved.
10 * 10 *
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // Background shows in padding area. 237 // Background shows in padding area.
238 if ((backgroundClip == BorderFillBox || backgroundClip == PaddingFillBox) && style()->hasPadding()) 238 if ((backgroundClip == BorderFillBox || backgroundClip == PaddingFillBox) && style()->hasPadding())
239 return false; 239 return false;
240 // Object-position may leave parts of the content box empty, regardless of t he value of object-fit. 240 // Object-position may leave parts of the content box empty, regardless of t he value of object-fit.
241 if (style()->objectPosition() != ComputedStyle::initialObjectPosition()) 241 if (style()->objectPosition() != ComputedStyle::initialObjectPosition())
242 return false; 242 return false;
243 // Object-fit may leave parts of the content box empty. 243 // Object-fit may leave parts of the content box empty.
244 ObjectFit objectFit = style()->objectFit(); 244 ObjectFit objectFit = style()->objectFit();
245 if (objectFit != ObjectFitFill && objectFit != ObjectFitCover) 245 if (objectFit != ObjectFitFill && objectFit != ObjectFitCover)
246 return false; 246 return false;
247 if (!m_imageResource->cachedImage())
248 return false;
247 // Check for image with alpha. 249 // Check for image with alpha.
248 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", " data", InspectorPaintImageEvent::data(this, *m_imageResource->cachedImage())); 250 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", " data", InspectorPaintImageEvent::data(this, *m_imageResource->cachedImage()));
249 return m_imageResource->cachedImage() && m_imageResource->cachedImage()->ima ge()->currentFrameKnownToBeOpaque(Image::PreCacheMetadata); 251 return m_imageResource->cachedImage()->image()->currentFrameKnownToBeOpaque( Image::PreCacheMetadata);
250 } 252 }
251 253
252 bool LayoutImage::computeBackgroundIsKnownToBeObscured() const 254 bool LayoutImage::computeBackgroundIsKnownToBeObscured() const
253 { 255 {
254 if (!hasBackground()) 256 if (!hasBackground())
255 return false; 257 return false;
256 258
257 LayoutRect paintedExtent; 259 LayoutRect paintedExtent;
258 if (!getBackgroundPaintedExtent(paintedExtent)) 260 if (!getBackgroundPaintedExtent(paintedExtent))
259 return false; 261 return false;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 return nullptr; 319 return nullptr;
318 320
319 ImageResource* cachedImage = m_imageResource->cachedImage(); 321 ImageResource* cachedImage = m_imageResource->cachedImage();
320 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( )) 322 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( ))
321 return toSVGImage(cachedImage->image())->embeddedContentBox(); 323 return toSVGImage(cachedImage->image())->embeddedContentBox();
322 324
323 return nullptr; 325 return nullptr;
324 } 326 }
325 327
326 } // namespace blink 328 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698