OLD | NEW |
---|---|
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 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1097 resetAutoMarginsAndLogicalTopInCrossAxis(child); | 1097 resetAutoMarginsAndLogicalTopInCrossAxis(child); |
1098 } | 1098 } |
1099 // We may have already forced relayout for orthogonal flowing children i n preferredMainAxisContentExtentForChild. | 1099 // We may have already forced relayout for orthogonal flowing children i n preferredMainAxisContentExtentForChild. |
1100 bool forceChildRelayout = relayoutChildren && !childPreferredMainAxisCon tentExtentRequiresLayout(child, hasInfiniteLineLength); | 1100 bool forceChildRelayout = relayoutChildren && !childPreferredMainAxisCon tentExtentRequiresLayout(child, hasInfiniteLineLength); |
1101 updateBlockChildDirtyBitsBeforeLayout(forceChildRelayout, child); | 1101 updateBlockChildDirtyBitsBeforeLayout(forceChildRelayout, child); |
1102 child->layoutIfNeeded(); | 1102 child->layoutIfNeeded(); |
1103 | 1103 |
1104 updateAutoMarginsInMainAxis(child, autoMarginOffset); | 1104 updateAutoMarginsInMainAxis(child, autoMarginOffset); |
1105 | 1105 |
1106 LayoutUnit childCrossAxisMarginBoxExtent; | 1106 LayoutUnit childCrossAxisMarginBoxExtent; |
1107 LayoutUnit crossAxisScrollbarExtentForChild = !isColumnFlow() ? child->s crollbarLogicalHeight() : child->instrinsicScrollbarLogicalWidth(); | |
cbiesinger
2014/08/07 02:57:01
I'd really prefer you to flip the ?: around so you
harpreet.sk
2014/08/07 12:46:39
Modified the solution to use isHorizontalFlow and
| |
1107 if (alignmentForChild(child) == ItemPositionBaseline && !hasAutoMarginsI nCrossAxis(child)) { | 1108 if (alignmentForChild(child) == ItemPositionBaseline && !hasAutoMarginsI nCrossAxis(child)) { |
1108 LayoutUnit ascent = marginBoxAscentForChild(child); | 1109 LayoutUnit ascent = marginBoxAscentForChild(child); |
1109 LayoutUnit descent = (crossAxisMarginExtentForChild(child) + crossAx isExtentForChild(child)) - ascent; | 1110 LayoutUnit descent = (crossAxisMarginExtentForChild(child) + crossAx isExtentForChild(child)) - ascent; |
1110 | 1111 |
1111 maxAscent = std::max(maxAscent, ascent); | 1112 maxAscent = std::max(maxAscent, ascent); |
1112 maxDescent = std::max(maxDescent, descent); | 1113 maxDescent = std::max(maxDescent, descent); |
1113 | 1114 |
1114 childCrossAxisMarginBoxExtent = maxAscent + maxDescent; | 1115 childCrossAxisMarginBoxExtent = maxAscent + maxDescent + crossAxisSc rollbarExtentForChild; |
tony
2014/08/06 16:47:22
I don't see any align-item baseline test cases tha
harpreet.sk
2014/08/07 12:46:39
Actually we should not add crossAxisScrollbarExten
| |
1115 } else { | 1116 } else { |
1116 childCrossAxisMarginBoxExtent = crossAxisIntrinsicExtentForChild(chi ld) + crossAxisMarginExtentForChild(child); | 1117 childCrossAxisMarginBoxExtent = crossAxisIntrinsicExtentForChild(chi ld) + crossAxisMarginExtentForChild(child) + crossAxisScrollbarExtentForChild; |
1117 } | 1118 } |
1118 if (!isColumnFlow()) | 1119 if (!isColumnFlow()) |
1119 setLogicalHeight(std::max(logicalHeight(), crossAxisOffset + flowAwa reBorderAfter() + flowAwarePaddingAfter() + childCrossAxisMarginBoxExtent + cros sAxisScrollbarExtent())); | 1120 setLogicalHeight(std::max(logicalHeight(), crossAxisOffset + flowAwa reBorderAfter() + flowAwarePaddingAfter() + childCrossAxisMarginBoxExtent + cros sAxisScrollbarExtent())); |
1120 maxChildCrossAxisExtent = std::max(maxChildCrossAxisExtent, childCrossAx isMarginBoxExtent); | 1121 maxChildCrossAxisExtent = std::max(maxChildCrossAxisExtent, childCrossAx isMarginBoxExtent); |
1121 | 1122 |
1122 mainAxisOffset += flowAwareMarginStartForChild(child); | 1123 mainAxisOffset += flowAwareMarginStartForChild(child); |
1123 | 1124 |
1124 LayoutUnit childMainExtent = mainAxisExtentForChild(child); | 1125 LayoutUnit childMainExtent = mainAxisExtentForChild(child); |
1125 // In an RTL column situation, this will apply the margin-right/margin-e nd on the left. | 1126 // In an RTL column situation, this will apply the margin-right/margin-e nd on the left. |
1126 // This will be fixed later in flipForRightToLeftColumn. | 1127 // This will be fixed later in flipForRightToLeftColumn. |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1397 ASSERT(child); | 1398 ASSERT(child); |
1398 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; | 1399 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; |
1399 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; | 1400 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; |
1400 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; | 1401 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; |
1401 adjustAlignmentForChild(child, newOffset - originalOffset); | 1402 adjustAlignmentForChild(child, newOffset - originalOffset); |
1402 } | 1403 } |
1403 } | 1404 } |
1404 } | 1405 } |
1405 | 1406 |
1406 } | 1407 } |
OLD | NEW |