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

Issue 2503953002: Add the support of "clear" CSS property to NG block layout algorithm. (Closed)

Created:
4 years, 1 month ago by Gleb Lanbin
Modified:
4 years, 1 month ago
Reviewers:
cbiesinger, 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

Add the support of "clear" CSS property to NG block layout algorithm. This patch adds the support of "clear" CSS property for floating and non-floating elements. Please note that this doesn't currently support some edge cases, e.g. margin collapsing should not occur if "clear" is applied to non-floating blocks. List of changes: - Add last left/right float exclusions to NGPhysicalConstraintSpace. They are used to enforce the top edge alignment rule for floats and for the support of CSS "clear" property. - Add a new version of NGExclusion that encapsulates the exclusion type and rectangle in logical coordindates that represents that exclusion. - Added some helper read-only getters to NGBlockLayoutAlgorithm: CurrentChildStyle(), ConstraintSpace() etc. - Added AdjustToCSSClear that has the main logic that calculates the right content's offset based on CSS "clear" value. BUG=635619 TEST=NGBlockLayoutAlgorithmTest::PositionFragmentsWithClear, virtual/layout_ng/fast/block/float/max-width-clear-float-with-overflow-hidden.html Committed: https://crrev.com/d9c529de305db6eb0dde1052a39c9dd4b06f9bc9 Cr-Commit-Position: refs/heads/master@{#432958}

Patch Set 1 #

Total comments: 8

Patch Set 2 : do not use auto*, fix the clearance logic for floating elements #

Total comments: 1

Patch Set 3 : added "owned" comment to last_(left|right)_float_exclusion_, added TODO about moving AdjustToCleara… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+290 lines, -100 lines) Patch
M third_party/WebKit/LayoutTests/TestExpectations View 2 chunks +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h View 1 chunk +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc View 1 2 11 chunks +78 lines, -28 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc View 1 1 chunk +80 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h View 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc View 3 chunks +16 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc View 5 chunks +35 lines, -36 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc View 6 chunks +16 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_tree_node.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_physical_constraint_space.h View 1 2 3 chunks +18 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_physical_constraint_space.cc View 1 chunk +11 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_units.h View 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (22 generated)
Gleb Lanbin
4 years, 1 month ago (2016-11-15 19:33:42 UTC) #3
Gleb Lanbin
On 2016/11/15 19:33:42, Gleb Lanbin wrote: ping
4 years, 1 month ago (2016-11-16 17:10:09 UTC) #16
ikilpatrick
https://codereview.chromium.org/2503953002/diff/80001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc File third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc (right): https://codereview.chromium.org/2503953002/diff/80001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc#newcode30 third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc:30: const auto* left_exclusion = space.LastLeftFloatExclusion(); Can we not use ...
4 years, 1 month ago (2016-11-16 23:47:57 UTC) #17
Gleb Lanbin
PTAL https://codereview.chromium.org/2503953002/diff/80001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc File third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc (right): https://codereview.chromium.org/2503953002/diff/80001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc#newcode30 third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc:30: const auto* left_exclusion = space.LastLeftFloatExclusion(); On 2016/11/16 23:47:57, ...
4 years, 1 month ago (2016-11-17 17:48:34 UTC) #18
ikilpatrick
lgtm but might need a todo (see comment below). https://codereview.chromium.org/2503953002/diff/80001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc File third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc (right): https://codereview.chromium.org/2503953002/diff/80001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc#newcode283 third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc:283: ...
4 years, 1 month ago (2016-11-17 18:05:20 UTC) #19
Gleb Lanbin
thanks for the review On 2016/11/17 18:05:20, ikilpatrick wrote: > lgtm but might need a ...
4 years, 1 month ago (2016-11-17 18:22:07 UTC) #20
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/2503953002/120001
4 years, 1 month ago (2016-11-17 20:19:04 UTC) #27
commit-bot: I haz the power
Committed patchset #3 (id:120001)
4 years, 1 month ago (2016-11-17 21:22:25 UTC) #29
commit-bot: I haz the power
4 years, 1 month ago (2016-11-17 21:24:32 UTC) #31
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/d9c529de305db6eb0dde1052a39c9dd4b06f9bc9
Cr-Commit-Position: refs/heads/master@{#432958}

Powered by Google App Engine
This is Rietveld 408576698