Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Unified Diff: third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp

Issue 2826153002: Don't assume line-height properties can't change between text and its container.
Patch Set: Don't assume line-height properties can't change between text and its container. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/css-display-3/display-contents-line-height-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/css-display-3/display-contents-line-height-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698