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/inline/ng_inline_layout_algorithm.h" | 5 #include "core/layout/ng/inline/ng_inline_layout_algorithm.h" |
6 | 6 |
7 #include "core/layout/ng/inline/ng_bidi_paragraph.h" | 7 #include "core/layout/ng/inline/ng_bidi_paragraph.h" |
8 #include "core/layout/ng/inline/ng_inline_break_token.h" | 8 #include "core/layout/ng/inline/ng_inline_break_token.h" |
9 #include "core/layout/ng/inline/ng_inline_node.h" | 9 #include "core/layout/ng/inline/ng_inline_node.h" |
10 #include "core/layout/ng/inline/ng_line_box_fragment.h" | 10 #include "core/layout/ng/inline/ng_line_box_fragment.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 origin_point.block_offset += content_size; | 49 origin_point.block_offset += content_size; |
50 return origin_point; | 50 return origin_point; |
51 } | 51 } |
52 } // namespace | 52 } // namespace |
53 | 53 |
54 NGInlineLayoutAlgorithm::NGInlineLayoutAlgorithm( | 54 NGInlineLayoutAlgorithm::NGInlineLayoutAlgorithm( |
55 NGInlineNode* inline_node, | 55 NGInlineNode* inline_node, |
56 NGConstraintSpace* space, | 56 NGConstraintSpace* space, |
57 NGInlineBreakToken* break_token) | 57 NGInlineBreakToken* break_token) |
58 : NGLayoutAlgorithm(inline_node, space, break_token), | 58 : NGLayoutAlgorithm(inline_node, space, break_token), |
59 container_builder_(NGPhysicalFragment::kFragmentBox, inline_node), | |
60 is_horizontal_writing_mode_( | 59 is_horizontal_writing_mode_( |
61 blink::IsHorizontalWritingMode(space->WritingMode())), | 60 blink::IsHorizontalWritingMode(space->WritingMode())), |
62 disallow_first_line_rules_(false), | 61 disallow_first_line_rules_(false), |
63 space_builder_(space) | 62 space_builder_(space) |
64 #if DCHECK_IS_ON() | 63 #if DCHECK_IS_ON() |
65 , | 64 , |
66 is_bidi_reordered_(false) | 65 is_bidi_reordered_(false) |
67 #endif | 66 #endif |
68 { | 67 { |
69 if (!is_horizontal_writing_mode_) | 68 if (!is_horizontal_writing_mode_) |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 | 563 |
565 // max-content is the width without any line wrapping. | 564 // max-content is the width without any line wrapping. |
566 // TODO(kojii): Implement hard breaks (<br> etc.) to break. | 565 // TODO(kojii): Implement hard breaks (<br> etc.) to break. |
567 for (const auto& item : Node()->Items()) | 566 for (const auto& item : Node()->Items()) |
568 sizes.max_content += InlineSize(item); | 567 sizes.max_content += InlineSize(item); |
569 | 568 |
570 return sizes; | 569 return sizes; |
571 } | 570 } |
572 | 571 |
573 } // namespace blink | 572 } // namespace blink |
OLD | NEW |