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

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

Issue 1648573002: Transition to explicit constructors in LayoutUnit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove int constructors for size/point... they result in incorrect conversions until LayoutUnit is … Created 4 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 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 if (child.isOutOfFlowPositioned()) { 1477 if (child.isOutOfFlowPositioned()) {
1478 LayoutUnit staticInlinePosition = child.layer()->staticInlinePosition(); 1478 LayoutUnit staticInlinePosition = child.layer()->staticInlinePosition();
1479 LayoutUnit staticBlockPosition = child.layer()->staticBlockPosition(); 1479 LayoutUnit staticBlockPosition = child.layer()->staticBlockPosition();
1480 LayoutUnit mainAxis = isColumnFlow() ? staticBlockPosition : staticInlin ePosition; 1480 LayoutUnit mainAxis = isColumnFlow() ? staticBlockPosition : staticInlin ePosition;
1481 LayoutUnit crossAxis = isColumnFlow() ? staticInlinePosition : staticBlo ckPosition; 1481 LayoutUnit crossAxis = isColumnFlow() ? staticInlinePosition : staticBlo ckPosition;
1482 crossAxis += delta; 1482 crossAxis += delta;
1483 prepareChildForPositionedLayout(child, mainAxis, crossAxis, NoFlipForRow Reverse); 1483 prepareChildForPositionedLayout(child, mainAxis, crossAxis, NoFlipForRow Reverse);
1484 return; 1484 return;
1485 } 1485 }
1486 1486
1487 setFlowAwareLocationForChild(child, flowAwareLocationForChild(child) + Layou tSize(0, delta)); 1487 setFlowAwareLocationForChild(child, flowAwareLocationForChild(child) + Layou tSize(LayoutUnit(), delta));
1488 } 1488 }
1489 1489
1490 void LayoutFlexibleBox::alignChildren(const Vector<LineContext>& lineContexts) 1490 void LayoutFlexibleBox::alignChildren(const Vector<LineContext>& lineContexts)
1491 { 1491 {
1492 // Keep track of the space between the baseline edge and the after edge of t he box for each line. 1492 // Keep track of the space between the baseline edge and the after edge of t he box for each line.
1493 Vector<LayoutUnit> minMarginAfterBaselines; 1493 Vector<LayoutUnit> minMarginAfterBaselines;
1494 1494
1495 LayoutBox* child = m_orderIterator.first(); 1495 LayoutBox* child = m_orderIterator.first();
1496 for (size_t lineNumber = 0; lineNumber < lineContexts.size(); ++lineNumber) { 1496 for (size_t lineNumber = 0; lineNumber < lineContexts.size(); ++lineNumber) {
1497 LayoutUnit minMarginAfterBaseline = LayoutUnit::max(); 1497 LayoutUnit minMarginAfterBaseline = LayoutUnit::max();
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 ASSERT(child); 1629 ASSERT(child);
1630 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1630 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1631 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1631 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1632 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1632 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1633 adjustAlignmentForChild(*child, newOffset - originalOffset); 1633 adjustAlignmentForChild(*child, newOffset - originalOffset);
1634 } 1634 }
1635 } 1635 }
1636 } 1636 }
1637 1637
1638 } // namespace blink 1638 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698