| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/layout/ng/ng_relative_utils.h" | 5 #include "core/layout/ng/ng_relative_utils.h" |
| 6 | 6 |
| 7 #include "core/layout/ng/geometry/ng_logical_offset.h" | 7 #include "core/layout/ng/geometry/ng_logical_offset.h" |
| 8 #include "core/layout/ng/geometry/ng_physical_size.h" | 8 #include "core/layout/ng/geometry/ng_physical_size.h" |
| 9 #include "core/style/ComputedStyle.h" | 9 #include "core/style/ComputedStyle.h" |
| 10 #include "platform/LengthFunctions.h" | 10 #include "platform/LengthFunctions.h" |
| 11 #include "wtf/Optional.h" | 11 #include "platform/wtf/Optional.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 // Returns the child's relative position wrt the containing fragment. | 15 // Returns the child's relative position wrt the containing fragment. |
| 16 NGLogicalOffset ComputeRelativeOffset(const ComputedStyle& child_style, | 16 NGLogicalOffset ComputeRelativeOffset(const ComputedStyle& child_style, |
| 17 NGWritingMode container_writing_mode, | 17 NGWritingMode container_writing_mode, |
| 18 TextDirection container_direction, | 18 TextDirection container_direction, |
| 19 NGLogicalSize container_logical_size) { | 19 NGLogicalSize container_logical_size) { |
| 20 NGLogicalOffset offset; | 20 NGLogicalOffset offset; |
| 21 NGPhysicalSize container_size = | 21 NGPhysicalSize container_size = |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 break; | 69 break; |
| 70 case kSidewaysLeftRight: | 70 case kSidewaysLeftRight: |
| 71 offset.inline_offset = is_ltr ? bottom.value() : top.value(); | 71 offset.inline_offset = is_ltr ? bottom.value() : top.value(); |
| 72 offset.block_offset = left.value(); | 72 offset.block_offset = left.value(); |
| 73 break; | 73 break; |
| 74 } | 74 } |
| 75 return offset; | 75 return offset; |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace blink | 78 } // namespace blink |
| OLD | NEW |