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

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

Issue 2770123003: Replace ASSERT with DCHECK in core/layout/ excluding subdirs (Closed)
Patch Set: Split some DCHECKs and add DCHECK_ops wherever possible Created 3 years, 8 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
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. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * Copyright (C) 2010 Google Inc. All rights reserved. 9 * Copyright (C) 2010 Google Inc. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 LayoutImage* LayoutImage::createAnonymous(PseudoElement& pseudo) { 54 LayoutImage* LayoutImage::createAnonymous(PseudoElement& pseudo) {
55 LayoutImage* image = new LayoutImage(nullptr); 55 LayoutImage* image = new LayoutImage(nullptr);
56 image->setDocumentForAnonymous(&pseudo.document()); 56 image->setDocumentForAnonymous(&pseudo.document());
57 return image; 57 return image;
58 } 58 }
59 59
60 LayoutImage::~LayoutImage() {} 60 LayoutImage::~LayoutImage() {}
61 61
62 void LayoutImage::willBeDestroyed() { 62 void LayoutImage::willBeDestroyed() {
63 ASSERT(m_imageResource); 63 DCHECK(m_imageResource);
64 m_imageResource->shutdown(); 64 m_imageResource->shutdown();
65 LayoutReplaced::willBeDestroyed(); 65 LayoutReplaced::willBeDestroyed();
66 } 66 }
67 67
68 void LayoutImage::styleDidChange(StyleDifference diff, 68 void LayoutImage::styleDidChange(StyleDifference diff,
69 const ComputedStyle* oldStyle) { 69 const ComputedStyle* oldStyle) {
70 LayoutReplaced::styleDidChange(diff, oldStyle); 70 LayoutReplaced::styleDidChange(diff, oldStyle);
71 71
72 RespectImageOrientationEnum oldOrientation = 72 RespectImageOrientationEnum oldOrientation =
73 oldStyle ? oldStyle->respectImageOrientation() 73 oldStyle ? oldStyle->respectImageOrientation()
74 : ComputedStyle::initialRespectImageOrientation(); 74 : ComputedStyle::initialRespectImageOrientation();
75 if (style() && style()->respectImageOrientation() != oldOrientation) 75 if (style() && style()->respectImageOrientation() != oldOrientation)
76 intrinsicSizeChanged(); 76 intrinsicSizeChanged();
77 } 77 }
78 78
79 void LayoutImage::setImageResource(LayoutImageResource* imageResource) { 79 void LayoutImage::setImageResource(LayoutImageResource* imageResource) {
80 ASSERT(!m_imageResource); 80 DCHECK(!m_imageResource);
81 m_imageResource = imageResource; 81 m_imageResource = imageResource;
82 m_imageResource->initialize(this); 82 m_imageResource->initialize(this);
83 } 83 }
84 84
85 void LayoutImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect) { 85 void LayoutImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect) {
86 ASSERT(view()); 86 DCHECK(view());
87 ASSERT(view()->frameView()); 87 DCHECK(view()->frameView());
88 if (documentBeingDestroyed()) 88 if (documentBeingDestroyed())
89 return; 89 return;
90 90
91 if (hasBoxDecorationBackground() || hasMask() || hasShapeOutside() || 91 if (hasBoxDecorationBackground() || hasMask() || hasShapeOutside() ||
92 hasReflection()) 92 hasReflection())
93 LayoutReplaced::imageChanged(newImage, rect); 93 LayoutReplaced::imageChanged(newImage, rect);
94 94
95 if (!m_imageResource) 95 if (!m_imageResource)
96 return; 96 return;
97 97
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 const LayoutPoint& paintOffset) const { 199 const LayoutPoint& paintOffset) const {
200 ImagePainter(*this).paintReplaced(paintInfo, paintOffset); 200 ImagePainter(*this).paintReplaced(paintInfo, paintOffset);
201 } 201 }
202 202
203 void LayoutImage::paint(const PaintInfo& paintInfo, 203 void LayoutImage::paint(const PaintInfo& paintInfo,
204 const LayoutPoint& paintOffset) const { 204 const LayoutPoint& paintOffset) const {
205 ImagePainter(*this).paint(paintInfo, paintOffset); 205 ImagePainter(*this).paint(paintInfo, paintOffset);
206 } 206 }
207 207
208 void LayoutImage::areaElementFocusChanged(HTMLAreaElement* areaElement) { 208 void LayoutImage::areaElementFocusChanged(HTMLAreaElement* areaElement) {
209 ASSERT(areaElement->imageElement() == node()); 209 DCHECK_EQ(areaElement->imageElement(), node());
210 210
211 if (areaElement->getPath(this).isEmpty()) 211 if (areaElement->getPath(this).isEmpty())
212 return; 212 return;
213 213
214 invalidatePaintAndMarkForLayoutIfNeeded(); 214 invalidatePaintAndMarkForLayoutIfNeeded();
215 } 215 }
216 216
217 bool LayoutImage::foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, 217 bool LayoutImage::foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect,
218 unsigned) const { 218 unsigned) const {
219 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred()) 219 if (!m_imageResource->hasImage() || m_imageResource->errorOccurred())
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 324
325 ImageResourceContent* cachedImage = m_imageResource->cachedImage(); 325 ImageResourceContent* cachedImage = m_imageResource->cachedImage();
326 if (cachedImage && cachedImage->getImage() && 326 if (cachedImage && cachedImage->getImage() &&
327 cachedImage->getImage()->isSVGImage()) 327 cachedImage->getImage()->isSVGImage())
328 return toSVGImage(cachedImage->getImage())->embeddedReplacedContent(); 328 return toSVGImage(cachedImage->getImage())->embeddedReplacedContent();
329 329
330 return nullptr; 330 return nullptr;
331 } 331 }
332 332
333 } // namespace blink 333 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutIFrame.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698