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

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

Issue 688223002: Get rid of isWritingModeRoot. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT Created 6 years, 1 month 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 | « sky/engine/core/rendering/RenderBox.cpp ('k') | no next file » | 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) 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 ASSERT(mode == PositionOnContainingLine); 135 ASSERT(mode == PositionOnContainingLine);
136 int baseline = firstLineBoxBaseline(); 136 int baseline = firstLineBoxBaseline();
137 if (baseline == -1) 137 if (baseline == -1)
138 baseline = synthesizedBaselineFromContentBox(this, direction); 138 baseline = synthesizedBaselineFromContentBox(this, direction);
139 139
140 return beforeMarginInLineDirection(direction) + baseline; 140 return beforeMarginInLineDirection(direction) + baseline;
141 } 141 }
142 142
143 int RenderFlexibleBox::firstLineBoxBaseline() const 143 int RenderFlexibleBox::firstLineBoxBaseline() const
144 { 144 {
145 if (isWritingModeRoot() || m_numberOfInFlowChildrenOnFirstLine <= 0) 145 if (m_numberOfInFlowChildrenOnFirstLine <= 0)
146 return -1; 146 return -1;
147 RenderBox* baselineChild = 0; 147 RenderBox* baselineChild = 0;
148 int childNumber = 0; 148 int childNumber = 0;
149 for (RenderBox* child = m_orderIterator.first(); child; child = m_orderItera tor.next()) { 149 for (RenderBox* child = m_orderIterator.first(); child; child = m_orderItera tor.next()) {
150 if (child->isOutOfFlowPositioned()) 150 if (child->isOutOfFlowPositioned())
151 continue; 151 continue;
152 if (alignmentForChild(child) == ItemPositionBaseline && !hasAutoMarginsI nCrossAxis(child)) { 152 if (alignmentForChild(child) == ItemPositionBaseline && !hasAutoMarginsI nCrossAxis(child)) {
153 baselineChild = child; 153 baselineChild = child;
154 break; 154 break;
155 } 155 }
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 ASSERT(child); 1320 ASSERT(child);
1321 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1321 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1322 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1322 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1323 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1323 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1324 adjustAlignmentForChild(child, newOffset - originalOffset); 1324 adjustAlignmentForChild(child, newOffset - originalOffset);
1325 } 1325 }
1326 } 1326 }
1327 } 1327 }
1328 1328
1329 } 1329 }
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698