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

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

Issue 2702403003: [layoutng] Split NGLayoutResult out of NGPhysicalFragment (Closed)
Patch Set: rebased Created 3 years, 10 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.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc
index edf7f115b885acad6d29652aa9ee053e7024206a..da091be5bdce72abe151f69abc8c162070fcd91c 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc
@@ -78,10 +78,10 @@ void NGOutOfFlowLayoutPart::Run() {
if (IsContainingBlockForAbsoluteDescendant(container_style_,
descendant->Style())) {
NGLogicalOffset offset;
- RefPtr<NGPhysicalFragment> physical_fragment =
+ RefPtr<NGLayoutResult> result =
LayoutDescendant(*descendant, static_position, &offset);
// TODO(atotic) Need to adjust size of overflow rect per spec.
- container_builder_->AddChild(std::move(physical_fragment), offset);
+ container_builder_->AddChild(std::move(result), offset);
} else {
container_builder_->AddOutOfFlowDescendant(descendant, static_position);
}
@@ -95,7 +95,7 @@ void NGOutOfFlowLayoutPart::Run() {
}
}
-RefPtr<NGPhysicalFragment> NGOutOfFlowLayoutPart::LayoutDescendant(
+RefPtr<NGLayoutResult> NGOutOfFlowLayoutPart::LayoutDescendant(
NGBlockNode& descendant,
NGStaticPosition static_position,
NGLogicalOffset* offset) {
@@ -104,7 +104,7 @@ RefPtr<NGPhysicalFragment> NGOutOfFlowLayoutPart::LayoutDescendant(
// relative to the container's padding box.
static_position.offset -= container_border_physical_offset_;
- RefPtr<NGPhysicalFragment> physical_fragment = nullptr;
+ RefPtr<NGLayoutResult> layout_result = nullptr;
Optional<MinAndMaxContentSizes> inline_estimate;
Optional<LayoutUnit> block_estimate;
@@ -118,12 +118,12 @@ RefPtr<NGPhysicalFragment> NGOutOfFlowLayoutPart::LayoutDescendant(
inline_estimate);
if (AbsoluteNeedsChildBlockSize(descendant.Style())) {
- physical_fragment =
- GenerateFragment(descendant, block_estimate, node_position);
+ layout_result = GenerateFragment(descendant, block_estimate, node_position);
// TODO(ikilpatrick): the writing mode switching here looks wrong.
- NGBoxFragment fragment(container_space_->WritingMode(),
- toNGPhysicalBoxFragment(physical_fragment.get()));
+ NGBoxFragment fragment(
+ container_space_->WritingMode(),
+ toNGPhysicalBoxFragment(layout_result->PhysicalFragment().get()));
block_estimate = fragment.BlockSize();
}
@@ -133,12 +133,11 @@ RefPtr<NGPhysicalFragment> NGOutOfFlowLayoutPart::LayoutDescendant(
&node_position);
// Skip this step if we produced a fragment when estimating the block size.
- if (!physical_fragment) {
+ if (!layout_result) {
block_estimate =
node_position.size.ConvertToLogical(container_space_->WritingMode())
.block_size;
- physical_fragment =
- GenerateFragment(descendant, block_estimate, node_position);
+ layout_result = GenerateFragment(descendant, block_estimate, node_position);
}
// Compute logical offset, NGAbsolutePhysicalPosition is calculated relative
@@ -150,10 +149,10 @@ RefPtr<NGPhysicalFragment> NGOutOfFlowLayoutPart::LayoutDescendant(
offset->block_offset =
inset.block_start + container_border_offset_.block_offset;
- return physical_fragment;
+ return layout_result;
}
-RefPtr<NGPhysicalFragment> NGOutOfFlowLayoutPart::GenerateFragment(
+RefPtr<NGLayoutResult> NGOutOfFlowLayoutPart::GenerateFragment(
NGBlockNode& descendant,
const Optional<LayoutUnit>& block_estimate,
const NGAbsolutePhysicalPosition node_position) {

Powered by Google App Engine
This is Rietveld 408576698