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

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

Issue 2702403003: [layoutng] Split NGLayoutResult out of NGPhysicalFragment (Closed)
Patch Set: rebased Created 3 years, 10 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 NGLayoutInputNode_h 5 #ifndef NGLayoutInputNode_h
6 #define NGLayoutInputNode_h 6 #define NGLayoutInputNode_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "platform/heap/Handle.h" 9 #include "platform/heap/Handle.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 class LayoutObject; 13 class LayoutObject;
14 class NGConstraintSpace; 14 class NGConstraintSpace;
15 class NGPhysicalFragment; 15 class NGLayoutResult;
16 16
17 // Represents the input to a layout algorithm for a given node. The layout 17 // Represents the input to a layout algorithm for a given node. The layout
18 // engine should use the style, node type to determine which type of layout 18 // engine should use the style, node type to determine which type of layout
19 // algorithm to use to produce fragments for this node. 19 // algorithm to use to produce fragments for this node.
20 class CORE_EXPORT NGLayoutInputNode 20 class CORE_EXPORT NGLayoutInputNode
21 : public GarbageCollectedFinalized<NGLayoutInputNode> { 21 : public GarbageCollectedFinalized<NGLayoutInputNode> {
22 public: 22 public:
23 enum NGLayoutInputNodeType { kLegacyBlock = 0, kLegacyInline = 1 }; 23 enum NGLayoutInputNodeType { kLegacyBlock = 0, kLegacyInline = 1 };
24 24
25 virtual ~NGLayoutInputNode(){}; 25 virtual ~NGLayoutInputNode(){};
26 26
27 // Performs layout on this input node, will return a new fragment. 27 // Performs layout on this input node, will return the layout result.
28 virtual RefPtr<NGPhysicalFragment> Layout(NGConstraintSpace*) = 0; 28 virtual RefPtr<NGLayoutResult> Layout(NGConstraintSpace*) = 0;
29 29
30 // Returns the next sibling. 30 // Returns the next sibling.
31 virtual NGLayoutInputNode* NextSibling() = 0; 31 virtual NGLayoutInputNode* NextSibling() = 0;
32 32
33 // Returns the LayoutObject which is associated with this node. 33 // Returns the LayoutObject which is associated with this node.
34 virtual LayoutObject* GetLayoutObject() = 0; 34 virtual LayoutObject* GetLayoutObject() = 0;
35 35
36 NGLayoutInputNodeType Type() const { 36 NGLayoutInputNodeType Type() const {
37 return static_cast<NGLayoutInputNodeType>(type_); 37 return static_cast<NGLayoutInputNodeType>(type_);
38 } 38 }
39 39
40 DEFINE_INLINE_VIRTUAL_TRACE() {} 40 DEFINE_INLINE_VIRTUAL_TRACE() {}
41 41
42 protected: 42 protected:
43 explicit NGLayoutInputNode(NGLayoutInputNodeType type) : type_(type) {} 43 explicit NGLayoutInputNode(NGLayoutInputNodeType type) : type_(type) {}
44 44
45 private: 45 private:
46 unsigned type_ : 1; 46 unsigned type_ : 1;
47 }; 47 };
48 48
49 } // namespace blink 49 } // namespace blink
50 50
51 #endif // NGLayoutInputNode_h 51 #endif // NGLayoutInputNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698