| 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 NGPhysicalFragmentBase_h | 5 #ifndef NGPhysicalFragmentBase_h |
| 6 #define NGPhysicalFragmentBase_h | 6 #define NGPhysicalFragmentBase_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/ng/ng_break_token.h" | 9 #include "core/layout/ng/ng_break_token.h" |
| 10 #include "core/layout/ng/ng_constraint_space.h" | 10 #include "core/layout/ng/ng_constraint_space.h" |
| 11 #include "core/layout/ng/ng_units.h" | 11 #include "core/layout/ng/ng_units.h" |
| 12 #include "platform/LayoutUnit.h" | 12 #include "platform/LayoutUnit.h" |
| 13 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
| 14 #include "wtf/Vector.h" | 14 #include "wtf/Vector.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 // The NGPhysicalFragmentBase contains the output information from layout. The | 18 // The NGPhysicalFragmentBase contains the output information from layout. The |
| 19 // fragment stores all of its information in the physical coordinate system for | 19 // fragment stores all of its information in the physical coordinate system for |
| 20 // use by paint, hit-testing etc. | 20 // use by paint, hit-testing etc. |
| 21 // | 21 // |
| 22 // Layout code should only access output layout information through the | 22 // Layout code should only access output layout information through the |
| 23 // NGFragmentBase classes which transforms information into the logical | 23 // NGFragmentBase classes which transforms information into the logical |
| 24 // coordinate system. | 24 // coordinate system. |
| 25 class CORE_EXPORT NGPhysicalFragmentBase | 25 class CORE_EXPORT NGPhysicalFragmentBase |
| 26 : public GarbageCollectedFinalized<NGPhysicalFragmentBase> { | 26 : public GarbageCollectedFinalized<NGPhysicalFragmentBase> { |
| 27 public: | 27 public: |
| 28 enum NGFragmentType { FragmentBox = 0, FragmentText = 1 }; | 28 enum NGFragmentType { kFragmentBox = 0, kFragmentText = 1 }; |
| 29 | 29 |
| 30 NGFragmentType Type() const { return static_cast<NGFragmentType>(type_); } | 30 NGFragmentType Type() const { return static_cast<NGFragmentType>(type_); } |
| 31 | 31 |
| 32 // The accessors in this class shouldn't be used by layout code directly, | 32 // The accessors in this class shouldn't be used by layout code directly, |
| 33 // instead should be accessed by the NGFragmentBase classes. These accessors | 33 // instead should be accessed by the NGFragmentBase classes. These accessors |
| 34 // exist for paint, hit-testing, etc. | 34 // exist for paint, hit-testing, etc. |
| 35 | 35 |
| 36 // Returns the border-box size. | 36 // Returns the border-box size. |
| 37 NGPhysicalSize Size() const { return size_; } | 37 NGPhysicalSize Size() const { return size_; } |
| 38 LayoutUnit Width() const { return size_.width; } | 38 LayoutUnit Width() const { return size_.width; } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 NGPhysicalOffset offset_; | 81 NGPhysicalOffset offset_; |
| 82 Member<NGBreakToken> break_token_; | 82 Member<NGBreakToken> break_token_; |
| 83 | 83 |
| 84 unsigned type_ : 1; | 84 unsigned type_ : 1; |
| 85 unsigned has_been_placed_ : 1; | 85 unsigned has_been_placed_ : 1; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace blink | 88 } // namespace blink |
| 89 | 89 |
| 90 #endif // NGFragmentBase_h | 90 #endif // NGFragmentBase_h |
| OLD | NEW |