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

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

Issue 2286543002: Add Length::isPercent and use it in tables. (Closed)
Patch Set: rebase Created 4 years, 3 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. 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 bool imageSourceHasChangedSize = oldIntrinsicSize != newIntrinsicSize; 144 bool imageSourceHasChangedSize = oldIntrinsicSize != newIntrinsicSize;
145 if (imageSourceHasChangedSize) 145 if (imageSourceHasChangedSize)
146 setPreferredLogicalWidthsDirty(); 146 setPreferredLogicalWidthsDirty();
147 147
148 // If the actual area occupied by the image has changed and it is not constr ained by style then a layout is required. 148 // If the actual area occupied by the image has changed and it is not constr ained by style then a layout is required.
149 bool imageSizeIsConstrained = style()->logicalWidth().isSpecified() && style ()->logicalHeight().isSpecified(); 149 bool imageSizeIsConstrained = style()->logicalWidth().isSpecified() && style ()->logicalHeight().isSpecified();
150 150
151 // FIXME: We only need to recompute the containing block's preferred size if the containing block's size 151 // FIXME: We only need to recompute the containing block's preferred size if the containing block's size
152 // depends on the image's size (i.e., the container uses shrink-to-fit sizin g). 152 // depends on the image's size (i.e., the container uses shrink-to-fit sizin g).
153 // There's no easy way to detect that shrink-to-fit is needed, always force a layout. 153 // There's no easy way to detect that shrink-to-fit is needed, always force a layout.
154 bool containingBlockNeedsToRecomputePreferredSize = style()->logicalWidth(). hasPercent() || style()->logicalMaxWidth().hasPercent() || style()->logicalMinW idth().hasPercent(); 154 bool containingBlockNeedsToRecomputePreferredSize = style()->logicalWidth(). isPercentOrCalc() || style()->logicalMaxWidth().isPercentOrCalc() || style()->l ogicalMinWidth().isPercentOrCalc();
155 155
156 if (imageSourceHasChangedSize && (!imageSizeIsConstrained || containingBlock NeedsToRecomputePreferredSize)) { 156 if (imageSourceHasChangedSize && (!imageSizeIsConstrained || containingBlock NeedsToRecomputePreferredSize)) {
157 setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReason::SizeCha nged); 157 setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReason::SizeCha nged);
158 return; 158 return;
159 } 159 }
160 160
161 if (imageResource() && imageResource()->maybeAnimated()) 161 if (imageResource() && imageResource()->maybeAnimated())
162 setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull); 162 setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull);
163 else 163 else
164 setShouldDoFullPaintInvalidation(PaintInvalidationFull); 164 setShouldDoFullPaintInvalidation(PaintInvalidationFull);
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 return nullptr; 307 return nullptr;
308 308
309 ImageResource* cachedImage = m_imageResource->cachedImage(); 309 ImageResource* cachedImage = m_imageResource->cachedImage();
310 if (cachedImage && cachedImage->getImage() && cachedImage->getImage()->isSVG Image()) 310 if (cachedImage && cachedImage->getImage() && cachedImage->getImage()->isSVG Image())
311 return toSVGImage(cachedImage->getImage())->embeddedReplacedContent(); 311 return toSVGImage(cachedImage->getImage())->embeddedReplacedContent();
312 312
313 return nullptr; 313 return nullptr;
314 } 314 }
315 315
316 } // namespace blink 316 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698