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

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

Issue 2714803002: [LayoutNG] Allow block-flow layout to be fragmented using new approach. (Closed)
Patch Set: rebase. 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 NGPhysicalFragment_h 5 #ifndef NGPhysicalFragment_h
6 #define NGPhysicalFragment_h 6 #define NGPhysicalFragment_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/layout/ng/ng_units.h" 9 #include "core/layout/ng/ng_units.h"
10 #include "platform/LayoutUnit.h" 10 #include "platform/LayoutUnit.h"
(...skipping 15 matching lines...) Expand all
26 // such that paint/hit-testing/etc don't modify it. 26 // such that paint/hit-testing/etc don't modify it.
27 // 27 //
28 // Layout code should only access geometry information through the 28 // Layout code should only access geometry information through the
29 // NGFragment wrapper classes which transforms information into the logical 29 // NGFragment wrapper classes which transforms information into the logical
30 // coordinate system. 30 // coordinate system.
31 class CORE_EXPORT NGPhysicalFragment : public RefCounted<NGPhysicalFragment> { 31 class CORE_EXPORT NGPhysicalFragment : public RefCounted<NGPhysicalFragment> {
32 public: 32 public:
33 enum NGFragmentType { kFragmentBox = 0, kFragmentText = 1 }; 33 enum NGFragmentType { kFragmentBox = 0, kFragmentText = 1 };
34 34
35 NGFragmentType Type() const { return static_cast<NGFragmentType>(type_); } 35 NGFragmentType Type() const { return static_cast<NGFragmentType>(type_); }
36 bool IsBox() const { return Type() == NGFragmentType::kFragmentBox; }
37 bool IsText() const { return Type() == NGFragmentType::kFragmentText; }
36 38
37 // Override RefCounted's deref() to ensure operator delete is called on the 39 // Override RefCounted's deref() to ensure operator delete is called on the
38 // appropriate subclass type. 40 // appropriate subclass type.
39 void deref() const { 41 void deref() const {
40 if (derefBase()) 42 if (derefBase())
41 destroy(); 43 destroy();
42 } 44 }
43 45
44 // The accessors in this class shouldn't be used by layout code directly, 46 // The accessors in this class shouldn't be used by layout code directly,
45 // instead should be accessed by the NGFragmentBase classes. These accessors 47 // instead should be accessed by the NGFragmentBase classes. These accessors
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 unsigned type_ : 1; 105 unsigned type_ : 1;
104 unsigned is_placed_ : 1; 106 unsigned is_placed_ : 1;
105 107
106 private: 108 private:
107 void destroy() const; 109 void destroy() const;
108 }; 110 };
109 111
110 } // namespace blink 112 } // namespace blink
111 113
112 #endif // NGPhysicalFragment_h 114 #endif // NGPhysicalFragment_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698