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

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

Issue 2772503004: [LayoutNG] Add NGInlineBreakToken and back of NGInlineLayoutAlgorithm (Closed)
Patch Set: Resolved merge conflicts Created 3 years, 9 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_line_box_fragment_builder.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_line_box_fragment_builder.cc b/third_party/WebKit/Source/core/layout/ng/ng_line_box_fragment_builder.cc
index d0534c20cde4284cddf84d6bd3a933588668795e..860fccc52ecd64c4f024f1ed91b939ab4d2db175 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_line_box_fragment_builder.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_line_box_fragment_builder.cc
@@ -6,6 +6,7 @@
#include "core/layout/ng/geometry/ng_logical_size.h"
#include "core/layout/ng/ng_fragment.h"
+#include "core/layout/ng/ng_inline_break_token.h"
#include "core/layout/ng/ng_inline_node.h"
#include "core/layout/ng/ng_physical_line_box_fragment.h"
#include "platform/heap/Handle.h"
@@ -46,6 +47,11 @@ void NGLineBoxFragmentBuilder::UniteMetrics(
metrics_.Unite(metrics);
}
+void NGLineBoxFragmentBuilder::SetBreakToken(
+ RefPtr<NGInlineBreakToken> break_token) {
+ break_token_ = std::move(break_token);
+}
+
RefPtr<NGPhysicalLineBoxFragment>
NGLineBoxFragmentBuilder::ToLineBoxFragment() {
DCHECK_EQ(offsets_.size(), children_.size());
@@ -62,9 +68,10 @@ NGLineBoxFragmentBuilder::ToLineBoxFragment() {
writing_mode, direction_, physical_size, child->Size()));
}
- // TODO(kojii): Implement BreakToken.
- return adoptRef(new NGPhysicalLineBoxFragment(physical_size, children_,
- metrics_, nullptr));
+ return adoptRef(new NGPhysicalLineBoxFragment(
+ physical_size, children_, metrics_,
+ break_token_ ? std::move(break_token_)
+ : NGInlineBreakToken::create(node_)));
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698