Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp |
| index 51c7e5867a9d56b3e7465a196be420fa45c28f45..7c3f4e313888223627c7cc39063294a878c33085 100644 |
| --- a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp |
| +++ b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp |
| @@ -91,6 +91,12 @@ static inline bool HasIdenticalLineHeightProperties( |
| child_style.VerticalAlign() == EVerticalAlign::kBaseline; |
| } |
| +static inline bool ParentIsDOMParent(LineLayoutItem parent, |
| + LineLayoutItem child) { |
| + return child.GetNode() && |
| + FlatTreeTraversal::Parent(*child.GetNode()) == parent.GetNode(); |
|
eae
2017/04/21 10:54:52
Can child.GetNode() ever be null? Might be worth a
|
| +} |
| + |
| void InlineFlowBox::AddToLine(InlineBox* child) { |
| DCHECK(!child->Parent()); |
| DCHECK(!child->NextOnLine()); |
| @@ -129,7 +135,8 @@ void InlineFlowBox::AddToLine(InlineBox* child) { |
| should_clear_descendants_have_same_line_height_and_baseline = true; |
| } else if (child->IsText()) { |
| if (child->GetLineLayoutItem().IsBR() || |
| - (child->GetLineLayoutItem().Parent() != GetLineLayoutItem())) { |
| + child->GetLineLayoutItem().Parent() != GetLineLayoutItem() || |
| + !ParentIsDOMParent(GetLineLayoutItem(), child->GetLineLayoutItem())) { |
| if (!HasIdenticalLineHeightProperties(parent_style, child_style, root)) |
| should_clear_descendants_have_same_line_height_and_baseline = true; |
| } |