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

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 226203010: [CSS Shapes] shape-outside from image doesn't load properly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Revised the test Created 6 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
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderImage.cpp » ('j') | 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 setIsBox(); 98 setIsBox();
99 } 99 }
100 100
101 void RenderBox::willBeDestroyed() 101 void RenderBox::willBeDestroyed()
102 { 102 {
103 clearOverrideSize(); 103 clearOverrideSize();
104 clearContainingBlockOverrideSize(); 104 clearContainingBlockOverrideSize();
105 105
106 RenderBlock::removePercentHeightDescendantIfNeeded(this); 106 RenderBlock::removePercentHeightDescendantIfNeeded(this);
107 107
108 ShapeOutsideInfo::removeInfo(*this); 108 clearShapeOutside();
109 109
110 RenderBoxModelObject::willBeDestroyed(); 110 RenderBoxModelObject::willBeDestroyed();
111 } 111 }
112 112
113 void RenderBox::clearShapeOutside()
114 {
115 const ShapeValue* shapeValue = style()->shapeOutside();
116 if (shapeValue) {
rwlbuis 2014/04/10 15:05:55 Nit: you could inline the shapeValue into the if s
117 if (StyleImage* shapeImage = shapeValue->image())
118 shapeImage->removeClient(this);
119 }
120
121 ShapeOutsideInfo::removeInfo(*this);
122 }
123
113 void RenderBox::removeFloatingOrPositionedChildFromBlockLists() 124 void RenderBox::removeFloatingOrPositionedChildFromBlockLists()
114 { 125 {
115 ASSERT(isFloatingOrOutOfFlowPositioned()); 126 ASSERT(isFloatingOrOutOfFlowPositioned());
116 127
117 if (documentBeingDestroyed()) 128 if (documentBeingDestroyed())
118 return; 129 return;
119 130
120 if (isFloating()) { 131 if (isFloating()) {
121 RenderBlockFlow* parentBlockFlow = 0; 132 RenderBlockFlow* parentBlockFlow = 0;
122 for (RenderObject* curr = parent(); curr && !curr->isRenderView(); curr = curr->parent()) { 133 for (RenderObject* curr = parent(); curr && !curr->isRenderView(); curr = curr->parent()) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 Length oldShapeMargin = oldStyle ? oldStyle->shapeMargin() : RenderStyle::in itialShapeMargin(); 246 Length oldShapeMargin = oldStyle ? oldStyle->shapeMargin() : RenderStyle::in itialShapeMargin();
236 247
237 float shapeImageThreshold = style.shapeImageThreshold(); 248 float shapeImageThreshold = style.shapeImageThreshold();
238 float oldShapeImageThreshold = oldStyle ? oldStyle->shapeImageThreshold() : RenderStyle::initialShapeImageThreshold(); 249 float oldShapeImageThreshold = oldStyle ? oldStyle->shapeImageThreshold() : RenderStyle::initialShapeImageThreshold();
239 250
240 // FIXME: A future optimization would do a deep comparison for equality. (bu g 100811) 251 // FIXME: A future optimization would do a deep comparison for equality. (bu g 100811)
241 if (shapeOutside == oldShapeOutside && shapeMargin == oldShapeMargin && shap eImageThreshold == oldShapeImageThreshold) 252 if (shapeOutside == oldShapeOutside && shapeMargin == oldShapeMargin && shap eImageThreshold == oldShapeImageThreshold)
242 return; 253 return;
243 254
244 if (!shapeOutside) 255 if (!shapeOutside)
245 ShapeOutsideInfo::removeInfo(*this); 256 clearShapeOutside();
246 else 257 else
247 ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty(); 258 ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty();
248 259
249 if (shapeOutside || shapeOutside != oldShapeOutside) 260 if (shapeOutside || shapeOutside != oldShapeOutside)
250 markShapeOutsideDependentsForLayout(); 261 markShapeOutsideDependentsForLayout();
251 } 262 }
252 263
253 void RenderBox::updateGridPositionAfterStyleChange(const RenderStyle* oldStyle) 264 void RenderBox::updateGridPositionAfterStyleChange(const RenderStyle* oldStyle)
254 { 265 {
255 if (!oldStyle || !parent() || !parent()->isRenderGrid()) 266 if (!oldStyle || !parent() || !parent()->isRenderGrid())
(...skipping 4482 matching lines...) Expand 10 before | Expand all | Expand 10 after
4738 return 0; 4749 return 0;
4739 4750
4740 if (!layoutState && !flowThreadContainingBlock()) 4751 if (!layoutState && !flowThreadContainingBlock())
4741 return 0; 4752 return 0;
4742 4753
4743 RenderBlock* containerBlock = containingBlock(); 4754 RenderBlock* containerBlock = containingBlock();
4744 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); 4755 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
4745 } 4756 }
4746 4757
4747 } // namespace WebCore 4758 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698