1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
From d73794f48b5b20b05c0bd6c4657181f16dce8c2a Mon Sep 17 00:00:00 2001
From: Daniel Playfair Cal <daniel.playfair.cal@gmail.com>
Date: Sun, 5 Apr 2020 18:07:27 +1000
Subject: [PATCH 3/3] Revert "[FragmentItem] Two fixes for outline"
This reverts commit a340aadc092315215068045d847516f985b6a9f3.
---
.../layout/ng/layout_ng_block_flow_mixin.cc | 13 ++-----
.../ng/ng_physical_container_fragment.cc | 34 -------------------
2 files changed, 2 insertions(+), 45 deletions(-)
diff --git a/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.cc b/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.cc
index ef990b7ce3fd..4beb7958545c 100644
--- a/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.cc
+++ b/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.cc
@@ -110,18 +110,9 @@ void LayoutNGBlockFlowMixin<Base>::AddOutlineRects(
To<NGPhysicalBoxFragment>(PaintFragment()->PhysicalFragment())
.AddSelfOutlineRects(additional_offset, include_block_overflows,
&rects);
- return;
- }
-
- if (const NGPhysicalBoxFragment* fragment = CurrentFragment()) {
- if (fragment->HasItems()) {
- fragment->AddSelfOutlineRects(additional_offset, include_block_overflows,
- &rects);
- return;
- }
+ } else {
+ Base::AddOutlineRects(rects, additional_offset, include_block_overflows);
}
-
- Base::AddOutlineRects(rects, additional_offset, include_block_overflows);
}
// Retrieve NGBaseline from the current fragment.
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.cc b/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.cc
index 82f57612ce45..a2f8092c791a 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.cc
@@ -90,40 +90,6 @@ void NGPhysicalContainerFragment::AddOutlineRectsForNormalChildren(
const PhysicalOffset& additional_offset,
NGOutlineType outline_type,
const LayoutBoxModelObject* containing_block) const {
- if (const auto* box = DynamicTo<NGPhysicalBoxFragment>(this)) {
- if (const NGFragmentItems* items = box->Items()) {
- for (NGInlineCursor cursor(*items); cursor; cursor.MoveToNext()) {
- DCHECK(cursor.Current().Item());
- const NGFragmentItem& item = *cursor.Current().Item();
- if (item.Type() == NGFragmentItem::kLine) {
- AddOutlineRectsForDescendant(
- {item.LineBoxFragment(), item.OffsetInContainerBlock()},
- outline_rects, additional_offset, outline_type, containing_block);
- continue;
- }
- if (item.Type() == NGFragmentItem::kBox) {
- if (const NGPhysicalBoxFragment* child_box = item.BoxFragment()) {
- DCHECK(!child_box->IsOutOfFlowPositioned());
- AddOutlineRectsForDescendant(
- {child_box, item.OffsetInContainerBlock()}, outline_rects,
- additional_offset, outline_type, containing_block);
- }
- continue;
- }
- DCHECK(item.IsText());
- }
- // Don't add |Children()|. If |this| has |NGFragmentItems|, children are
- // either line box, which we already handled in items, or OOF, which we
- // should ignore.
- DCHECK(std::all_of(PostLayoutChildren().begin(),
- PostLayoutChildren().end(), [](const NGLink& child) {
- return child->IsLineBox() ||
- child->IsOutOfFlowPositioned();
- }));
- return;
- }
- }
-
for (const auto& child : PostLayoutChildren()) {
// Outlines of out-of-flow positioned descendants are handled in
// NGPhysicalBoxFragment::AddSelfOutlineRects().
--
2.26.0
|