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

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

Issue 2282213002: [LayoutNG] Introduce NGPhysicalFragment and make NGFragment a 'view' (Closed)
Patch Set: address comments. Created 4 years, 4 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_fragment_base.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment_base.h b/third_party/WebKit/Source/core/layout/ng/ng_fragment_base.h
index 621926cf5459c42e858012f6af4abea77404b8ec..9be8cd6cba693df2a8559e85fa418f3728caee71 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_fragment_base.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment_base.h
@@ -14,49 +14,45 @@
namespace blink {
+class NGPhysicalFragmentBase;
+
class CORE_EXPORT NGFragmentBase : public GarbageCollected<NGFragmentBase> {
public:
- enum NGFragmentType { FragmentBox = 0, FragmentText = 1 };
-
- NGFragmentType Type() const { return static_cast<NGFragmentType>(type_); }
NGWritingMode WritingMode() const {
return static_cast<NGWritingMode>(writing_mode_);
}
NGDirection Direction() const { return static_cast<NGDirection>(direction_); }
// Returns the border-box size.
- LayoutUnit InlineSize() const { return size_.inline_size; }
- LayoutUnit BlockSize() const { return size_.block_size; }
+ LayoutUnit InlineSize() const;
+ LayoutUnit BlockSize() const;
// Returns the total size, including the contents outside of the border-box.
- LayoutUnit InlineOverflow() const { return overflow_.inline_size; }
- LayoutUnit BlockOverflow() const { return overflow_.block_size; }
+ LayoutUnit InlineOverflow() const;
+ LayoutUnit BlockOverflow() const;
// Returns the offset relative to the parent fragement's content-box.
- LayoutUnit InlineOffset() const { return offset_.inline_offset; }
- LayoutUnit BlockOffset() const { return offset_.block_offset; }
+ LayoutUnit InlineOffset() const;
+ LayoutUnit BlockOffset() const;
- // Should only be used by the parent fragement's layout.
- void SetOffset(LayoutUnit inline_offset, LayoutUnit block_offset);
+ NGPhysicalFragmentBase* PhysicalFragment() const {
+ return physical_fragment_;
+ };
- DEFINE_INLINE_TRACE_AFTER_DISPATCH() {}
DECLARE_TRACE();
protected:
- NGFragmentBase(NGLogicalSize size,
- NGLogicalSize overflow,
- NGWritingMode,
- NGDirection,
- NGFragmentType);
+ NGFragmentBase(NGWritingMode writing_mode,
+ NGDirection direction,
+ NGPhysicalFragmentBase* physical_fragment)
+ : physical_fragment_(physical_fragment),
+ writing_mode_(writing_mode),
+ direction_(direction) {}
- NGLogicalSize size_;
- NGLogicalSize overflow_;
- NGLogicalOffset offset_;
+ Member<NGPhysicalFragmentBase> physical_fragment_;
- unsigned type_ : 1;
unsigned writing_mode_ : 3;
unsigned direction_ : 1;
- unsigned has_been_placed_ : 1;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_fragment.h ('k') | third_party/WebKit/Source/core/layout/ng/ng_fragment_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698