| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 int adjustmentWidth = verticalScrollbarWidth(); | 262 int adjustmentWidth = verticalScrollbarWidth(); |
| 263 int adjustmentHeight = horizontalScrollbarHeight(); | 263 int adjustmentHeight = horizontalScrollbarHeight(); |
| 264 if (!adjustmentWidth && !adjustmentHeight) | 264 if (!adjustmentWidth && !adjustmentHeight) |
| 265 return size; | 265 return size; |
| 266 | 266 |
| 267 EFlexDirection flexDirection = style()->flexDirection(); | 267 EFlexDirection flexDirection = style()->flexDirection(); |
| 268 TextDirection textDirection = style()->direction(); | 268 TextDirection textDirection = style()->direction(); |
| 269 WritingMode writingMode = style()->getWritingMode(); | 269 WritingMode writingMode = style()->getWritingMode(); |
| 270 | 270 |
| 271 if (flexDirection == FlowRow) { | 271 if (flexDirection == FlowRow) { |
| 272 if (textDirection == TextDirection::Rtl) { | 272 if (textDirection == TextDirection::kRtl) { |
| 273 if (blink::isHorizontalWritingMode(writingMode)) | 273 if (blink::isHorizontalWritingMode(writingMode)) |
| 274 size.expand(adjustmentWidth, 0); | 274 size.expand(adjustmentWidth, 0); |
| 275 else | 275 else |
| 276 size.expand(0, adjustmentHeight); | 276 size.expand(0, adjustmentHeight); |
| 277 } | 277 } |
| 278 if (isFlippedBlocksWritingMode(writingMode)) | 278 if (isFlippedBlocksWritingMode(writingMode)) |
| 279 size.expand(adjustmentWidth, 0); | 279 size.expand(adjustmentWidth, 0); |
| 280 } else if (flexDirection == FlowRowReverse) { | 280 } else if (flexDirection == FlowRowReverse) { |
| 281 if (textDirection == TextDirection::Ltr) { | 281 if (textDirection == TextDirection::kLtr) { |
| 282 if (blink::isHorizontalWritingMode(writingMode)) | 282 if (blink::isHorizontalWritingMode(writingMode)) |
| 283 size.expand(adjustmentWidth, 0); | 283 size.expand(adjustmentWidth, 0); |
| 284 else | 284 else |
| 285 size.expand(0, adjustmentHeight); | 285 size.expand(0, adjustmentHeight); |
| 286 } | 286 } |
| 287 if (isFlippedBlocksWritingMode(writingMode)) | 287 if (isFlippedBlocksWritingMode(writingMode)) |
| 288 size.expand(adjustmentWidth, 0); | 288 size.expand(adjustmentWidth, 0); |
| 289 } else if (flexDirection == FlowColumn) { | 289 } else if (flexDirection == FlowColumn) { |
| 290 if (isFlippedBlocksWritingMode(writingMode)) | 290 if (isFlippedBlocksWritingMode(writingMode)) |
| 291 size.expand(adjustmentWidth, 0); | 291 size.expand(adjustmentWidth, 0); |
| (...skipping 312 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>(WritingMode::HorizontalTb) == | 614 static_cast<TransformedWritingMode>(WritingMode::kHorizontalTb) == |
| 615 TransformedWritingMode::TopToBottomWritingMode && | 615 TransformedWritingMode::TopToBottomWritingMode && |
| 616 static_cast<TransformedWritingMode>(WritingMode::VerticalLr) == | 616 static_cast<TransformedWritingMode>(WritingMode::kVerticalLr) == |
| 617 TransformedWritingMode::LeftToRightWritingMode && | 617 TransformedWritingMode::LeftToRightWritingMode && |
| 618 static_cast<TransformedWritingMode>(WritingMode::VerticalRl) == | 618 static_cast<TransformedWritingMode>(WritingMode::kVerticalRl) == |
| 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 WritingMode::HorizontalTb: | 625 case WritingMode::kHorizontalTb: |
| 626 return style()->isLeftToRightDirection() | 626 return style()->isLeftToRightDirection() |
| 627 ? TransformedWritingMode::LeftToRightWritingMode | 627 ? TransformedWritingMode::LeftToRightWritingMode |
| 628 : TransformedWritingMode::RightToLeftWritingMode; | 628 : TransformedWritingMode::RightToLeftWritingMode; |
| 629 case WritingMode::VerticalLr: | 629 case WritingMode::kVerticalLr: |
| 630 case WritingMode::VerticalRl: | 630 case WritingMode::kVerticalRl: |
| 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 |