diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 10:22:43 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 12:36:28 +0000 |
commit | 271a6c3487a14599023a9106329505597638d793 (patch) | |
tree | e040d58ffc86c1480b79ca8528020ca9ec919bf8 /chromium/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.h | |
parent | 7b2ffa587235a47d4094787d72f38102089f402a (diff) | |
download | qtwebengine-chromium-271a6c3487a14599023a9106329505597638d793.tar.gz |
BASELINE: Update Chromium to 77.0.3865.59
Change-Id: I1e89a5f3b009a9519a6705102ad65c92fe736f21
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.h | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.h b/chromium/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.h new file mode 100644 index 00000000000..926c3395f48 --- /dev/null +++ b/chromium/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.h @@ -0,0 +1,100 @@ +// Copyright 2017 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 THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_BLOCK_FLOW_MIXIN_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_BLOCK_FLOW_MIXIN_H_ + +#include <type_traits> + +#include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/layout_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_box_model_object.h" +#include "third_party/blink/renderer/core/layout/layout_table_caption.h" +#include "third_party/blink/renderer/core/layout/layout_table_cell.h" +#include "third_party/blink/renderer/core/layout/ng/layout_ng_mixin.h" +#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" + +namespace blink { + +enum class NGBaselineAlgorithmType; +class NGPaintFragment; +class NGPhysicalFragment; +struct NGInlineNodeData; + +// This mixin holds code shared between LayoutNG subclasses of LayoutBlockFlow. +template <typename Base> +class LayoutNGBlockFlowMixin : public LayoutNGMixin<Base> { + public: + explicit LayoutNGBlockFlowMixin(Element* element); + ~LayoutNGBlockFlowMixin() override; + + NGInlineNodeData* TakeNGInlineNodeData() final; + NGInlineNodeData* GetNGInlineNodeData() const final; + void ResetNGInlineNodeData() final; + void ClearNGInlineNodeData() final; + bool HasNGInlineNodeData() const final { return ng_inline_node_data_.get(); } + + LayoutUnit FirstLineBoxBaseline() const final; + LayoutUnit InlineBlockBaseline(LineDirectionMode) const final; + + void Paint(const PaintInfo&) const final; + + bool NodeAtPoint(HitTestResult&, + const HitTestLocation&, + const PhysicalOffset& accumulated_offset, + HitTestAction) final; + + PositionWithAffinity PositionForPoint(const PhysicalOffset&) const override; + + const NGPaintFragment* PaintFragment() const final { + // TODO(layout-dev) crbug.com/963103 + // Safer option here is to return nullptr only if + // Lifecycle > DocumentLifecycle::kAfterPerformLayout, but this breaks + // some layout tests. + if (Base::NeedsLayout()) + return nullptr; + return paint_fragment_.get(); + } + void SetPaintFragment(const NGBlockBreakToken*, + scoped_refptr<const NGPhysicalFragment>) final; + + protected: + void StyleDidChange(StyleDifference, const ComputedStyle* old_style) override; + + const NGPhysicalBoxFragment* CurrentFragment() const final; + + void AddLayoutOverflowFromChildren() final; + + void AddOutlineRects(Vector<PhysicalRect>&, + const PhysicalOffset& additional_offset, + NGOutlineType) const final; + + bool PaintedOutputOfObjectHasNoEffectRegardlessOfSize() const final; + + base::Optional<LayoutUnit> FragmentBaseline(NGBaselineAlgorithmType) const; + + void DirtyLinesFromChangedChild(LayoutObject* child, + MarkingBehavior marking_behavior) final; + + std::unique_ptr<NGInlineNodeData> ng_inline_node_data_; + scoped_refptr<NGPaintFragment> paint_fragment_; + + friend class NGBaseLayoutAlgorithmTest; + + private: + void AddScrollingOverflowFromChildren(); +}; + +// If you edit these export templates, also update templates in +// layout_ng_mixin.h. +extern template class CORE_EXTERN_TEMPLATE_EXPORT + LayoutNGBlockFlowMixin<LayoutBlockFlow>; +extern template class CORE_EXTERN_TEMPLATE_EXPORT + LayoutNGBlockFlowMixin<LayoutTableCaption>; +extern template class CORE_EXTERN_TEMPLATE_EXPORT + LayoutNGBlockFlowMixin<LayoutTableCell>; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_BLOCK_FLOW_MIXIN_H_ |