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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 return child.computeLogicalWidthUsing(sizeType, size, contentLogicalWidth(), | 604 return child.computeLogicalWidthUsing(sizeType, size, contentLogicalWidth(), |
605 this) - | 605 this) - |
606 borderAndPadding; | 606 borderAndPadding; |
607 } | 607 } |
608 | 608 |
609 LayoutFlexibleBox::TransformedWritingMode | 609 LayoutFlexibleBox::TransformedWritingMode |
610 LayoutFlexibleBox::getTransformedWritingMode() const { | 610 LayoutFlexibleBox::getTransformedWritingMode() const { |
611 WritingMode mode = style()->getWritingMode(); | 611 WritingMode mode = style()->getWritingMode(); |
612 if (!isColumnFlow()) { | 612 if (!isColumnFlow()) { |
613 static_assert( | 613 static_assert( |
614 static_cast<TransformedWritingMode>(TopToBottomWritingMode) == | 614 static_cast<TransformedWritingMode>(WritingMode::HorizontalTb) == |
615 TransformedWritingMode::TopToBottomWritingMode && | 615 TransformedWritingMode::TopToBottomWritingMode && |
616 static_cast<TransformedWritingMode>(LeftToRightWritingMode) == | 616 static_cast<TransformedWritingMode>(WritingMode::VerticalLr) == |
617 TransformedWritingMode::LeftToRightWritingMode && | 617 TransformedWritingMode::LeftToRightWritingMode && |
618 static_cast<TransformedWritingMode>(RightToLeftWritingMode) == | 618 static_cast<TransformedWritingMode>(WritingMode::VerticalRl) == |
619 TransformedWritingMode::RightToLeftWritingMode, | 619 TransformedWritingMode::RightToLeftWritingMode, |
620 "WritingMode and TransformedWritingMode must match values."); | 620 "WritingMode and TransformedWritingMode must match values."); |
621 return static_cast<TransformedWritingMode>(mode); | 621 return static_cast<TransformedWritingMode>(mode); |
622 } | 622 } |
623 | 623 |
624 switch (mode) { | 624 switch (mode) { |
625 case TopToBottomWritingMode: | 625 case WritingMode::HorizontalTb: |
626 return style()->isLeftToRightDirection() | 626 return style()->isLeftToRightDirection() |
627 ? TransformedWritingMode::LeftToRightWritingMode | 627 ? TransformedWritingMode::LeftToRightWritingMode |
628 : TransformedWritingMode::RightToLeftWritingMode; | 628 : TransformedWritingMode::RightToLeftWritingMode; |
629 case LeftToRightWritingMode: | 629 case WritingMode::VerticalLr: |
630 case RightToLeftWritingMode: | 630 case WritingMode::VerticalRl: |
631 return style()->isLeftToRightDirection() | 631 return style()->isLeftToRightDirection() |
632 ? TransformedWritingMode::TopToBottomWritingMode | 632 ? TransformedWritingMode::TopToBottomWritingMode |
633 : TransformedWritingMode::BottomToTopWritingMode; | 633 : TransformedWritingMode::BottomToTopWritingMode; |
634 } | 634 } |
635 NOTREACHED(); | 635 NOTREACHED(); |
636 return TransformedWritingMode::TopToBottomWritingMode; | 636 return TransformedWritingMode::TopToBottomWritingMode; |
637 } | 637 } |
638 | 638 |
639 LayoutUnit LayoutFlexibleBox::flowAwareBorderStart() const { | 639 LayoutUnit LayoutFlexibleBox::flowAwareBorderStart() const { |
640 if (isHorizontalFlow()) | 640 if (isHorizontalFlow()) |
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2183 LayoutUnit originalOffset = | 2183 LayoutUnit originalOffset = |
2184 lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; | 2184 lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; |
2185 LayoutUnit newOffset = | 2185 LayoutUnit newOffset = |
2186 contentExtent - originalOffset - lineCrossAxisExtent; | 2186 contentExtent - originalOffset - lineCrossAxisExtent; |
2187 adjustAlignmentForChild(*flexItem.box, newOffset - originalOffset); | 2187 adjustAlignmentForChild(*flexItem.box, newOffset - originalOffset); |
2188 } | 2188 } |
2189 } | 2189 } |
2190 } | 2190 } |
2191 | 2191 |
2192 } // namespace blink | 2192 } // namespace blink |
OLD | NEW |