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

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

Issue 2726233003: [LayoutNG] Remove style_ and layout_result_ members on NGBlockNode. (Closed)
Patch Set: fix test which had un-owned fragment tree. 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_block_node.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
index 0b8ecfcf37bfd24874ee814ce52639a612b8fb0b..5276fff836213edcb595835bde26ed2e87d1b82a 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
@@ -85,16 +85,16 @@ RefPtr<NGLayoutResult> NGBlockNode::Layout(NGConstraintSpace* constraint_space,
// Use the old layout code and synthesize a fragment.
if (!CanUseNewLayout()) {
DCHECK(layout_box_);
- layout_result_ = RunOldLayout(*constraint_space);
- return layout_result_;
+ return RunOldLayout(*constraint_space);
}
- layout_result_ = NGBlockLayoutAlgorithm(this, constraint_space,
- toNGBlockBreakToken(break_token))
- .Layout();
+ RefPtr<NGLayoutResult> layout_result =
+ NGBlockLayoutAlgorithm(this, constraint_space,
+ toNGBlockBreakToken(break_token))
+ .Layout();
- CopyFragmentDataToLayoutBox(*constraint_space);
- return layout_result_;
+ CopyFragmentDataToLayoutBox(*constraint_space, layout_result.get());
+ return layout_result;
}
MinAndMaxContentSizes NGBlockNode::ComputeMinAndMaxContentSizes() {
@@ -155,8 +155,6 @@ MinAndMaxContentSizes NGBlockNode::ComputeMinAndMaxContentSizes() {
}
const ComputedStyle& NGBlockNode::Style() const {
- if (style_)
- return *style_.get();
DCHECK(layout_box_);
return layout_box_->styleRef();
}
@@ -226,13 +224,14 @@ bool NGBlockNode::HasInlineChildren() {
}
void NGBlockNode::CopyFragmentDataToLayoutBox(
- const NGConstraintSpace& constraint_space) {
+ const NGConstraintSpace& constraint_space,
+ NGLayoutResult* layout_result) {
// We may not have a layout_box_ during unit tests.
if (!layout_box_)
return;
NGPhysicalBoxFragment* fragment =
- toNGPhysicalBoxFragment(layout_result_->PhysicalFragment().get());
+ toNGPhysicalBoxFragment(layout_result->PhysicalFragment().get());
layout_box_->setWidth(fragment->Width());
layout_box_->setHeight(fragment->Height());
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_block_node.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698