Commit 9465c47f authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[LayoutNG] Remove text fragment inline_cb_{border,padding} adjustment.

This appears to be a leftover from when we didn't produce fragments for
inline children which were containing blocks.

There should be no behaviour change.

Bug: 636993
Change-Id: Idc78f232390bd58f00517df719b6c2cda6e6830a
Reviewed-on: https://chromium-review.googlesource.com/c/1356259Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Reviewed-by: default avatarAleks Totic <atotic@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612710}
parent 28cb5d15
......@@ -225,17 +225,10 @@ void NGBoxFragmentBuilder::ComputeInlineContainerFragments(
for (auto& descendant :
NGInlineFragmentTraversal::DescendantsOf(*linebox)) {
LayoutObject* key = {};
if (descendant.fragment->IsText()) {
key = descendant.fragment->GetLayoutObject();
DCHECK(key);
key = key->Parent();
DCHECK(key);
} else if (descendant.fragment->IsBox()) {
key = descendant.fragment->GetLayoutObject();
}
if (!key)
if (!descendant.fragment->IsBox())
continue;
LayoutObject* key = descendant.fragment->GetLayoutObject();
auto it = inline_container_fragments->find(key);
if (it != inline_container_fragments->end()) {
NGBoxFragmentBuilder::FragmentPair& value = it->value;
......
......@@ -149,8 +149,6 @@ void NGOutOfFlowLayoutPart::ComputeInlineContainingBlocks(
ComputeBorders(dummy_constraint_space, *inline_cb_style);
NGPhysicalBoxStrut physical_borders = inline_cb_borders.ConvertToPhysical(
inline_cb_style->GetWritingMode(), inline_cb_style->Direction());
NGBoxStrut inline_cb_padding =
ComputePadding(dummy_constraint_space, *inline_cb_style);
// Warning: lots of non-obvious coordinate manipulation ahead.
//
......@@ -184,8 +182,6 @@ void NGOutOfFlowLayoutPart::ComputeInlineContainingBlocks(
// 3. Convert both topleft/bottomright to logical, so that we can
// 4. Enforce logical topLeft < bottomRight
// 5. Compute size, physical offset
const NGPhysicalFragment* start_fragment =
block_info.value.start_fragment;
const NGPhysicalLineBoxFragment* start_linebox_fragment =
block_info.value.start_linebox_fragment;
WritingMode container_writing_mode =
......@@ -198,11 +194,6 @@ void NGOutOfFlowLayoutPart::ComputeInlineContainingBlocks(
container_writing_mode, container_direction,
start_linebox_fragment->Size(),
block_info.value.start_fragment_union_rect.size);
// Text fragments do not include inline-cb borders and padding.
if (start_fragment->IsText()) {
start_fragment_logical_offset -= inline_cb_borders.StartOffset();
start_fragment_logical_offset -= inline_cb_padding.StartOffset();
}
NGPhysicalOffset start_fragment_physical_offset =
start_fragment_logical_offset.ConvertToPhysical(
container_writing_mode, container_direction,
......@@ -210,19 +201,11 @@ void NGOutOfFlowLayoutPart::ComputeInlineContainingBlocks(
// Step 2
const NGPhysicalLineBoxFragment* end_linebox_fragment =
block_info.value.end_linebox_fragment;
const NGPhysicalFragment* end_fragment = block_info.value.end_fragment;
NGLogicalOffset end_fragment_logical_offset =
block_info.value.end_fragment_union_rect.offset.ConvertToLogical(
container_writing_mode, container_direction,
end_linebox_fragment->Size(),
block_info.value.end_fragment_union_rect.size);
// Text fragments do not include inline-cb borders and padding.
if (end_fragment->IsText()) {
end_fragment_logical_offset += NGLogicalOffset(
inline_cb_borders.inline_end, inline_cb_borders.block_end);
end_fragment_logical_offset += NGLogicalOffset(
inline_cb_padding.inline_end, inline_cb_padding.block_end);
}
NGLogicalOffset end_fragment_bottom_right =
end_fragment_logical_offset +
block_info.value.end_fragment_union_rect.size.ConvertToLogical(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment