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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 // Otherwise we need the logical height. | 442 // Otherwise we need the logical height. |
443 if (isHorizontalFlow() != child.styleRef().isHorizontalWritingMode()) { | 443 if (isHorizontalFlow() != child.styleRef().isHorizontalWritingMode()) { |
444 // We don't have to check for "auto" here - computeContentLogicalHeight
will just return -1 for that case anyway. | 444 // We don't have to check for "auto" here - computeContentLogicalHeight
will just return -1 for that case anyway. |
445 // It's safe to access scrollbarLogicalHeight here because computeNextFl
exLine will have already | 445 // It's safe to access scrollbarLogicalHeight here because computeNextFl
exLine will have already |
446 // forced layout on the child. | 446 // forced layout on the child. |
447 return child.computeContentLogicalHeight(sizeType, size, child.contentLo
gicalHeight()) + child.scrollbarLogicalHeight(); | 447 return child.computeContentLogicalHeight(sizeType, size, child.contentLo
gicalHeight()) + child.scrollbarLogicalHeight(); |
448 } | 448 } |
449 // computeLogicalWidth always re-computes the intrinsic widths. However, whe
n our logical width is auto, | 449 // computeLogicalWidth always re-computes the intrinsic widths. However, whe
n our logical width is auto, |
450 // we can just use our cached value. So let's do that here. (Compare code in
LayoutBlock::computePreferredLogicalWidths) | 450 // we can just use our cached value. So let's do that here. (Compare code in
LayoutBlock::computePreferredLogicalWidths) |
451 LayoutUnit borderAndPadding = child.borderAndPaddingLogicalWidth(); | 451 LayoutUnit borderAndPadding = child.borderAndPaddingLogicalWidth(); |
452 if (styleRef().logicalWidth().isAuto()) { | 452 if (child.styleRef().logicalWidth().isAuto()) { |
453 if (size.type() == MinContent) | 453 if (size.type() == MinContent) |
454 return child.minPreferredLogicalWidth() - borderAndPadding; | 454 return child.minPreferredLogicalWidth() - borderAndPadding; |
455 if (size.type() == MaxContent) | 455 if (size.type() == MaxContent) |
456 return child.maxPreferredLogicalWidth() - borderAndPadding; | 456 return child.maxPreferredLogicalWidth() - borderAndPadding; |
457 } | 457 } |
458 return child.computeLogicalWidthUsing(sizeType, size, contentLogicalWidth(),
this) - borderAndPadding; | 458 return child.computeLogicalWidthUsing(sizeType, size, contentLogicalWidth(),
this) - borderAndPadding; |
459 } | 459 } |
460 | 460 |
461 WritingMode LayoutFlexibleBox::transformedWritingMode() const | 461 WritingMode LayoutFlexibleBox::transformedWritingMode() const |
462 { | 462 { |
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1518 ASSERT(child); | 1518 ASSERT(child); |
1519 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; | 1519 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; |
1520 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; | 1520 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; |
1521 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; | 1521 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; |
1522 adjustAlignmentForChild(*child, newOffset - originalOffset); | 1522 adjustAlignmentForChild(*child, newOffset - originalOffset); |
1523 } | 1523 } |
1524 } | 1524 } |
1525 } | 1525 } |
1526 | 1526 |
1527 } | 1527 } |
OLD | NEW |