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

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

Issue 2270983002: [layoutng] Add an NGFragmentBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove SwapChildren 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.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_fragment.h
index 5b5c13dd9085ab7f73538633feb68beb428327cb..5b493e8ca393244281652973a329521866056e85 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_fragment.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment.h
@@ -8,6 +8,7 @@
#include "core/CoreExport.h"
#include "core/layout/ng/ng_fragment_base.h"
#include "core/layout/ng/ng_constraint_space.h"
+#include "core/layout/ng/ng_units.h"
#include "platform/LayoutUnit.h"
#include "platform/heap/Handle.h"
#include "wtf/Vector.h"
@@ -16,31 +17,23 @@ namespace blink {
class CORE_EXPORT NGFragment final : public NGFragmentBase {
public:
- NGFragment(LayoutUnit inlineSize,
- LayoutUnit blockSize,
- LayoutUnit inlineOverflow,
- LayoutUnit blockOverflow,
+ // This modified the passed-in children vector.
+ NGFragment(NGLogicalSize size,
+ NGLogicalSize overflow,
NGWritingMode writingMode,
- NGDirection direction)
- : NGFragmentBase(inlineSize,
- blockSize,
- inlineOverflow,
- blockOverflow,
- writingMode,
- direction,
- FragmentBox) {}
+ NGDirection direction,
+ HeapVector<Member<const NGFragmentBase>>& children)
+ : NGFragmentBase(size, overflow, writingMode, direction, FragmentBox) {
+ children_.swap(children);
+ }
DEFINE_INLINE_TRACE_AFTER_DISPATCH() {
- visitor->trace(m_children);
+ visitor->trace(children_);
NGFragmentBase::traceAfterDispatch(visitor);
}
- void swapChildren(HeapVector<Member<const NGFragmentBase>>& children) {
- m_children.swap(children);
- }
-
private:
- HeapVector<Member<const NGFragmentBase>> m_children;
+ HeapVector<Member<const NGFragmentBase>> children_;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_box.cc ('k') | third_party/WebKit/Source/core/layout/ng/ng_fragment_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698