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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 bool LayoutFlexibleBox::isHorizontalFlow() const | 353 bool LayoutFlexibleBox::isHorizontalFlow() const |
354 { | 354 { |
355 if (isHorizontalWritingMode()) | 355 if (isHorizontalWritingMode()) |
356 return !isColumnFlow(); | 356 return !isColumnFlow(); |
357 return isColumnFlow(); | 357 return isColumnFlow(); |
358 } | 358 } |
359 | 359 |
360 bool LayoutFlexibleBox::isLeftToRightFlow() const | 360 bool LayoutFlexibleBox::isLeftToRightFlow() const |
361 { | 361 { |
362 if (isColumnFlow()) | 362 if (isColumnFlow()) |
363 return style()->writingMode() == TopToBottomWritingMode || style()->writ
ingMode() == LeftToRightWritingMode; | 363 return style()->getWritingMode() == TopToBottomWritingMode || style()->g
etWritingMode() == LeftToRightWritingMode; |
364 return style()->isLeftToRightDirection() ^ (style()->flexDirection() == Flow
RowReverse); | 364 return style()->isLeftToRightDirection() ^ (style()->flexDirection() == Flow
RowReverse); |
365 } | 365 } |
366 | 366 |
367 bool LayoutFlexibleBox::isMultiline() const | 367 bool LayoutFlexibleBox::isMultiline() const |
368 { | 368 { |
369 return style()->flexWrap() != FlexNoWrap; | 369 return style()->flexWrap() != FlexNoWrap; |
370 } | 370 } |
371 | 371 |
372 Length LayoutFlexibleBox::flexBasisForChild(const LayoutBox& child) const | 372 Length LayoutFlexibleBox::flexBasisForChild(const LayoutBox& child) const |
373 { | 373 { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 if (size.type() == MinContent) | 466 if (size.type() == MinContent) |
467 return child.minPreferredLogicalWidth() - borderAndPadding; | 467 return child.minPreferredLogicalWidth() - borderAndPadding; |
468 if (size.type() == MaxContent) | 468 if (size.type() == MaxContent) |
469 return child.maxPreferredLogicalWidth() - borderAndPadding; | 469 return child.maxPreferredLogicalWidth() - borderAndPadding; |
470 } | 470 } |
471 return child.computeLogicalWidthUsing(sizeType, size, contentLogicalWidth(),
this) - borderAndPadding; | 471 return child.computeLogicalWidthUsing(sizeType, size, contentLogicalWidth(),
this) - borderAndPadding; |
472 } | 472 } |
473 | 473 |
474 LayoutFlexibleBox::TransformedWritingMode LayoutFlexibleBox::transformedWritingM
ode() const | 474 LayoutFlexibleBox::TransformedWritingMode LayoutFlexibleBox::transformedWritingM
ode() const |
475 { | 475 { |
476 WritingMode mode = style()->writingMode(); | 476 WritingMode mode = style()->getWritingMode(); |
477 if (!isColumnFlow()) { | 477 if (!isColumnFlow()) { |
478 static_assert(static_cast<TransformedWritingMode>(TopToBottomWritingMode
) == TransformedWritingMode::TopToBottomWritingMode | 478 static_assert(static_cast<TransformedWritingMode>(TopToBottomWritingMode
) == TransformedWritingMode::TopToBottomWritingMode |
479 && static_cast<TransformedWritingMode>(LeftToRightWritingMode) == Tr
ansformedWritingMode::LeftToRightWritingMode | 479 && static_cast<TransformedWritingMode>(LeftToRightWritingMode) == Tr
ansformedWritingMode::LeftToRightWritingMode |
480 && static_cast<TransformedWritingMode>(RightToLeftWritingMode) == Tr
ansformedWritingMode::RightToLeftWritingMode, | 480 && static_cast<TransformedWritingMode>(RightToLeftWritingMode) == Tr
ansformedWritingMode::RightToLeftWritingMode, |
481 "WritingMode and TransformedWritingMode must match values."); | 481 "WritingMode and TransformedWritingMode must match values."); |
482 return static_cast<TransformedWritingMode>(mode); | 482 return static_cast<TransformedWritingMode>(mode); |
483 } | 483 } |
484 | 484 |
485 switch (mode) { | 485 switch (mode) { |
486 case TopToBottomWritingMode: | 486 case TopToBottomWritingMode: |
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1662 ASSERT(child); | 1662 ASSERT(child); |
1663 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; | 1663 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; |
1664 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; | 1664 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; |
1665 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; | 1665 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; |
1666 adjustAlignmentForChild(*child, newOffset - originalOffset); | 1666 adjustAlignmentForChild(*child, newOffset - originalOffset); |
1667 } | 1667 } |
1668 } | 1668 } |
1669 } | 1669 } |
1670 | 1670 |
1671 } // namespace blink | 1671 } // namespace blink |
OLD | NEW |