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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
595 child->setLocation(location.transposedPoint()); | 595 child->setLocation(location.transposedPoint()); |
596 } | 596 } |
597 | 597 |
598 LayoutUnit RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild(RenderBox* child) const | 598 LayoutUnit RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild(RenderBox* child) const |
599 { | 599 { |
600 return isHorizontalFlow() ? child->borderAndPaddingWidth() : child->borderAn dPaddingHeight(); | 600 return isHorizontalFlow() ? child->borderAndPaddingWidth() : child->borderAn dPaddingHeight(); |
601 } | 601 } |
602 | 602 |
603 static inline bool preferredMainAxisExtentDependsOnLayout(const Length& flexBasi s, bool hasInfiniteLineLength) | 603 static inline bool preferredMainAxisExtentDependsOnLayout(const Length& flexBasi s, bool hasInfiniteLineLength) |
604 { | 604 { |
605 return flexBasis.isAuto() || (flexBasis.isFixed() && !flexBasis.value() && h asInfiniteLineLength); | 605 return flexBasis.isAuto() || (flexBasis.isPercent() && !flexBasis.value() && hasInfiniteLineLength); |
cbiesinger
2014/08/21 23:54:23
So, the reason this code exists is a bit complicat
harpreet.sk
2014/08/22 15:13:35
Thanks Chris for the review. We cannot simply remo
| |
606 } | 606 } |
607 | 607 |
608 bool RenderFlexibleBox::childPreferredMainAxisContentExtentRequiresLayout(Render Box* child, bool hasInfiniteLineLength) const | 608 bool RenderFlexibleBox::childPreferredMainAxisContentExtentRequiresLayout(Render Box* child, bool hasInfiniteLineLength) const |
609 { | 609 { |
610 return preferredMainAxisExtentDependsOnLayout(flexBasisForChild(child), hasI nfiniteLineLength) && hasOrthogonalFlow(child); | 610 return preferredMainAxisExtentDependsOnLayout(flexBasisForChild(child), hasI nfiniteLineLength) && hasOrthogonalFlow(child); |
611 } | 611 } |
612 | 612 |
613 LayoutUnit RenderFlexibleBox::preferredMainAxisContentExtentForChild(RenderBox* child, bool hasInfiniteLineLength, bool relayoutChildren) | 613 LayoutUnit RenderFlexibleBox::preferredMainAxisContentExtentForChild(RenderBox* child, bool hasInfiniteLineLength, bool relayoutChildren) |
614 { | 614 { |
615 child->clearOverrideSize(); | 615 child->clearOverrideSize(); |
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1402 ASSERT(child); | 1402 ASSERT(child); |
1403 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; | 1403 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; |
1404 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; | 1404 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; |
1405 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; | 1405 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; |
1406 adjustAlignmentForChild(child, newOffset - originalOffset); | 1406 adjustAlignmentForChild(child, newOffset - originalOffset); |
1407 } | 1407 } |
1408 } | 1408 } |
1409 } | 1409 } |
1410 | 1410 |
1411 } | 1411 } |
OLD | NEW |