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

Issue 2313873002: Initial implementation of Collapsing Margins computational logic for LayoutNG (Closed)

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

Description

Initial implementation of Collapsing Margins computational logic for LayoutNG This patches introduces the logic that computes Collapsing Margins for the following pairs: - top margin of a box and top margin of its first in-flow child - bottom margin of box and top margin of its next in-flow following sibling This implementation doesn't take into account any Margins Collapsing style exceptions, e.g. padding, borders etc. Design document: https://docs.google.com/document/d/1uxbDh4uONFQOiGuiumlJBLGgO4KDWB8ZEkp7Rd47fw4/edit#bookmark=id.gk14n6z7jt8a BUG=635619 Committed: https://crrev.com/ca82afa768a58fb6f977d97673eb03be7559c7f3 Cr-Commit-Position: refs/heads/master@{#417293}

Patch Set 1 #

Total comments: 12

Patch Set 2 : fixed comments: added CollapseMargins method, added UpdateMarginStrutBlock{Start|End} etc. #

Total comments: 13

Patch Set 3 : renamed UpdateMarginStrutBlock{Start|End} to SetMarginStrutBlock{Start|End}, prev_margin_strut_ -> … #

Patch Set 4 : added additional assert to check the child fragment in NGBlockLayoutAlgorithmTest.CollapsingMargins… #

Patch Set 5 : synced to the head #

Unified diffs Side-by-side diffs Delta from patch set Stats (+269 lines, -42 lines) Patch
M third_party/WebKit/Source/core/layout/BUILD.gn View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h View 1 2 2 chunks +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc View 1 2 4 chunks +47 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc View 1 2 3 2 chunks +108 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_fragment_base.h View 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_fragment_base.cc View 1 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h View 1 2 2 chunks +13 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc View 1 2 3 chunks +24 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_length_utils_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_margin_strut.h View 1 chunk +0 lines, -24 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h View 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_physical_fragment_base.h View 2 chunks +7 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_physical_text_fragment.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_units.h View 2 chunks +20 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_units.cc View 1 chunk +25 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (20 generated)
ikilpatrick
https://codereview.chromium.org/2313873002/diff/20001/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/2313873002/diff/20001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc#newcode91 third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc:91: LayoutUnit NGBlockLayoutAlgorithm::ComputeMarginBlockStart( I'd split this function up into two ...
4 years, 3 months ago (2016-09-06 21:38:05 UTC) #8
ikilpatrick
thanks for working on this :)
4 years, 3 months ago (2016-09-06 21:38:18 UTC) #9
eae
This looks great, thank you!
4 years, 3 months ago (2016-09-06 21:58:52 UTC) #10
Gleb Lanbin
PTAL https://codereview.chromium.org/2313873002/diff/20001/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/2313873002/diff/20001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc#newcode91 third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc:91: LayoutUnit NGBlockLayoutAlgorithm::ComputeMarginBlockStart( On 2016/09/06 21:38:05, ikilpatrick wrote: > ...
4 years, 3 months ago (2016-09-07 18:18:04 UTC) #11
ikilpatrick
https://codereview.chromium.org/2313873002/diff/40001/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/2313873002/diff/40001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc#newcode20 third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc:20: const NGMarginStrut& prev_margin_stut, %s/stut/strut and elsewhere. https://codereview.chromium.org/2313873002/diff/40001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc#newcode111 third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc:111: // ...
4 years, 3 months ago (2016-09-07 20:56:29 UTC) #12
Gleb Lanbin
PTAL https://codereview.chromium.org/2313873002/diff/40001/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/2313873002/diff/40001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc#newcode20 third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc:20: const NGMarginStrut& prev_margin_stut, On 2016/09/07 20:56:29, ikilpatrick wrote: ...
4 years, 3 months ago (2016-09-07 21:33:04 UTC) #13
ikilpatrick
lgtm, thanks for your patience :) https://codereview.chromium.org/2313873002/diff/40001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc File third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc (right): https://codereview.chromium.org/2313873002/diff/40001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc#newcode115 third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc:115: EXPECT_EQ(frag->MarginStrut().margin_block_start, kDiv1MarginTop); On ...
4 years, 3 months ago (2016-09-07 23:16:21 UTC) #14
ikilpatrick
https://codereview.chromium.org/2313873002/diff/40001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc File third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc (right): https://codereview.chromium.org/2313873002/diff/40001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc#newcode115 third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc:115: EXPECT_EQ(frag->MarginStrut().margin_block_start, kDiv1MarginTop); On 2016/09/07 23:16:21, ikilpatrick wrote: > On ...
4 years, 3 months ago (2016-09-07 23:17:10 UTC) #15
Gleb Lanbin
On 2016/09/07 23:17:10, ikilpatrick wrote: > https://codereview.chromium.org/2313873002/diff/40001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc > File third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc > (right): > > https://codereview.chromium.org/2313873002/diff/40001/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc#newcode115 ...
4 years, 3 months ago (2016-09-07 23:32:27 UTC) #16
Gleb Lanbin
thanks for the review.
4 years, 3 months ago (2016-09-07 23:32:44 UTC) #17
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/2313873002/80001
4 years, 3 months ago (2016-09-07 23:34:38 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/65404) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 3 months ago (2016-09-07 23:39:17 UTC) #22
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/2313873002/80001
4 years, 3 months ago (2016-09-07 23:41:55 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/65422) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 3 months ago (2016-09-07 23:45:01 UTC) #26
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/2313873002/100001
4 years, 3 months ago (2016-09-07 23:50:39 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/65439)
4 years, 3 months ago (2016-09-07 23:54:22 UTC) #31
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/2313873002/100001
4 years, 3 months ago (2016-09-08 01:55:55 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/255166)
4 years, 3 months ago (2016-09-08 02:00:05 UTC) #35
Gleb Lanbin
On 2016/09/08 02:00:05, commit-bot: I haz the power wrote: > Try jobs failed on following ...
4 years, 3 months ago (2016-09-08 03:14:07 UTC) #36
eae
LGTM
4 years, 3 months ago (2016-09-08 13:02:33 UTC) #37
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/2313873002/100001
4 years, 3 months ago (2016-09-08 13:02:53 UTC) #39
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years, 3 months ago (2016-09-08 14:50:50 UTC) #41
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/ca82afa768a58fb6f977d97673eb03be7559c7f3 Cr-Commit-Position: refs/heads/master@{#417293}
4 years, 3 months ago (2016-09-08 14:53:52 UTC) #43
cbiesinger
4 years, 3 months ago (2016-09-08 20:40:17 UTC) #44
Message was sent while issue was closed.
lgtm

Powered by Google App Engine
This is Rietveld 408576698