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

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

Issue 2700123003: DO NOT COMMIT: Results of running old (current) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "core/layout/LayoutFlexibleBox.h" 31 #include "core/layout/LayoutFlexibleBox.h"
32 32
33 #include <limits>
33 #include "core/frame/UseCounter.h" 34 #include "core/frame/UseCounter.h"
34 #include "core/layout/FlexibleBoxAlgorithm.h" 35 #include "core/layout/FlexibleBoxAlgorithm.h"
35 #include "core/layout/LayoutState.h" 36 #include "core/layout/LayoutState.h"
36 #include "core/layout/LayoutView.h" 37 #include "core/layout/LayoutView.h"
37 #include "core/layout/TextAutosizer.h" 38 #include "core/layout/TextAutosizer.h"
38 #include "core/paint/BlockPainter.h" 39 #include "core/paint/BlockPainter.h"
39 #include "core/paint/PaintLayer.h" 40 #include "core/paint/PaintLayer.h"
40 #include "core/style/ComputedStyle.h" 41 #include "core/style/ComputedStyle.h"
41 #include "platform/LengthFunctions.h" 42 #include "platform/LengthFunctions.h"
42 #include "wtf/AutoReset.h" 43 #include "wtf/AutoReset.h"
43 #include "wtf/MathExtras.h" 44 #include "wtf/MathExtras.h"
44 #include <limits>
45 45
46 namespace blink { 46 namespace blink {
47 47
48 static bool hasAspectRatio(const LayoutBox& child) { 48 static bool hasAspectRatio(const LayoutBox& child) {
49 return child.isImage() || child.isCanvas() || child.isVideo(); 49 return child.isImage() || child.isCanvas() || child.isVideo();
50 } 50 }
51 51
52 struct LayoutFlexibleBox::LineContext { 52 struct LayoutFlexibleBox::LineContext {
53 LineContext(LayoutUnit crossAxisOffset, 53 LineContext(LayoutUnit crossAxisOffset,
54 LayoutUnit crossAxisExtent, 54 LayoutUnit crossAxisExtent,
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 Vector<LineContext> lineContexts; 934 Vector<LineContext> lineContexts;
935 LayoutUnit sumFlexBaseSize; 935 LayoutUnit sumFlexBaseSize;
936 double totalFlexGrow; 936 double totalFlexGrow;
937 double totalFlexShrink; 937 double totalFlexShrink;
938 double totalWeightedFlexShrink; 938 double totalWeightedFlexShrink;
939 LayoutUnit sumHypotheticalMainSize; 939 LayoutUnit sumHypotheticalMainSize;
940 940
941 PaintLayerScrollableArea::PreventRelayoutScope preventRelayoutScope( 941 PaintLayerScrollableArea::PreventRelayoutScope preventRelayoutScope(
942 layoutScope); 942 layoutScope);
943 943
944
945 // Set up our master list of flex items. All of the rest of the algorithm 944 // Set up our master list of flex items. All of the rest of the algorithm
946 // should work off this list of a subset. 945 // should work off this list of a subset.
947 // TODO(cbiesinger): That second part is not yet true. 946 // TODO(cbiesinger): That second part is not yet true.
948 ChildLayoutType layoutType = relayoutChildren ? ForceLayout : LayoutIfNeeded; 947 ChildLayoutType layoutType = relayoutChildren ? ForceLayout : LayoutIfNeeded;
949 Vector<FlexItem> allItems; 948 Vector<FlexItem> allItems;
950 m_orderIterator.first(); 949 m_orderIterator.first();
951 for (LayoutBox* child = m_orderIterator.currentChild(); child; 950 for (LayoutBox* child = m_orderIterator.currentChild(); child;
952 child = m_orderIterator.next()) { 951 child = m_orderIterator.next()) {
953
954 if (child->isOutOfFlowPositioned()) { 952 if (child->isOutOfFlowPositioned()) {
955 // Out-of-flow children are not flex items, so we skip them here. 953 // Out-of-flow children are not flex items, so we skip them here.
956 prepareChildForPositionedLayout(*child); 954 prepareChildForPositionedLayout(*child);
957 continue; 955 continue;
958 } 956 }
959 957
960 allItems.push_back(constructFlexItem(*child, layoutType)); 958 allItems.push_back(constructFlexItem(*child, layoutType));
961 } 959 }
962 960
963 const LayoutUnit lineBreakLength = mainAxisContentExtent(LayoutUnit::max()); 961 const LayoutUnit lineBreakLength = mainAxisContentExtent(LayoutUnit::max());
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
2166 LayoutUnit originalOffset = 2164 LayoutUnit originalOffset =
2167 lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 2165 lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
2168 LayoutUnit newOffset = 2166 LayoutUnit newOffset =
2169 contentExtent - originalOffset - lineCrossAxisExtent; 2167 contentExtent - originalOffset - lineCrossAxisExtent;
2170 adjustAlignmentForChild(*flexItem.box, newOffset - originalOffset); 2168 adjustAlignmentForChild(*flexItem.box, newOffset - originalOffset);
2171 } 2169 }
2172 } 2170 }
2173 } 2171 }
2174 2172
2175 } // namespace blink 2173 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698