OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_fragment.h" | 5 #include "core/layout/ng/ng_fragment.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 LayoutUnit NGFragment::InlineSize() const { | 9 LayoutUnit NGFragment::InlineSize() const { |
10 return writing_mode_ == kHorizontalTopBottom ? physical_fragment_->Width() | 10 return writing_mode_ == kHorizontalTopBottom ? physical_fragment_->Width() |
11 : physical_fragment_->Height(); | 11 : physical_fragment_->Height(); |
12 } | 12 } |
13 | 13 |
14 LayoutUnit NGFragment::BlockSize() const { | 14 LayoutUnit NGFragment::BlockSize() const { |
15 return writing_mode_ == kHorizontalTopBottom ? physical_fragment_->Height() | 15 return writing_mode_ == kHorizontalTopBottom ? physical_fragment_->Height() |
16 : physical_fragment_->Width(); | 16 : physical_fragment_->Width(); |
17 } | 17 } |
18 | 18 |
19 LayoutUnit NGFragment::InlineOverflow() const { | |
20 return writing_mode_ == kHorizontalTopBottom | |
21 ? physical_fragment_->WidthOverflow() | |
22 : physical_fragment_->HeightOverflow(); | |
23 } | |
24 | |
25 LayoutUnit NGFragment::BlockOverflow() const { | |
26 return writing_mode_ == kHorizontalTopBottom | |
27 ? physical_fragment_->HeightOverflow() | |
28 : physical_fragment_->WidthOverflow(); | |
29 } | |
30 | |
31 LayoutUnit NGFragment::InlineOffset() const { | 19 LayoutUnit NGFragment::InlineOffset() const { |
32 return writing_mode_ == kHorizontalTopBottom | 20 return writing_mode_ == kHorizontalTopBottom |
33 ? physical_fragment_->LeftOffset() | 21 ? physical_fragment_->LeftOffset() |
34 : physical_fragment_->TopOffset(); | 22 : physical_fragment_->TopOffset(); |
35 } | 23 } |
36 | 24 |
37 LayoutUnit NGFragment::BlockOffset() const { | 25 LayoutUnit NGFragment::BlockOffset() const { |
38 return writing_mode_ == kHorizontalTopBottom | 26 return writing_mode_ == kHorizontalTopBottom |
39 ? physical_fragment_->TopOffset() | 27 ? physical_fragment_->TopOffset() |
40 : physical_fragment_->LeftOffset(); | 28 : physical_fragment_->LeftOffset(); |
41 } | 29 } |
42 | 30 |
43 NGPhysicalFragment::NGFragmentType NGFragment::Type() const { | 31 NGPhysicalFragment::NGFragmentType NGFragment::Type() const { |
44 return physical_fragment_->Type(); | 32 return physical_fragment_->Type(); |
45 } | 33 } |
46 | 34 |
47 } // namespace blink | 35 } // namespace blink |
OLD | NEW |