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

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

Issue 2587283004: [layoutng] Add a shrink-to-fit flag to the constraint space (Closed)
Patch Set: review comments Created 4 years 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_layout_algorithm.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
index 039ca524b65373f21255750a959c87ea33b288f2..c4a4410b651c132ce7cc137858570b117a54e3b6 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
@@ -200,7 +200,7 @@ NGLayoutStatus NGBlockLayoutAlgorithm::Layout(
ComputeBorders(Style()) + ComputePadding(ConstraintSpace(), Style());
WTF::Optional<MinAndMaxContentSizes> sizes;
- if (NeedMinAndMaxContentSizes(Style())) {
+ if (NeedMinAndMaxContentSizes(ConstraintSpace(), Style())) {
// TODOO(layout-ng): Implement
sizes = MinAndMaxContentSizes();
}
@@ -442,11 +442,19 @@ void NGBlockLayoutAlgorithm::UpdateMarginStrut(const NGMarginStrut& from) {
NGConstraintSpace*
NGBlockLayoutAlgorithm::CreateConstraintSpaceForCurrentChild() const {
+ // TODO(layout-ng): Orthogonal children should also shrink to fit (in *their*
+ // inline axis)
+ // We have to keep this commented out for now until we correctly compute
+ // min/max content sizes in Layout().
+ // bool shrink_to_fit = CurrentChildStyle().display() == EDisplay::InlineBlock
+ // || CurrentChildStyle().isFloating();
+ bool shrink_to_fit = false;
DCHECK(current_child_);
space_builder_
->SetIsNewFormattingContext(
IsNewFormattingContextForInFlowBlockLevelChild(ConstraintSpace(),
CurrentChildStyle()))
+ .SetIsShrinkToFit(shrink_to_fit)
.SetWritingMode(
FromPlatformWritingMode(CurrentChildStyle().getWritingMode()))
.SetTextDirection(CurrentChildStyle().direction());
« 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