summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/layout/ng/ng_container_fragment_builder.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/ng/ng_container_fragment_builder.h')
-rw-r--r--chromium/third_party/blink/renderer/core/layout/ng/ng_container_fragment_builder.h50
1 files changed, 20 insertions, 30 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/ng/ng_container_fragment_builder.h b/chromium/third_party/blink/renderer/core/layout/ng/ng_container_fragment_builder.h
index 2c2a2cc3f4b..443924478cf 100644
--- a/chromium/third_party/blink/renderer/core/layout/ng/ng_container_fragment_builder.h
+++ b/chromium/third_party/blink/renderer/core/layout/ng/ng_container_fragment_builder.h
@@ -86,6 +86,10 @@ class CORE_EXPORT NGContainerFragmentBuilder : public NGFragmentBuilder {
const ChildrenVector& Children() const { return children_; }
+ // Returns offset for given child. DCHECK if child not found.
+ // Warning: Do not call unless necessary.
+ NGLogicalOffset GetChildOffset(const LayoutObject* child);
+
// Builder has non-trivial out-of-flow descendant methods.
// These methods are building blocks for implementation of
// out-of-flow descendants by layout algorithms.
@@ -116,14 +120,8 @@ class CORE_EXPORT NGContainerFragmentBuilder : public NGFragmentBuilder {
// Pass in direction if candidates direction does not match.
NGContainerFragmentBuilder& AddOutOfFlowChildCandidate(
NGBlockNode,
- const NGLogicalOffset& child_offset);
-
- // Inline candidates are laid out line-relative, not fragment-relative.
- NGContainerFragmentBuilder& AddInlineOutOfFlowChildCandidate(
- NGBlockNode,
- const NGLogicalOffset& child_line_offset,
- TextDirection line_direction,
- LayoutObject* inline_container);
+ const NGLogicalOffset& child_offset,
+ base::Optional<TextDirection> container_direction = base::nullopt);
NGContainerFragmentBuilder& AddOutOfFlowDescendant(
NGOutOfFlowPositionedDescendant descendant);
@@ -166,6 +164,9 @@ class CORE_EXPORT NGContainerFragmentBuilder : public NGFragmentBuilder {
#endif
protected:
+ friend class NGPhysicalContainerFragment;
+ friend class NGLayoutResult;
+
// An out-of-flow positioned-candidate is a temporary data structure used
// within the NGBoxFragmentBuilder.
//
@@ -184,30 +185,20 @@ class CORE_EXPORT NGContainerFragmentBuilder : public NGFragmentBuilder {
struct NGOutOfFlowPositionedCandidate {
NGOutOfFlowPositionedDescendant descendant;
NGLogicalOffset child_offset; // Logical offset of child's top left vertex.
- bool is_line_relative; // True if offset is relative to line, not fragment.
- TextDirection line_direction;
-
- NGOutOfFlowPositionedCandidate(
- NGOutOfFlowPositionedDescendant descendant_arg,
- NGLogicalOffset child_offset_arg)
- : descendant(descendant_arg),
- child_offset(child_offset_arg),
- is_line_relative(false) {}
-
- NGOutOfFlowPositionedCandidate(
- NGOutOfFlowPositionedDescendant descendant_arg,
- NGLogicalOffset child_offset_arg,
- TextDirection line_direction_arg)
- : descendant(descendant_arg),
- child_offset(child_offset_arg),
- is_line_relative(true),
- line_direction(line_direction_arg) {}
+
+ NGOutOfFlowPositionedCandidate(NGOutOfFlowPositionedDescendant descendant,
+ NGLogicalOffset child_offset)
+ : descendant(descendant), child_offset(child_offset) {}
};
- NGContainerFragmentBuilder(scoped_refptr<const ComputedStyle> style,
+ NGContainerFragmentBuilder(NGLayoutInputNode node,
+ scoped_refptr<const ComputedStyle> style,
WritingMode writing_mode,
TextDirection direction)
- : NGFragmentBuilder(std::move(style), writing_mode, direction) {}
+ : NGFragmentBuilder(std::move(style), writing_mode, direction),
+ node_(node) {}
+
+ NGLayoutInputNode node_;
LayoutUnit bfc_line_offset_;
base::Optional<LayoutUnit> bfc_block_offset_;
@@ -238,8 +229,7 @@ class CORE_EXPORT NGContainerFragmentBuilder : public NGFragmentBuilder {
bool is_pushed_by_floats_ = false;
bool has_orthogonal_flow_roots_ = false;
-
- friend class NGPhysicalContainerFragment;
+ bool has_depends_on_percentage_block_size_child_ = false;
};
} // namespace blink