|
|
Chromium Code Reviews|
Created:
3 years, 8 months ago by Gleb Lanbin Modified:
3 years, 8 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. |
DescriptionMove container_builder to NGLayoutAlgorithm base class.
BUG=635619
Review-Url: https://codereview.chromium.org/2810833003
Cr-Commit-Position: refs/heads/master@{#464072}
Committed: https://chromium.googlesource.com/chromium/src/+/6051193a1a2f5d7ad673326ba398324ad4975841
Patch Set 1 #Patch Set 2 : git rebase-update #Patch Set 3 : git rebase-update #Patch Set 4 : git rebase-update #
Messages
Total messages: 32 (20 generated)
Description was changed from ========== Move container_builder to NGLayoutAlgorithm base class. BUG=635619 ========== to ========== Move container_builder to NGLayoutAlgorithm base class. BUG=635619 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_layout_ng ==========
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: linux_layout_tests_layout_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_layout_te...)
lgtm
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: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
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/2810833003/#ps40001 (title: "git rebase-update")
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_layout_tests_layout_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_layout_te...)
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_layout_tests_layout_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_layout_te...)
Description was changed from ========== Move container_builder to NGLayoutAlgorithm base class. BUG=635619 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_layout_ng ========== to ========== Move container_builder to NGLayoutAlgorithm base class. BUG=635619 ==========
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
Failed to apply patch for
third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc:
While running git apply --index -3 -p1;
error: patch failed:
third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc:115
Falling back to three-way merge...
Applied patch to
'third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc' with
conflicts.
U third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
Patch:
third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
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
143ac82a9d6a2f11a23304b9d07aab17ac55dcf0..2cdcf198fc547581db11ccbace50cfeec089c81f
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
@@ -67,7 +67,6 @@ NGBlockLayoutAlgorithm::NGBlockLayoutAlgorithm(NGBlockNode*
node,
NGConstraintSpace* space,
NGBlockBreakToken* break_token)
: NGLayoutAlgorithm(node, space, break_token),
- builder_(NGPhysicalFragment::kFragmentBox, node),
space_builder_(constraint_space_) {}
Optional<MinMaxContentSize> NGBlockLayoutAlgorithm::ComputeMinMaxContentSize()
@@ -115,20 +114,20 @@ NGLogicalOffset
NGBlockLayoutAlgorithm::CalculateLogicalOffset(
LayoutUnit block_offset = content_size_;
if (known_fragment_offset) {
block_offset = known_fragment_offset.value().block_offset -
- builder_.BfcOffset().value().block_offset;
+ ContainerBfcOffset().block_offset;
}
return {inline_offset, block_offset};
}
void NGBlockLayoutAlgorithm::UpdateFragmentBfcOffset(
const NGLogicalOffset& offset) {
- if (!builder_.BfcOffset()) {
+ if (!container_builder_.BfcOffset()) {
NGLogicalOffset bfc_offset = offset;
if (ConstraintSpace().ClearanceOffset()) {
bfc_offset.block_offset = std::max(
ConstraintSpace().ClearanceOffset().value(), offset.block_offset);
}
- builder_.SetBfcOffset(bfc_offset);
+ container_builder_.SetBfcOffset(bfc_offset);
}
}
@@ -158,9 +157,9 @@ RefPtr<NGLayoutResult> NGBlockLayoutAlgorithm::Layout() {
space_builder_.SetAvailableSize(adjusted_size)
.SetPercentageResolutionSize(adjusted_size);
- builder_.SetDirection(constraint_space_->Direction());
- builder_.SetWritingMode(constraint_space_->WritingMode());
- builder_.SetSize(size);
+ container_builder_.SetDirection(constraint_space_->Direction());
+ container_builder_.SetWritingMode(constraint_space_->WritingMode());
+ container_builder_.SetSize(size);
NGBlockChildIterator child_iterator(Node()->FirstChild(), BreakToken());
NGBlockChildIterator::Entry entry = child_iterator.NextChild();
@@ -188,7 +187,7 @@ RefPtr<NGLayoutResult> NGBlockLayoutAlgorithm::Layout() {
if (ConstraintSpace().IsNewFormattingContext()) {
UpdateFragmentBfcOffset(curr_bfc_offset_);
DCHECK_EQ(curr_margin_strut_, NGMarginStrut());
- DCHECK_EQ(builder_.BfcOffset().value(), NGLogicalOffset());
+ DCHECK_EQ(container_builder_.BfcOffset().value(), NGLogicalOffset());
curr_bfc_offset_ = {};
}
@@ -202,7 +201,8 @@ RefPtr<NGLayoutResult> NGBlockLayoutAlgorithm::Layout() {
// is no content size yet? See floats-wrap-inside-inline-006.
NGLogicalOffset offset = {border_and_padding_.inline_start,
content_size_ + curr_margin_strut_.Sum()};
- builder_.AddOutOfFlowChildCandidate(ToNGBlockNode(child), offset);
+ container_builder_.AddOutOfFlowChildCandidate(ToNGBlockNode(child),
+ offset);
NGBlockChildIterator::Entry entry = child_iterator.NextChild();
child = entry.node;
child_break_token = entry.token;
@@ -240,17 +240,17 @@ RefPtr<NGLayoutResult> NGBlockLayoutAlgorithm::Layout() {
// Recompute the block-axis size now that we know our content size.
size.block_size =
ComputeBlockSizeForFragment(ConstraintSpace(), Style(), content_size_);
- builder_.SetBlockSize(size.block_size);
+ container_builder_.SetBlockSize(size.block_size);
// Layout our absolute and fixed positioned children.
- NGOutOfFlowLayoutPart(ConstraintSpace(), Style(), &builder_).Run();
+ NGOutOfFlowLayoutPart(ConstraintSpace(), Style(), &container_builder_).Run();
// Non-empty blocks always know their position in space:
if (size.block_size) {
curr_bfc_offset_.block_offset += curr_margin_strut_.Sum();
UpdateFragmentBfcOffset(curr_bfc_offset_);
PositionPendingFloats(curr_bfc_offset_.block_offset,
- MutableConstraintSpace(), &builder_);
+ MutableConstraintSpace(), &container_builder_);
}
// Margins collapsing:
@@ -260,14 +260,15 @@ RefPtr<NGLayoutResult> NGBlockLayoutAlgorithm::Layout() {
// TODO(glebl): handle minLogicalHeight, maxLogicalHeight.
curr_margin_strut_ = NGMarginStrut();
}
- builder_.SetEndMarginStrut(curr_margin_strut_);
+ container_builder_.SetEndMarginStrut(curr_margin_strut_);
- builder_.SetOverflowSize(NGLogicalSize(max_inline_size_, content_size_));
+ container_builder_.SetOverflowSize(
+ NGLogicalSize(max_inline_size_, content_size_));
if (ConstraintSpace().HasBlockFragmentation())
FinalizeForFragmentation();
- return builder_.ToBoxFragment();
+ return container_builder_.ToBoxFragment();
}
void NGBlockLayoutAlgorithm::PrepareChildLayout(NGLayoutInputNode* child) {
@@ -279,8 +280,9 @@ void
NGBlockLayoutAlgorithm::PrepareChildLayout(NGLayoutInputNode* child) {
FromPlatformWritingMode(Style().GetWritingMode())));
// Set estimated BFC offset to the next child's constraint space.
- curr_bfc_offset_ = builder_.BfcOffset() ? builder_.BfcOffset().value()
- : ConstraintSpace().BfcOffset();
+ curr_bfc_offset_ = container_builder_.BfcOffset()
+ ? container_builder_.BfcOffset().value()
+ : ConstraintSpace().BfcOffset();
curr_bfc_offset_.block_offset += content_size_;
curr_bfc_offset_.inline_offset += border_and_padding_.inline_start;
@@ -289,7 +291,8 @@ void
NGBlockLayoutAlgorithm::PrepareChildLayout(NGLayoutInputNode* child) {
bool should_position_pending_floats =
child->IsBlock() && !is_floating &&
!IsNewFormattingContextForBlockLevelChild(Style(), *child) &&
- ClearanceMayAffectLayout(ConstraintSpace(),
builder_.UnpositionedFloats(),
+ ClearanceMayAffectLayout(ConstraintSpace(),
+ container_builder_.UnpositionedFloats(),
child->Style());
// Children which may clear a float need to force all the pending floats to
@@ -300,7 +303,7 @@ void
NGBlockLayoutAlgorithm::PrepareChildLayout(NGLayoutInputNode* child) {
UpdateFragmentBfcOffset(
{curr_bfc_offset_.inline_offset, origin_point_block_offset});
PositionPendingFloats(origin_point_block_offset, MutableConstraintSpace(),
- &builder_);
+ &container_builder_);
}
bool is_inflow = child->IsInline() || !is_floating;
@@ -333,7 +336,7 @@ void
NGBlockLayoutAlgorithm::PrepareChildLayout(NGLayoutInputNode* child) {
curr_bfc_offset_.block_offset += curr_margin_strut_.Sum();
UpdateFragmentBfcOffset(curr_bfc_offset_);
PositionPendingFloats(curr_bfc_offset_.block_offset,
- MutableConstraintSpace(), &builder_);
+ MutableConstraintSpace(), &container_builder_);
curr_margin_strut_ = {};
}
}
@@ -349,7 +352,7 @@ void NGBlockLayoutAlgorithm::FinishChildLayout(
// Pull out unpositioned floats to the current fragment. This may needed if
// for example the child fragment could not position its floats because it's
// empty and therefore couldn't determine its position in space.
- builder_.MutableUnpositionedFloats().AppendVector(
+ container_builder_.MutableUnpositionedFloats().AppendVector(
layout_result->UnpositionedFloats());
if (child->IsBlock() && child->Style().IsFloating()) {
@@ -360,16 +363,16 @@ void NGBlockLayoutAlgorithm::FinishChildLayout(
child_space->AvailableSize(), origin_offset,
constraint_space_->BfcOffset(), curr_child_margins_,
layout_result->PhysicalFragment().Get());
- builder_.AddUnpositionedFloat(floating_object);
+ container_builder_.AddUnpositionedFloat(floating_object);
// No need to postpone the positioning if we know the correct offset.
- if (builder_.BfcOffset()) {
+ if (container_builder_.BfcOffset()) {
NGLogicalOffset origin_point = curr_bfc_offset_;
// Adjust origin point to the margins of the last child.
// Example: <div style="margin-bottom: 20px"><float></div>
// <div style="margin-bottom: 30px"></div>
origin_point.block_offset += curr_margin_strut_.Sum();
PositionPendingFloats(origin_point.block_offset,
MutableConstraintSpace(),
- &builder_);
+ &container_builder_);
}
return;
}
@@ -378,16 +381,15 @@ void NGBlockLayoutAlgorithm::FinishChildLayout(
// content_size_ or known fragment's BFC offset.
WTF::Optional<NGLogicalOffset> bfc_offset;
if (child_space->IsNewFormattingContext()) {
- DCHECK(builder_.BfcOffset());
bfc_offset = curr_bfc_offset_;
} else if (fragment.BfcOffset()) {
// Fragment that knows its offset can be used to set parent's BFC position.
curr_bfc_offset_.block_offset = fragment.BfcOffset().value().block_offset;
UpdateFrag…
(message too large)
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/2810833003/#ps60001 (title: "git rebase-update")
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": 60001, "attempt_start_ts": 1492012325940290,
"parent_rev": "d850820a384d5cad1cbbcdfc209becdaf6beae88", "commit_rev":
"6051193a1a2f5d7ad673326ba398324ad4975841"}
Message was sent while issue was closed.
Description was changed from ========== Move container_builder to NGLayoutAlgorithm base class. BUG=635619 ========== to ========== Move container_builder to NGLayoutAlgorithm base class. BUG=635619 Review-Url: https://codereview.chromium.org/2810833003 Cr-Commit-Position: refs/heads/master@{#464072} Committed: https://chromium.googlesource.com/chromium/src/+/6051193a1a2f5d7ad673326ba398... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/6051193a1a2f5d7ad673326ba398... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
