Chromium Code Reviews| 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..fc89a809605bf67a76f95ea4d09817807de9b7bb |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.h |
| @@ -0,0 +1,67 @@ |
| +// 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 "platform/heap/Handle.h" |
| +#include "wtf/Optional.h" |
| + |
| +namespace blink { |
| + |
| +class ComputedStyle; |
| +class NGBlockNode; |
| +class NGFragmentBase; |
| +class NGConstraintSpace; |
| + |
| +class CORE_EXPORT NGOutOfFlowLayoutPart |
|
cbiesinger
2016/12/21 21:38:50
Can you add a comment to this class in general des
atotic
2016/12/28 19:36:46
done. Added comment, and modifed sample code in
N
|
| + : public GarbageCollectedFinalized<NGOutOfFlowLayoutPart> { |
| + public: |
| + NGOutOfFlowLayoutPart(PassRefPtr<const ComputedStyle>, NGLogicalSize); |
| + |
| + // @return true if layout can be performed. |
|
cbiesinger
2016/12/21 21:38:50
Add something like: "If false, this fragment shoul
atotic
2016/12/28 19:36:46
done
|
| + bool StartLayout(NGBlockNode*, const NGStaticPosition&); |
| + // @return true if layout is complete. |
| + bool Layout(NGFragmentBase**, NGLogicalOffset*); |
|
cbiesinger
2016/12/21 21:38:50
Here too consider using NGLayoutStatus
atotic
2016/12/28 19:36:46
done
|
| + |
| + 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 |