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

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

Issue 21205004: [CSS Grid Layout] Store m_grid across layout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated change after Ojan's review Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderGrid.h » ('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 29 matching lines...) Expand all
40 #include "core/page/Page.h" 40 #include "core/page/Page.h"
41 #include "core/platform/graphics/FloatQuad.h" 41 #include "core/platform/graphics/FloatQuad.h"
42 #include "core/platform/graphics/GraphicsContextStateSaver.h" 42 #include "core/platform/graphics/GraphicsContextStateSaver.h"
43 #include "core/platform/graphics/transforms/TransformState.h" 43 #include "core/platform/graphics/transforms/TransformState.h"
44 #include "core/rendering/HitTestResult.h" 44 #include "core/rendering/HitTestResult.h"
45 #include "core/rendering/PaintInfo.h" 45 #include "core/rendering/PaintInfo.h"
46 #include "core/rendering/RenderBoxRegionInfo.h" 46 #include "core/rendering/RenderBoxRegionInfo.h"
47 #include "core/rendering/RenderFlexibleBox.h" 47 #include "core/rendering/RenderFlexibleBox.h"
48 #include "core/rendering/RenderFlowThread.h" 48 #include "core/rendering/RenderFlowThread.h"
49 #include "core/rendering/RenderGeometryMap.h" 49 #include "core/rendering/RenderGeometryMap.h"
50 #include "core/rendering/RenderGrid.h"
50 #include "core/rendering/RenderInline.h" 51 #include "core/rendering/RenderInline.h"
51 #include "core/rendering/RenderLayer.h" 52 #include "core/rendering/RenderLayer.h"
52 #include "core/rendering/RenderLayerCompositor.h" 53 #include "core/rendering/RenderLayerCompositor.h"
53 #include "core/rendering/RenderListMarker.h" 54 #include "core/rendering/RenderListMarker.h"
54 #include "core/rendering/RenderRegion.h" 55 #include "core/rendering/RenderRegion.h"
55 #include "core/rendering/RenderTableCell.h" 56 #include "core/rendering/RenderTableCell.h"
56 #include "core/rendering/RenderTheme.h" 57 #include "core/rendering/RenderTheme.h"
57 #include "core/rendering/RenderView.h" 58 #include "core/rendering/RenderView.h"
58 59
59 using namespace std; 60 using namespace std;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 document()->documentElement()->renderer()->style()->setWritingMo de(newStyle->writingMode()); 299 document()->documentElement()->renderer()->style()->setWritingMo de(newStyle->writingMode());
299 document()->documentElement()->renderer()->setHorizontalWritingM ode(newStyle->isHorizontalWritingMode()); 300 document()->documentElement()->renderer()->setHorizontalWritingM ode(newStyle->isHorizontalWritingMode());
300 } 301 }
301 setNeedsLayoutAndPrefWidthsRecalc(); 302 setNeedsLayoutAndPrefWidthsRecalc();
302 } 303 }
303 304
304 frame()->view()->recalculateScrollbarOverlayStyle(); 305 frame()->view()->recalculateScrollbarOverlayStyle();
305 } 306 }
306 307
307 updateShapeOutsideInfoAfterStyleChange(style()->shapeOutside(), oldStyle ? o ldStyle->shapeOutside() : 0); 308 updateShapeOutsideInfoAfterStyleChange(style()->shapeOutside(), oldStyle ? o ldStyle->shapeOutside() : 0);
309 updateGridPositionAfterStyleChange(oldStyle);
308 } 310 }
309 311
310 void RenderBox::updateShapeOutsideInfoAfterStyleChange(const ShapeValue* shapeOu tside, const ShapeValue* oldShapeOutside) 312 void RenderBox::updateShapeOutsideInfoAfterStyleChange(const ShapeValue* shapeOu tside, const ShapeValue* oldShapeOutside)
311 { 313 {
312 // FIXME: A future optimization would do a deep comparison for equality. (bu g 100811) 314 // FIXME: A future optimization would do a deep comparison for equality. (bu g 100811)
313 if (shapeOutside == oldShapeOutside) 315 if (shapeOutside == oldShapeOutside)
314 return; 316 return;
315 317
316 if (shapeOutside) { 318 if (shapeOutside) {
317 ShapeOutsideInfo* shapeOutsideInfo = ShapeOutsideInfo::ensureInfo(this); 319 ShapeOutsideInfo* shapeOutsideInfo = ShapeOutsideInfo::ensureInfo(this);
318 shapeOutsideInfo->dirtyShapeSize(); 320 shapeOutsideInfo->dirtyShapeSize();
319 } else { 321 } else {
320 ShapeOutsideInfo::removeInfo(this); 322 ShapeOutsideInfo::removeInfo(this);
321 } 323 }
322 } 324 }
323 325
326 void RenderBox::updateGridPositionAfterStyleChange(const RenderStyle* oldStyle)
327 {
328 if (!oldStyle || !parent() || !parent()->isRenderGrid())
329 return;
330
331 if (oldStyle->gridColumnStart() == style()->gridColumnStart()
332 && oldStyle->gridColumnEnd() == style()->gridColumnEnd()
333 && oldStyle->gridRowStart() == style()->gridRowStart()
334 && oldStyle->gridRowEnd() == style()->gridRowEnd()
335 && oldStyle->order() == style()->order())
336 return;
337
338 // It should be possible to not dirty the grid in some cases (like moving an explicitly placed grid item).
339 // For now, it's more simple to just always recompute the grid.
340 toRenderGrid(parent())->dirtyGrid();
341 }
342
324 void RenderBox::updateFromStyle() 343 void RenderBox::updateFromStyle()
325 { 344 {
326 RenderBoxModelObject::updateFromStyle(); 345 RenderBoxModelObject::updateFromStyle();
327 346
328 RenderStyle* styleToUse = style(); 347 RenderStyle* styleToUse = style();
329 bool isRootObject = isRoot(); 348 bool isRootObject = isRoot();
330 bool isViewObject = isRenderView(); 349 bool isViewObject = isRenderView();
331 350
332 // The root and the RenderView always paint their backgrounds/borders. 351 // The root and the RenderView always paint their backgrounds/borders.
333 if (isRootObject || isViewObject) 352 if (isRootObject || isViewObject)
(...skipping 4336 matching lines...) Expand 10 before | Expand all | Expand 10 after
4670 } 4689 }
4671 4690
4672 if (didSplitParentAnonymousBoxes) 4691 if (didSplitParentAnonymousBoxes)
4673 markBoxForRelayoutAfterSplit(this); 4692 markBoxForRelayoutAfterSplit(this);
4674 4693
4675 ASSERT(beforeChild->parent() == this); 4694 ASSERT(beforeChild->parent() == this);
4676 return beforeChild; 4695 return beforeChild;
4677 } 4696 }
4678 4697
4679 } // namespace WebCore 4698 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderGrid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698