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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 LayoutUnit RenderFlexibleBox::crossAxisContentExtent() const | 397 LayoutUnit RenderFlexibleBox::crossAxisContentExtent() const |
398 { | 398 { |
399 return isHorizontalFlow() ? contentHeight() : contentWidth(); | 399 return isHorizontalFlow() ? contentHeight() : contentWidth(); |
400 } | 400 } |
401 | 401 |
402 LayoutUnit RenderFlexibleBox::mainAxisContentExtent(LayoutUnit contentLogicalHei
ght) | 402 LayoutUnit RenderFlexibleBox::mainAxisContentExtent(LayoutUnit contentLogicalHei
ght) |
403 { | 403 { |
404 if (isColumnFlow()) { | 404 if (isColumnFlow()) { |
405 LogicalExtentComputedValues computedValues; | 405 LogicalExtentComputedValues computedValues; |
406 LayoutUnit borderPaddingAndScrollbar = borderAndPaddingLogicalHeight() +
scrollbarLogicalHeight(); | 406 LayoutUnit borderPaddingAndScrollbar = borderAndPaddingLogicalHeight() +
scrollbarLogicalHeight(); |
407 // FIXME: Remove this std:max once we enable saturated layout arithmetic
. It's just here to handle overflow. | 407 LayoutUnit borderBoxLogicalHeight = contentLogicalHeight + borderPadding
AndScrollbar; |
408 LayoutUnit borderBoxLogicalHeight = std::max(contentLogicalHeight, conte
ntLogicalHeight + borderPaddingAndScrollbar); | |
409 computeLogicalHeight(borderBoxLogicalHeight, logicalTop(), computedValue
s); | 408 computeLogicalHeight(borderBoxLogicalHeight, logicalTop(), computedValue
s); |
410 if (computedValues.m_extent == LayoutUnit::max()) | 409 if (computedValues.m_extent == LayoutUnit::max()) |
411 return computedValues.m_extent; | 410 return computedValues.m_extent; |
412 return std::max(LayoutUnit(0), computedValues.m_extent - borderPaddingAn
dScrollbar); | 411 return std::max(LayoutUnit(0), computedValues.m_extent - borderPaddingAn
dScrollbar); |
413 } | 412 } |
414 return contentLogicalWidth(); | 413 return contentLogicalWidth(); |
415 } | 414 } |
416 | 415 |
417 LayoutUnit RenderFlexibleBox::computeMainAxisExtentForChild(RenderBox* child, Si
zeType sizeType, const Length& size) | 416 LayoutUnit RenderFlexibleBox::computeMainAxisExtentForChild(RenderBox* child, Si
zeType sizeType, const Length& size) |
418 { | 417 { |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 ASSERT(child); | 1401 ASSERT(child); |
1403 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; | 1402 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; |
1404 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; | 1403 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; |
1405 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; | 1404 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; |
1406 adjustAlignmentForChild(child, newOffset - originalOffset); | 1405 adjustAlignmentForChild(child, newOffset - originalOffset); |
1407 } | 1406 } |
1408 } | 1407 } |
1409 } | 1408 } |
1410 | 1409 |
1411 } | 1410 } |
OLD | NEW |