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_node.h" | 5 #include "core/layout/ng/inline/ng_inline_node.h" |
6 | 6 |
7 #include "core/layout/BidiRun.h" | 7 #include "core/layout/BidiRun.h" |
8 #include "core/layout/LayoutBlockFlow.h" | 8 #include "core/layout/LayoutBlockFlow.h" |
9 #include "core/layout/LayoutObject.h" | 9 #include "core/layout/LayoutObject.h" |
10 #include "core/layout/LayoutText.h" | 10 #include "core/layout/LayoutText.h" |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 .SetAvailableSize({available_inline_size, NGSizeIndefinite}) | 366 .SetAvailableSize({available_inline_size, NGSizeIndefinite}) |
367 .ToConstraintSpace(writing_mode); | 367 .ToConstraintSpace(writing_mode); |
368 | 368 |
369 NGFragmentBuilder container_builder( | 369 NGFragmentBuilder container_builder( |
370 NGPhysicalFragment::NGFragmentType::kFragmentBox, node); | 370 NGPhysicalFragment::NGFragmentType::kFragmentBox, node); |
371 | 371 |
372 NGLineBreaker line_breaker(node, space.Get(), &container_builder); | 372 NGLineBreaker line_breaker(node, space.Get(), &container_builder); |
373 NGLineInfo line_info; | 373 NGLineInfo line_info; |
374 LayoutUnit result; | 374 LayoutUnit result; |
375 while (line_breaker.NextLine(&line_info, NGLogicalOffset())) { | 375 while (line_breaker.NextLine(&line_info, NGLogicalOffset())) { |
376 LayoutUnit inline_size; | 376 LayoutUnit inline_size = line_info.TextIndent(); |
377 for (const NGInlineItemResult item_result : line_info.Results()) | 377 for (const NGInlineItemResult item_result : line_info.Results()) |
378 inline_size += item_result.inline_size; | 378 inline_size += item_result.inline_size; |
379 if (mode == ContentSizeMode::Max) { | 379 if (mode == ContentSizeMode::Max) { |
380 result = std::max(inline_size, result); | 380 result = std::max(inline_size, result); |
381 } else { | 381 } else { |
382 result += inline_size; | 382 result += inline_size; |
383 } | 383 } |
384 } | 384 } |
385 return result; | 385 return result; |
386 } | 386 } |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 item.Style() == item.GetLayoutObject()->Style()); | 526 item.Style() == item.GetLayoutObject()->Style()); |
527 } | 527 } |
528 #endif | 528 #endif |
529 } | 529 } |
530 | 530 |
531 String NGInlineNode::ToString() const { | 531 String NGInlineNode::ToString() const { |
532 return String::Format("NGInlineNode"); | 532 return String::Format("NGInlineNode"); |
533 } | 533 } |
534 | 534 |
535 } // namespace blink | 535 } // namespace blink |
OLD | NEW |