|
|
Created:
3 years, 7 months ago by Gleb Lanbin Modified:
3 years, 7 months ago Reviewers:
ikilpatrick CC:
chromium-reviews, cbiesinger, ojan+watch_chromium.org, szager+layoutwatch_chromium.org, glebl+reviews_chromium.org, dgrogan+ng_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/heads/master Project:
chromium Visibility:
Public. |
DescriptionAdd container_block_offset,top_offset to NGFloatingObject.
To correctly paint a float from LayoutNG we need to know the BFC offset
of the container to which we are attaching this float. It's used to
calculate {@code left_offset}, {@code top_offset}.
In most situations {@code (left|top)_offset} equals to float's logical
offset except the cases where a float needs to be re-attached to a non-zero
height parent.
Example:
<body>
<p style="height: 60px">Example</p>
<div id="zero-height-div"><float></div>
Here the float's logical offset is 0 relative to its #zero-height-div
parent. Because of the "zero height" div this float is re-attached to the
1st non-empty parent => body. To paint this float correctly we provide the
modified {@code (top|left)_offset} which is relative to the float's new
parent.
I.e. for our example {@code top_offset} == #zero-height-div's BFC offset
- body's BFC offset + float's logical offset
BUG=635619
TESTS=Fixes 8 tests in CSS2/floats-clear, 1 in CSS2/floats,
1 in CSS2/positioning, 2 in fast/block/margin-collapse,
2 in fast/block/float. Total: 14
Review-Url: https://codereview.chromium.org/2850893003
Cr-Commit-Position: refs/heads/master@{#471134}
Committed: https://chromium.googlesource.com/chromium/src/+/d2f276e5c8e098ab9cc16d77315a2475e94a2582
Patch Set 1 #
Total comments: 1
Patch Set 2 : fix merge conflicts #Patch Set 3 : update TestExpectations #
Total comments: 6
Patch Set 4 : fix comments #Patch Set 5 : add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes.html is still broken #Messages
Total messages: 62 (38 generated)
glebl@chromium.org changed reviewers: + ikilpatrick@chromium.org
The CQ bit was checked by glebl@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...) android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clan...) cast_shell_android on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_a...) chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
lgtm https://codereview.chromium.org/2850893003/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/layout/ng/ng_floating_object.h (right): https://codereview.chromium.org/2850893003/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/layout/ng/ng_floating_object.h:94: // would be attached. does this comment block need to be updated?
Description was changed from ========== Add container_block_offset,top_offset to NGFloatingObject. To correctly paint a float from LayoutNG we need to know the BFC offset of the container to which we are attaching this float. It's used to calculate {@code left_offset}, {@code top_offset}. In most situations {@code (left|top)_offset} equals to float's logical offset except the cases where a float needs to be re-attached to a non-zero height parent. Example: <body> <p style="height: 60px">Example</p> <div id="zero-height-div"><float></div> Here the float's logical offset is 0 relative to its #zero-height-div parent. Because of the "zero height" div this float is re-attached to the 1st non-empty parent => body. To paint this float correctly we provide the modified {@code (top|left)_offset} which is relative to the float's new parent. I.e. for our example {@code top_offset} == #zero-height-div's BFC offset - body's BFC offset + float's logical offset BUG=635619 TESTS=Fixes 7 tests in CSS2/floats-clear, 1 in CSS2/positioning, 1 in fast/block/margin-collapse ========== to ========== Add container_block_offset,top_offset to NGFloatingObject. To correctly paint a float from LayoutNG we need to know the BFC offset of the container to which we are attaching this float. It's used to calculate {@code left_offset}, {@code top_offset}. In most situations {@code (left|top)_offset} equals to float's logical offset except the cases where a float needs to be re-attached to a non-zero height parent. Example: <body> <p style="height: 60px">Example</p> <div id="zero-height-div"><float></div> Here the float's logical offset is 0 relative to its #zero-height-div parent. Because of the "zero height" div this float is re-attached to the 1st non-empty parent => body. To paint this float correctly we provide the modified {@code (top|left)_offset} which is relative to the float's new parent. I.e. for our example {@code top_offset} == #zero-height-div's BFC offset - body's BFC offset + float's logical offset BUG=635619 TESTS=Fixes 8 tests in CSS2/floats-clear, 1 in CSS2/floats, 1 in CSS2/positioning, 2 in fast/block/margin-collapse, 2 in fast/block/float. Total: 14 ==========
The CQ bit was checked by glebl@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lgtm https://codereview.chromium.org/2850893003/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc (right): https://codereview.chromium.org/2850893003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc:90: void PositionPendingFloatsFromOffset(LayoutUnit origin_block_offset, is it worth splitting this out? up to you... https://codereview.chromium.org/2850893003/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h (right): https://codereview.chromium.org/2850893003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h:100: NGLogicalOffset PositionWithParentBfc(const NGConstraintSpace&); remove? https://codereview.chromium.org/2850893003/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/layout/ng/ng_floating_object.h (right): https://codereview.chromium.org/2850893003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/layout/ng/ng_floating_object.h:76: WTF::Optional<LayoutUnit> container_block_offset; is a better name for the bfc_block_offset? container is an overloaded term... (i.e. containing block, parent == container, etc).
The CQ bit was checked by glebl@chromium.org to run a CQ dry run
https://codereview.chromium.org/2850893003/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc (right): https://codereview.chromium.org/2850893003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc:90: void PositionPendingFloatsFromOffset(LayoutUnit origin_block_offset, On 2017/05/09 22:45:23, ikilpatrick wrote: > is it worth splitting this out? up to you... discussed offline. https://codereview.chromium.org/2850893003/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h (right): https://codereview.chromium.org/2850893003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h:100: NGLogicalOffset PositionWithParentBfc(const NGConstraintSpace&); On 2017/05/09 22:45:23, ikilpatrick wrote: > remove? Done. https://codereview.chromium.org/2850893003/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/layout/ng/ng_floating_object.h (right): https://codereview.chromium.org/2850893003/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/layout/ng/ng_floating_object.h:76: WTF::Optional<LayoutUnit> container_block_offset; On 2017/05/09 22:45:23, ikilpatrick wrote: > is a better name for the bfc_block_offset? container is an overloaded term... > (i.e. containing block, parent == container, etc). renamed to parent_bfc_block_offset
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...)
The CQ bit was checked by glebl@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by glebl@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from ikilpatrick@chromium.org Link to the patchset: https://codereview.chromium.org/2850893003/#ps80001 (title: "add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes.html is still broken")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by glebl@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by ikilpatrick@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by glebl@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by glebl@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by glebl@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by ikilpatrick@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
The CQ bit was checked by glebl@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by glebl@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by ikilpatrick@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 80001, "attempt_start_ts": 1494543138971770, "parent_rev": "2c08e4da26268c0297c10e0579f3851d6c922179", "commit_rev": "d2f276e5c8e098ab9cc16d77315a2475e94a2582"}
Message was sent while issue was closed.
Description was changed from ========== Add container_block_offset,top_offset to NGFloatingObject. To correctly paint a float from LayoutNG we need to know the BFC offset of the container to which we are attaching this float. It's used to calculate {@code left_offset}, {@code top_offset}. In most situations {@code (left|top)_offset} equals to float's logical offset except the cases where a float needs to be re-attached to a non-zero height parent. Example: <body> <p style="height: 60px">Example</p> <div id="zero-height-div"><float></div> Here the float's logical offset is 0 relative to its #zero-height-div parent. Because of the "zero height" div this float is re-attached to the 1st non-empty parent => body. To paint this float correctly we provide the modified {@code (top|left)_offset} which is relative to the float's new parent. I.e. for our example {@code top_offset} == #zero-height-div's BFC offset - body's BFC offset + float's logical offset BUG=635619 TESTS=Fixes 8 tests in CSS2/floats-clear, 1 in CSS2/floats, 1 in CSS2/positioning, 2 in fast/block/margin-collapse, 2 in fast/block/float. Total: 14 ========== to ========== Add container_block_offset,top_offset to NGFloatingObject. To correctly paint a float from LayoutNG we need to know the BFC offset of the container to which we are attaching this float. It's used to calculate {@code left_offset}, {@code top_offset}. In most situations {@code (left|top)_offset} equals to float's logical offset except the cases where a float needs to be re-attached to a non-zero height parent. Example: <body> <p style="height: 60px">Example</p> <div id="zero-height-div"><float></div> Here the float's logical offset is 0 relative to its #zero-height-div parent. Because of the "zero height" div this float is re-attached to the 1st non-empty parent => body. To paint this float correctly we provide the modified {@code (top|left)_offset} which is relative to the float's new parent. I.e. for our example {@code top_offset} == #zero-height-div's BFC offset - body's BFC offset + float's logical offset BUG=635619 TESTS=Fixes 8 tests in CSS2/floats-clear, 1 in CSS2/floats, 1 in CSS2/positioning, 2 in fast/block/margin-collapse, 2 in fast/block/float. Total: 14 Review-Url: https://codereview.chromium.org/2850893003 Cr-Commit-Position: refs/heads/master@{#471134} Committed: https://chromium.googlesource.com/chromium/src/+/d2f276e5c8e098ab9cc16d77315a... ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/d2f276e5c8e098ab9cc16d77315a... |