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

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

Issue 2281153002: [layoutng] async layout part 1: Change the API to support async (Closed)
Patch Set: Created 4 years, 4 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_box.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_box.cc b/third_party/WebKit/Source/core/layout/ng/ng_box.cc
index b1c4d9fab71f36fadc35c73f6fffb7e2b48aa5f2..f96a7a49c8128192cbab420754744ef88fb3ee20 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_box.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_box.cc
@@ -17,7 +17,8 @@
namespace blink {
-NGFragment* NGBox::layout(const NGConstraintSpace* constraint_space) {
+bool NGBox::Layout(const NGConstraintSpace* constraint_space,
+ NGFragment** out) {
// We can either use the new layout code to do the layout and then copy the
// resulting size to the LayoutObject, or use the old layout code and
// synthesize a fragment.
@@ -29,7 +30,8 @@ NGFragment* NGBox::layout(const NGConstraintSpace* constraint_space) {
NGConstraintSpace* child_constraint_space = new NGConstraintSpace(
FromPlatformWritingMode(style()->getWritingMode()), constraint_space);
- fragment = algorithm.layout(child_constraint_space);
+ if (!algorithm.Layout(child_constraint_space, &fragment))
+ return false;
m_layoutBox->setLogicalWidth(fragment->InlineSize());
m_layoutBox->setLogicalHeight(fragment->BlockSize());
if (m_layoutBox->isLayoutBlock())
@@ -57,7 +59,8 @@ NGFragment* NGBox::layout(const NGConstraintSpace* constraint_space) {
.SetBlockOverflow(overflow.height());
fragment = builder.ToFragment();
}
- return fragment;
+ *out = fragment;
+ return true;
}
const ComputedStyle* NGBox::style() const {
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_box.h ('k') | third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698