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

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

Issue 2611033002: [layoutng] Make RunOldLayout respect IsFixedSize (Closed)
Patch Set: fix percentage size Created 3 years, 11 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 | third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h » ('j') | 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 6fbb34b58a218580e6dca675d693c9875f0590ba..1849d7a2e3c54f51a6c5065c2e6ca2574c1ef0e6 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
@@ -300,12 +300,23 @@ void NGBlockNode::CopyFragmentDataToLayoutBox(
NGPhysicalFragment* NGBlockNode::RunOldLayout(
const NGConstraintSpace& constraint_space) {
- // TODO(layout-ng): If fixedSize is true, set the override width/height too
- NGLogicalSize available_size = constraint_space.AvailableSize();
+ NGLogicalSize available_size = constraint_space.PercentageResolutionSize();
layout_box_->setOverrideContainingBlockContentLogicalWidth(
available_size.inline_size);
layout_box_->setOverrideContainingBlockContentLogicalHeight(
available_size.block_size);
+ // TODO(layout-ng): Does this handle scrollbars correctly?
+ if (constraint_space.IsFixedSizeInline()) {
+ layout_box_->setOverrideLogicalContentWidth(
+ constraint_space.AvailableSize().inline_size -
+ layout_box_->borderAndPaddingLogicalWidth());
+ }
+ if (constraint_space.IsFixedSizeBlock()) {
+ layout_box_->setOverrideLogicalContentHeight(
+ constraint_space.AvailableSize().block_size -
+ layout_box_->borderAndPaddingLogicalHeight());
+ }
+
if (layout_box_->isLayoutNGBlockFlow() && layout_box_->needsLayout()) {
toLayoutNGBlockFlow(layout_box_)->LayoutBlockFlow::layoutBlock(true);
} else {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698