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

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

Issue 2764753007: [LayoutNG] Add NGLineBoxFragment (Closed)
Patch Set: Rebase again as other CLs landed faster 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h
index 871ad4be8ef296ce1130b6ce5d436574b27c3f20..b93a4adf21c53ed8c3366904c938a33d0f354f05 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h
@@ -32,11 +32,18 @@ class LayoutObject;
// coordinate system.
class CORE_EXPORT NGPhysicalFragment : public RefCounted<NGPhysicalFragment> {
public:
- enum NGFragmentType { kFragmentBox = 0, kFragmentText = 1 };
+ enum NGFragmentType {
+ kFragmentBox = 0,
+ kFragmentText = 1,
+ kFragmentLineBox = 2
+ // When adding new values, make sure the bit size of |type_| is large
+ // enough to store.
+ };
NGFragmentType Type() const { return static_cast<NGFragmentType>(type_); }
bool IsBox() const { return Type() == NGFragmentType::kFragmentBox; }
bool IsText() const { return Type() == NGFragmentType::kFragmentText; }
+ bool IsLineBox() const { return Type() == NGFragmentType::kFragmentLineBox; }
// Override RefCounted's deref() to ensure operator delete is called on the
// appropriate subclass type.
@@ -54,10 +61,6 @@ class CORE_EXPORT NGPhysicalFragment : public RefCounted<NGPhysicalFragment> {
LayoutUnit Width() const { return size_.width; }
LayoutUnit Height() const { return size_.height; }
- // Returns the total size, including the contents outside of the border-box.
- LayoutUnit WidthOverflow() const { return overflow_.width; }
- LayoutUnit HeightOverflow() const { return overflow_.height; }
-
// Returns the offset relative to the parent fragment's content-box.
LayoutUnit LeftOffset() const {
DCHECK(is_placed_);
@@ -96,17 +99,15 @@ class CORE_EXPORT NGPhysicalFragment : public RefCounted<NGPhysicalFragment> {
protected:
NGPhysicalFragment(LayoutObject* layout_object,
NGPhysicalSize size,
- NGPhysicalSize overflow,
NGFragmentType type,
RefPtr<NGBreakToken> break_token = nullptr);
LayoutObject* layout_object_;
NGPhysicalSize size_;
- NGPhysicalSize overflow_;
NGPhysicalOffset offset_;
RefPtr<NGBreakToken> break_token_;
- unsigned type_ : 1;
+ unsigned type_ : 2;
unsigned is_placed_ : 1;
private:

Powered by Google App Engine
This is Rietveld 408576698