Index: third_party/WebKit/Source/core/layout/ng/inline/ng_line_height_metrics.cc |
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_height_metrics.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_height_metrics.cc |
index a3258a0c61e3c94f55dac3fdd1dbf66bc1e5f408..a6d4c437c2ff4c82837650852d628de83b03acbf 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_height_metrics.cc |
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_height_metrics.cc |
@@ -27,6 +27,7 @@ void NGLineHeightMetrics::Initialize(const FontMetrics& font_metrics, |
} |
void NGLineHeightMetrics::AddLeading(LayoutUnit line_height) { |
+ DCHECK(!IsEmpty()); |
LayoutUnit half_leading = (line_height - (ascent + descent)) / 2; |
// TODO(kojii): floor() is to make text dump compatible with legacy test |
// results. Revisit when we paint. |
@@ -34,6 +35,12 @@ void NGLineHeightMetrics::AddLeading(LayoutUnit line_height) { |
descent = line_height - ascent; |
} |
+void NGLineHeightMetrics::Move(LayoutUnit delta) { |
+ DCHECK(!IsEmpty()); |
+ ascent -= delta; |
+ descent += delta; |
+} |
+ |
void NGLineHeightMetrics::Unite(const NGLineHeightMetrics& other) { |
ascent = std::max(ascent, other.ascent); |
descent = std::max(descent, other.descent); |