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

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

Issue 2337763005: [layoutng] Set the intrinsic content logical height on the old layout tree (Closed)
Patch Set: fix a crash Created 4 years, 3 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 | « no previous file | 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_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 ee77cc83013c08673dc57995d007c2a07ef09643..2f92625959c5149943416075fcb2646463a339f7 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_box.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_box.cc
@@ -10,6 +10,7 @@
#include "core/layout/ng/ng_direction.h"
#include "core/layout/ng/ng_fragment.h"
#include "core/layout/ng/ng_fragment_builder.h"
+#include "core/layout/ng/ng_length_utils.h"
#include "core/layout/ng/ng_writing_mode.h"
namespace blink {
@@ -42,6 +43,15 @@ bool NGBox::Layout(const NGConstraintSpace* constraint_space,
if (layout_box_) {
layout_box_->setWidth(fragment_->Width());
layout_box_->setHeight(fragment_->Height());
+ NGBoxStrut border_and_padding =
+ computeBorders(*Style()) +
+ computePadding(*constraint_space, *Style());
+ LayoutUnit intrinsic_logical_height =
+ layout_box_->style()->isHorizontalWritingMode()
+ ? fragment_->HeightOverflow()
+ : fragment_->WidthOverflow();
+ intrinsic_logical_height -= border_and_padding.BlockSum();
+ layout_box_->setIntrinsicContentLogicalHeight(intrinsic_logical_height);
// Ensure the position of the children are copied across to the
// LayoutObject tree.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698