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

Side by Side Diff: sky/engine/core/rendering/RenderBlockFlow.cpp

Issue 876663003: Remove layoutBlock. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 RenderBlockFlow* renderer = new RenderBlockFlow(0); 58 RenderBlockFlow* renderer = new RenderBlockFlow(0);
59 renderer->setDocumentForAnonymous(document); 59 renderer->setDocumentForAnonymous(document);
60 return renderer; 60 return renderer;
61 } 61 }
62 62
63 bool RenderBlockFlow::updateLogicalWidthAndColumnWidth() 63 bool RenderBlockFlow::updateLogicalWidthAndColumnWidth()
64 { 64 {
65 return RenderBlock::updateLogicalWidthAndColumnWidth(); 65 return RenderBlock::updateLogicalWidthAndColumnWidth();
66 } 66 }
67 67
68 void RenderBlockFlow::layoutBlock(bool relayoutChildren) 68 void RenderBlockFlow::layout()
69 { 69 {
70 ASSERT(needsLayout()); 70 ASSERT(needsLayout());
71 ASSERT(isInlineBlock() || !isInline()); 71 ASSERT(isInlineBlock() || !isInline());
72 72
73 if (!relayoutChildren && simplifiedLayout()) 73 if (simplifiedLayout())
74 return; 74 return;
75 75
76 SubtreeLayoutScope layoutScope(*this); 76 SubtreeLayoutScope layoutScope(*this);
77 77
78 layoutBlockFlow(relayoutChildren, layoutScope); 78 layoutBlockFlow(layoutScope);
79 79
80 updateLayerTransformAfterLayout(); 80 updateLayerTransformAfterLayout();
81 81
82 // Update our scroll information if we're overflow:auto/scroll/hidden now th at we know if 82 // Update our scroll information if we're overflow:auto/scroll/hidden now th at we know if
83 // we overflow or not. 83 // we overflow or not.
84 updateScrollInfoAfterLayout(); 84 updateScrollInfoAfterLayout();
85 85
86 clearNeedsLayout(); 86 clearNeedsLayout();
87 } 87 }
88 88
89 inline void RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, SubtreeLayou tScope& layoutScope) 89 inline void RenderBlockFlow::layoutBlockFlow(SubtreeLayoutScope& layoutScope)
90 { 90 {
91 LayoutUnit oldLeft = logicalLeft(); 91 LayoutUnit oldLeft = logicalLeft();
92 bool logicalWidthChanged = updateLogicalWidthAndColumnWidth(); 92 bool logicalWidthChanged = updateLogicalWidthAndColumnWidth();
93 relayoutChildren |= logicalWidthChanged; 93 bool relayoutChildren = logicalWidthChanged;
94 94
95 LayoutState state(*this, locationOffset(), logicalWidthChanged); 95 LayoutState state(*this, locationOffset(), logicalWidthChanged);
96 96
97 LayoutUnit beforeEdge = borderBefore() + paddingBefore(); 97 LayoutUnit beforeEdge = borderBefore() + paddingBefore();
98 LayoutUnit afterEdge = borderAfter() + paddingAfter(); 98 LayoutUnit afterEdge = borderAfter() + paddingAfter();
99 LayoutUnit previousHeight = logicalHeight(); 99 LayoutUnit previousHeight = logicalHeight();
100 setLogicalHeight(beforeEdge); 100 setLogicalHeight(beforeEdge);
101 101
102 layoutChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge); 102 layoutChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge);
103 103
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 float logicalLeft = logicalLeftOffsetForLine(false).toFloat(); 359 float logicalLeft = logicalLeftOffsetForLine(false).toFloat();
360 float availableLogicalWidth = logicalRightOffsetForLine(false) - logicalLeft ; 360 float availableLogicalWidth = logicalRightOffsetForLine(false) - logicalLeft ;
361 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0); 361 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0);
362 362
363 if (!style()->isLeftToRightDirection()) 363 if (!style()->isLeftToRightDirection())
364 return logicalWidth() - logicalLeft; 364 return logicalWidth() - logicalLeft;
365 return logicalLeft; 365 return logicalLeft;
366 } 366 }
367 367
368 } // namespace blink 368 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBlockFlow.h ('k') | sky/engine/core/rendering/RenderFlexibleBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698