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