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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 | 597 |
598 bool RenderFlexibleBox::childPreferredMainAxisContentExtentRequiresLayout(Render
Box& child, bool hasInfiniteLineLength) const | 598 bool RenderFlexibleBox::childPreferredMainAxisContentExtentRequiresLayout(Render
Box& child, bool hasInfiniteLineLength) const |
599 { | 599 { |
600 return preferredMainAxisExtentDependsOnLayout(flexBasisForChild(child), hasI
nfiniteLineLength) && hasOrthogonalFlow(child); | 600 return preferredMainAxisExtentDependsOnLayout(flexBasisForChild(child), hasI
nfiniteLineLength) && hasOrthogonalFlow(child); |
601 } | 601 } |
602 | 602 |
603 LayoutUnit RenderFlexibleBox::preferredMainAxisContentExtentForChild(RenderBox&
child, bool hasInfiniteLineLength, bool relayoutChildren) | 603 LayoutUnit RenderFlexibleBox::preferredMainAxisContentExtentForChild(RenderBox&
child, bool hasInfiniteLineLength, bool relayoutChildren) |
604 { | 604 { |
605 child.clearOverrideSize(); | 605 child.clearOverrideSize(); |
606 | 606 |
607 if (child.style()->hasAspectRatio() || child.isImage() || child.isVideo() ||
child.isCanvas()) | 607 if (child.isImage() || child.isVideo() || child.isCanvas()) |
608 UseCounter::count(document(), UseCounter::AspectRatioFlexItem); | 608 UseCounter::count(document(), UseCounter::AspectRatioFlexItem); |
609 | 609 |
610 Length flexBasis = flexBasisForChild(child); | 610 Length flexBasis = flexBasisForChild(child); |
611 if (preferredMainAxisExtentDependsOnLayout(flexBasis, hasInfiniteLineLength)
) { | 611 if (preferredMainAxisExtentDependsOnLayout(flexBasis, hasInfiniteLineLength)
) { |
612 LayoutUnit mainAxisExtent; | 612 LayoutUnit mainAxisExtent; |
613 if (hasOrthogonalFlow(child)) { | 613 if (hasOrthogonalFlow(child)) { |
614 if (child.needsLayout() || relayoutChildren) { | 614 if (child.needsLayout() || relayoutChildren) { |
615 m_intrinsicSizeAlongMainAxis.remove(&child); | 615 m_intrinsicSizeAlongMainAxis.remove(&child); |
616 child.forceChildLayout(); | 616 child.forceChildLayout(); |
617 m_intrinsicSizeAlongMainAxis.set(&child, child.logicalHeight()); | 617 m_intrinsicSizeAlongMainAxis.set(&child, child.logicalHeight()); |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1394 ASSERT(child); | 1394 ASSERT(child); |
1395 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; | 1395 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; |
1396 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; | 1396 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; |
1397 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; | 1397 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; |
1398 adjustAlignmentForChild(*child, newOffset - originalOffset); | 1398 adjustAlignmentForChild(*child, newOffset - originalOffset); |
1399 } | 1399 } |
1400 } | 1400 } |
1401 } | 1401 } |
1402 | 1402 |
1403 } | 1403 } |
OLD | NEW |