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

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

Issue 2568743005: Place the out of flow positioned blocks (Closed)
Patch Set: skip failing tests Created 3 years, 11 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_out_of_flow_layout_part.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.h b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.h
new file mode 100644
index 0000000000000000000000000000000000000000..a4c66b84f0984aa9ba624a05ea27506c8870a059
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.h
@@ -0,0 +1,72 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NGOutOfFlowLayoutPart_h
+#define NGOutOfFlowLayoutPart_h
+
+#include "core/CoreExport.h"
+
+#include "core/layout/ng/ng_units.h"
+#include "core/layout/ng/ng_constraint_space.h"
+#include "core/layout/ng/ng_absolute_utils.h"
+#include "core/layout/ng/ng_layout_algorithm.h"
+#include "platform/heap/Handle.h"
+#include "wtf/Optional.h"
+
+namespace blink {
+
+class ComputedStyle;
+class NGBlockNode;
+class NGFragmentBase;
+class NGConstraintSpace;
+
+// Helper class for positioning of out-of-flow blocks.
+// It should be used together with NGFragmentBuilder.
+// See NGFragmentBuilder::AddOutOfFlowChildCandidate documentation
+// for example of using these classes together.
+class CORE_EXPORT NGOutOfFlowLayoutPart
+ : public GarbageCollectedFinalized<NGOutOfFlowLayoutPart> {
+ public:
+ NGOutOfFlowLayoutPart(PassRefPtr<const ComputedStyle>, NGLogicalSize);
+
+ // If false, this fragment should be passed up the tree for layout by
+ // an ancestor.
+ bool StartLayout(NGBlockNode*, const NGStaticPosition&);
+ NGLayoutStatus Layout(NGFragmentBase**, NGLogicalOffset*);
+
+ DECLARE_TRACE();
+
+ private:
+ bool ComputeInlineSizeEstimate();
+ bool ComputeBlockSizeEstimate();
+ bool ComputeNodeFragment();
+
+ bool contains_fixed_;
+ bool contains_absolute_;
+
+ enum State {
+ kComputeInlineEstimate,
+ kPartialPosition,
+ kComputeBlockEstimate,
+ kFullPosition,
+ kGenerateFragment,
+ kDone
+ };
+ State state_;
+
+ NGStaticPosition static_position_;
+ NGLogicalOffset parent_offset_;
+ NGPhysicalOffset parent_physical_offset_;
+ Member<NGConstraintSpace> parent_space_;
+ Member<NGBlockNode> node_;
+ Member<NGConstraintSpace> node_space_;
+ Member<NGFragmentBase> node_fragment_;
+ NGAbsolutePhysicalPosition node_position_;
+ Optional<LayoutUnit> inline_estimate_;
+ Optional<LayoutUnit> block_estimate_;
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698