Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_inline_node.h

Issue 2706403008: [LayoutNG] Implement ComputeMinAndMaxContentSizes for inline (Closed)
Patch Set: Change the way to load ahem to make asan bot happy Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/ng/ng_layout_input_node.h" 9 #include "core/layout/ng/ng_layout_input_node.h"
10 #include "platform/fonts/FontFallbackPriority.h" 10 #include "platform/fonts/FontFallbackPriority.h"
11 #include "platform/fonts/shaping/ShapeResult.h" 11 #include "platform/fonts/shaping/ShapeResult.h"
12 #include "platform/heap/Handle.h" 12 #include "platform/heap/Handle.h"
13 #include "platform/text/TextDirection.h" 13 #include "platform/text/TextDirection.h"
14 #include "wtf/text/WTFString.h" 14 #include "wtf/text/WTFString.h"
15 15
16 #include <unicode/ubidi.h> 16 #include <unicode/ubidi.h>
17 #include <unicode/uscript.h> 17 #include <unicode/uscript.h>
18 18
19 namespace blink { 19 namespace blink {
20 20
21 class ComputedStyle; 21 class ComputedStyle;
22 class LayoutBlockFlow; 22 class LayoutBlockFlow;
23 class LayoutObject; 23 class LayoutObject;
24 class LayoutUnit; 24 class LayoutUnit;
25 struct MinAndMaxContentSizes;
25 class NGConstraintSpace; 26 class NGConstraintSpace;
26 class NGLayoutInlineItem; 27 class NGLayoutInlineItem;
27 class NGLayoutInlineItemRange; 28 class NGLayoutInlineItemRange;
28 class NGLayoutInlineItemsBuilder; 29 class NGLayoutInlineItemsBuilder;
29 class NGLayoutResult; 30 class NGLayoutResult;
30 class NGLineBuilder; 31 class NGLineBuilder;
31 32
32 // Represents an inline node to be laid out. 33 // Represents an inline node to be laid out.
33 class CORE_EXPORT NGInlineNode : public NGLayoutInputNode { 34 class CORE_EXPORT NGInlineNode : public NGLayoutInputNode {
34 public: 35 public:
35 NGInlineNode(LayoutObject* start_inline, const ComputedStyle* block_style); 36 NGInlineNode(LayoutObject* start_inline, const ComputedStyle* block_style);
36 ~NGInlineNode() override; 37 ~NGInlineNode() override;
37 38
38 const ComputedStyle* BlockStyle() const { return block_style_.get(); } 39 const ComputedStyle* BlockStyle() const { return block_style_.get(); }
39 40
40 RefPtr<NGLayoutResult> Layout(NGConstraintSpace*) override; 41 RefPtr<NGLayoutResult> Layout(NGConstraintSpace*) override;
41 void LayoutInline(NGConstraintSpace*, NGLineBuilder*); 42 void LayoutInline(NGConstraintSpace*, NGLineBuilder*);
43 MinAndMaxContentSizes ComputeMinAndMaxContentSizes();
cbiesinger 2017/02/27 23:16:16 Please add a comment for this function, as well.
kojii 2017/02/28 03:30:37 Done.
42 NGInlineNode* NextSibling() override; 44 NGInlineNode* NextSibling() override;
43 LayoutObject* GetLayoutObject() override; 45 LayoutObject* GetLayoutObject() override;
44 46
45 // Prepare inline and text content for layout. Must be called before 47 // Prepare inline and text content for layout. Must be called before
46 // calling the Layout method. 48 // calling the Layout method.
cbiesinger 2017/02/27 23:16:16 LayoutInline calls this function itself. Should it
kojii 2017/02/28 03:30:37 Done.
47 void PrepareLayout(); 49 void PrepareLayout();
48 50
51 bool IsPrepareLayoutFinished() const { return !items_.isEmpty(); }
52 void InvalidatePrepareLayout();
53
49 const String& Text() const { return text_content_; } 54 const String& Text() const { return text_content_; }
50 String Text(unsigned start_offset, unsigned end_offset) const { 55 String Text(unsigned start_offset, unsigned end_offset) const {
51 return text_content_.substring(start_offset, end_offset); 56 return text_content_.substring(start_offset, end_offset);
52 } 57 }
53 58
54 Vector<NGLayoutInlineItem>& Items() { return items_; } 59 Vector<NGLayoutInlineItem>& Items() { return items_; }
55 NGLayoutInlineItemRange Items(unsigned start_index, unsigned end_index); 60 NGLayoutInlineItemRange Items(unsigned start_index, unsigned end_index);
56 61
57 LayoutBlockFlow* GetLayoutBlockFlow() const; 62 LayoutBlockFlow* GetLayoutBlockFlow() const;
58 void GetLayoutTextOffsets(Vector<unsigned, 32>*); 63 void GetLayoutTextOffsets(Vector<unsigned, 32>*);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 217
213 private: 218 private:
214 NGLayoutInlineItem* start_item_; 219 NGLayoutInlineItem* start_item_;
215 unsigned size_; 220 unsigned size_;
216 unsigned start_index_; 221 unsigned start_index_;
217 }; 222 };
218 223
219 } // namespace blink 224 } // namespace blink
220 225
221 #endif // NGInlineNode_h 226 #endif // NGInlineNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698