blob: 9f5f30ba0d9d7196379b3dc6087748b52cc96edf [file] [log] [blame]
// 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 NGBlockLayoutAlgorithm_h
#define NGBlockLayoutAlgorithm_h
#include "core/CoreExport.h"
#include "core/layout/ng/ng_box.h"
#include "wtf/RefPtr.h"
namespace blink {
class ComputedStyle;
class NGConstraintSpace;
class NGFragment;
// A class for general block layout (e.g. a <div> with no special style).
// Lays out the children in sequence.
class CORE_EXPORT NGBlockLayoutAlgorithm {
public:
NGBlockLayoutAlgorithm(PassRefPtr<const ComputedStyle>, NGBox);
// Actual layout implementation. Lays out the children in sequence within the
// constraints given by the NGConstraintSpace. Returns a fragment with the
// resulting layout information.
// This function can not be const because for interruptible layout, we have
// to be able to store state information.
NGFragment* layout(const NGConstraintSpace&);
private:
RefPtr<const ComputedStyle> m_style;
NGBox m_firstChild;
};
} // namespace blink
#endif // NGBlockLayoutAlgorithm_h