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

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

Issue 1646413002: [css-flexbox] Add a missing needsLayout() check (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/shrinking-column-flexbox.html ('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 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 1036
1037 for (LayoutBox* child = m_orderIterator.currentChild(); child; child = m_ord erIterator.next()) { 1037 for (LayoutBox* child = m_orderIterator.currentChild(); child; child = m_ord erIterator.next()) {
1038 if (child->isOutOfFlowPositioned()) { 1038 if (child->isOutOfFlowPositioned()) {
1039 orderedChildren.append(child); 1039 orderedChildren.append(child);
1040 continue; 1040 continue;
1041 } 1041 }
1042 1042
1043 // If this condition is true, then computeMainAxisExtentForChild will ca ll child.contentLogicalHeight() 1043 // If this condition is true, then computeMainAxisExtentForChild will ca ll child.contentLogicalHeight()
1044 // and child.scrollbarLogicalHeight(), so if the child has intrinsic min /max/preferred size, 1044 // and child.scrollbarLogicalHeight(), so if the child has intrinsic min /max/preferred size,
1045 // run layout on it now to make sure its logical height and scroll bars are up-to-date. 1045 // run layout on it now to make sure its logical height and scroll bars are up-to-date.
1046 if (childHasIntrinsicMainAxisSize(*child)) { 1046 if (childHasIntrinsicMainAxisSize(*child) && child->needsLayout()) {
1047 child->clearOverrideSize(); 1047 child->clearOverrideSize();
1048 child->layoutIfNeeded(); 1048 child->layoutIfNeeded();
1049 // Keep our cache up-to-date 1049 // Keep our cache up-to-date
1050 m_intrinsicSizeAlongMainAxis.set(child, hasOrthogonalFlow(*child) ? child->logicalHeight() : child->logicalWidth()); 1050 m_intrinsicSizeAlongMainAxis.set(child, hasOrthogonalFlow(*child) ? child->logicalHeight() : child->logicalWidth());
1051 } 1051 }
1052 1052
1053 LayoutUnit childInnerFlexBaseSize = computeInnerFlexBaseSizeForChild(*ch ild, relayoutChildren ? ForceLayout : LayoutIfNeeded); 1053 LayoutUnit childInnerFlexBaseSize = computeInnerFlexBaseSizeForChild(*ch ild, relayoutChildren ? ForceLayout : LayoutIfNeeded);
1054 LayoutUnit childMainAxisMarginBorderPadding = mainAxisBorderAndPaddingEx tentForChild(*child) 1054 LayoutUnit childMainAxisMarginBorderPadding = mainAxisBorderAndPaddingEx tentForChild(*child)
1055 + (isHorizontalFlow() ? child->marginWidth() : child->marginHeight() ); 1055 + (isHorizontalFlow() ? child->marginWidth() : child->marginHeight() );
1056 LayoutUnit childOuterFlexBaseSize = childInnerFlexBaseSize + childMainAx isMarginBorderPadding; 1056 LayoutUnit childOuterFlexBaseSize = childInnerFlexBaseSize + childMainAx isMarginBorderPadding;
(...skipping 572 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
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/shrinking-column-flexbox.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698