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

Issue 2587283004: [layoutng] Add a shrink-to-fit flag to the constraint space (Closed)

Created:
4 years ago by cbiesinger
Modified:
4 years ago
Reviewers:
ikilpatrick
CC:
chromium-reviews, cbiesinger, ojan+watch_chromium.org, szager+layoutwatch_chromium.org, glebl+reviews_chromium.org, atotic+reviews_chromium.org, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, eae+blinkwatch, leviw+renderwatch, zoltan1, jchaffraix+rendering, blink-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[layoutng] Add a shrink-to-fit flag to the constraint space This is useful for a few things: - A way to communicate from the layout algorithm to ng_length_utils that we should treat auto as shrink-to-fit. There's no good other way to do this -- ng_length_utils gets the logicalWidth() property directly and needs to know to treat it specially. Conversely I did not want to encode this knowledge inside of length utils because that gets complicated fast and puts special knowledge in a single place instead of distributing it to caller layout algorithms which are a much more natural spot. - It allows a parent layout algorithm to tell a child box that it should shrink to fit even when it normally wouldn't, e.g. for flex items. This is essentially a companion change to https://codereview.chromium.org/2583033004/ -- with both these changes we should correctly size inline-blocks and floats. R=ikilpatrick@chromium.org BUG=635619 Committed: https://crrev.com/aad3ca9d2bc90049564e97e956cc5ebbf9e8159b Cr-Commit-Position: refs/heads/master@{#440344}

Patch Set 1 #

Patch Set 2 : fix typo / failing tests #

Patch Set 3 : fix compile error #

Patch Set 4 : fix test (have to comment out parts until crrev.com/2583033004) #

Patch Set 5 : fix incorrect logic #

Total comments: 3

Patch Set 6 : review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -13 lines) Patch
M third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc View 1 2 3 4 5 2 chunks +9 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h View 1 2 3 4 5 3 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc View 1 2 3 4 5 3 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc View 1 2 3 4 5 5 chunks +10 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_length_utils.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc View 1 2 3 4 5 2 chunks +13 lines, -9 lines 0 comments Download

Messages

Total messages: 27 (21 generated)
cbiesinger
4 years ago (2016-12-20 21:16:06 UTC) #1
ikilpatrick
lgtm https://codereview.chromium.org/2587283004/diff/80001/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h File third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h (right): https://codereview.chromium.org/2587283004/diff/80001/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h#newcode97 third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h:97: bool HasForcedShrinkToFit() const { return has_forced_shrink_to_fit_; } Comment ...
4 years ago (2016-12-22 00:06:14 UTC) #18
cbiesinger
https://codereview.chromium.org/2587283004/diff/80001/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h File third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h (right): https://codereview.chromium.org/2587283004/diff/80001/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h#newcode97 third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h:97: bool HasForcedShrinkToFit() const { return has_forced_shrink_to_fit_; } On 2016/12/22 ...
4 years ago (2016-12-22 03:34:25 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2587283004/100001
4 years ago (2016-12-22 03:34:33 UTC) #22
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years ago (2016-12-22 05:11:39 UTC) #25
commit-bot: I haz the power
4 years ago (2016-12-22 05:13:52 UTC) #27
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/aad3ca9d2bc90049564e97e956cc5ebbf9e8159b
Cr-Commit-Position: refs/heads/master@{#440344}

Powered by Google App Engine
This is Rietveld 408576698