| 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 #ifndef NGInlineNode_h | 5 #ifndef NGInlineNode_h |
| 6 #define NGInlineNode_h | 6 #define NGInlineNode_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/LayoutBlockFlow.h" | 9 #include "core/layout/LayoutBlockFlow.h" |
| 10 #include "core/layout/ng/ng_layout_input_node.h" | 10 #include "core/layout/ng/ng_layout_input_node.h" |
| 11 #include "platform/fonts/FontFallbackPriority.h" | 11 #include "platform/fonts/FontFallbackPriority.h" |
| 12 #include "platform/fonts/shaping/ShapeResult.h" | 12 #include "platform/fonts/shaping/ShapeResult.h" |
| 13 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
| 14 #include "platform/text/TextDirection.h" | 14 #include "platform/text/TextDirection.h" |
| 15 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
| 16 | 16 |
| 17 #include <unicode/ubidi.h> | 17 #include <unicode/ubidi.h> |
| 18 #include <unicode/uscript.h> | 18 #include <unicode/uscript.h> |
| 19 | 19 |
| 20 namespace blink { | 20 namespace blink { |
| 21 | 21 |
| 22 class ComputedStyle; | 22 class ComputedStyle; |
| 23 class LayoutBlockFlow; | 23 class LayoutBlockFlow; |
| 24 class LayoutObject; | 24 class LayoutObject; |
| 25 class LayoutUnit; | 25 class LayoutUnit; |
| 26 struct MinMaxContentSize; | 26 struct MinMaxContentSize; |
| 27 class NGConstraintSpace; | 27 class NGConstraintSpace; |
| 28 class NGFragmentBuilder; | |
| 29 class NGLayoutInlineItem; | 28 class NGLayoutInlineItem; |
| 30 class NGLayoutInlineItemRange; | 29 class NGLayoutInlineItemRange; |
| 31 class NGLayoutInlineItemsBuilder; | 30 class NGLayoutInlineItemsBuilder; |
| 32 class NGLayoutResult; | 31 class NGLayoutResult; |
| 33 class NGLineBuilder; | 32 class NGLineBuilder; |
| 34 | 33 |
| 35 // Represents an anonymous block box to be laid out, that contains consecutive | 34 // Represents an anonymous block box to be laid out, that contains consecutive |
| 36 // inline nodes and their descendants. | 35 // inline nodes and their descendants. |
| 37 class CORE_EXPORT NGInlineNode : public NGLayoutInputNode { | 36 class CORE_EXPORT NGInlineNode : public NGLayoutInputNode { |
| 38 public: | 37 public: |
| 39 NGInlineNode(LayoutObject* start_inline, LayoutBlockFlow*); | 38 NGInlineNode(LayoutObject* start_inline, LayoutBlockFlow*); |
| 40 ~NGInlineNode() override; | 39 ~NGInlineNode() override; |
| 41 | 40 |
| 42 LayoutBlockFlow* GetLayoutBlockFlow() const { return block_; } | 41 LayoutBlockFlow* GetLayoutBlockFlow() const { return block_; } |
| 43 const ComputedStyle* BlockStyle() const { return block_->style(); } | 42 const ComputedStyle* BlockStyle() const { return block_->style(); } |
| 44 NGLayoutInputNode* NextSibling() override; | 43 NGLayoutInputNode* NextSibling() override; |
| 45 | 44 |
| 46 RefPtr<NGLayoutResult> Layout(NGConstraintSpace*, NGBreakToken*) override; | 45 RefPtr<NGLayoutResult> Layout(NGConstraintSpace*, NGBreakToken*) override; |
| 47 RefPtr<NGLayoutResult> Layout(NGConstraintSpace*, | |
| 48 NGFragmentBuilder*, | |
| 49 NGBreakToken*); | |
| 50 LayoutObject* GetLayoutObject() override; | 46 LayoutObject* GetLayoutObject() override; |
| 51 | 47 |
| 52 // Computes the value of min-content and max-content for this anonymous block | 48 // Computes the value of min-content and max-content for this anonymous block |
| 53 // box. min-content is the inline size when lines wrap at every break | 49 // box. min-content is the inline size when lines wrap at every break |
| 54 // opportunity, and max-content is when lines do not wrap at all. | 50 // opportunity, and max-content is when lines do not wrap at all. |
| 55 MinMaxContentSize ComputeMinMaxContentSize(); | 51 MinMaxContentSize ComputeMinMaxContentSize(); |
| 56 | 52 |
| 57 // Instruct to re-compute |PrepareLayout| on the next layout. | 53 // Instruct to re-compute |PrepareLayout| on the next layout. |
| 58 void InvalidatePrepareLayout(); | 54 void InvalidatePrepareLayout(); |
| 59 | 55 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 228 |
| 233 private: | 229 private: |
| 234 NGLayoutInlineItem* start_item_; | 230 NGLayoutInlineItem* start_item_; |
| 235 unsigned size_; | 231 unsigned size_; |
| 236 unsigned start_index_; | 232 unsigned start_index_; |
| 237 }; | 233 }; |
| 238 | 234 |
| 239 } // namespace blink | 235 } // namespace blink |
| 240 | 236 |
| 241 #endif // NGInlineNode_h | 237 #endif // NGInlineNode_h |
| OLD | NEW |