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

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

Issue 2714803002: [LayoutNG] Allow block-flow layout to be fragmented using new approach. (Closed)
Patch Set: rebase. 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_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 67a33262b55619d52b3d2e87240cd676a431d969..6764cb163b7e3b59a707f74d1b8b9c87852112a5 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
@@ -8,6 +8,7 @@
#include "core/layout/api/LineLayoutAPIShim.h"
#include "core/layout/line/InlineIterator.h"
#include "core/layout/ng/layout_ng_block_flow.h"
+#include "core/layout/ng/ng_block_break_token.h"
#include "core/layout/ng/ng_block_layout_algorithm.h"
#include "core/layout/ng/ng_box_fragment.h"
#include "core/layout/ng/ng_constraint_space.h"
@@ -86,8 +87,8 @@ NGBlockNode::NGBlockNode(ComputedStyle* style)
// included from a compilation unit that lacks the ComputedStyle definition.
NGBlockNode::~NGBlockNode() {}
-RefPtr<NGLayoutResult> NGBlockNode::Layout(
- NGConstraintSpace* constraint_space) {
+RefPtr<NGLayoutResult> NGBlockNode::Layout(NGConstraintSpace* constraint_space,
+ NGBreakToken* break_token) {
// Use the old layout code and synthesize a fragment.
if (!CanUseNewLayout()) {
DCHECK(layout_box_);
@@ -95,9 +96,9 @@ RefPtr<NGLayoutResult> NGBlockNode::Layout(
return layout_result_;
}
- layout_result_ =
- NGBlockLayoutAlgorithm(this, constraint_space, CurrentBreakToken())
- .Layout();
+ layout_result_ = NGBlockLayoutAlgorithm(this, constraint_space,
+ toNGBlockBreakToken(break_token))
+ .Layout();
CopyFragmentDataToLayoutBox(*constraint_space);
return layout_result_;
@@ -207,11 +208,6 @@ void NGBlockNode::SetFirstChild(NGLayoutInputNode* child) {
first_child_ = child;
}
-NGBreakToken* NGBlockNode::CurrentBreakToken() const {
- return layout_result_ ? layout_result_->PhysicalFragment()->BreakToken()
- : nullptr;
-}
-
DEFINE_TRACE(NGBlockNode) {
visitor->trace(next_sibling_);
visitor->trace(first_child_);
@@ -255,8 +251,8 @@ void NGBlockNode::CopyFragmentDataToLayoutBox(
layout_box_->setWidth(fragment->Width());
layout_box_->setHeight(fragment->Height());
- NGBoxStrut border_and_padding =
- ComputeBorders(Style()) + ComputePadding(constraint_space, Style());
+ NGBoxStrut border_and_padding = ComputeBorders(constraint_space, Style()) +
+ ComputePadding(constraint_space, Style());
LayoutUnit intrinsic_logical_height =
layout_box_->style()->isHorizontalWritingMode()
? fragment->HeightOverflow()
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_block_node.h ('k') | third_party/WebKit/Source/core/layout/ng/ng_column_mapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698