OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/layout/ng/inline/ng_inline_box_state.h" |
| 6 |
| 7 #include "core/layout/ng/inline/ng_inline_node.h" |
| 8 #include "core/style/ComputedStyle.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 // Compute text metrics for a box. All text in a box share the same metrics. |
| 13 void NGInlineBoxState::ComputeTextMetrics(const NGLayoutInlineItem& item, |
| 14 FontBaseline baseline_type) { |
| 15 const ComputedStyle& style = *item.Style(); |
| 16 text_metrics = NGLineHeightMetrics(style, baseline_type); |
| 17 text_top = -text_metrics.ascent; |
| 18 text_metrics.AddLeading(style.ComputedLineHeightAsFixed()); |
| 19 metrics.Unite(text_metrics); |
| 20 |
| 21 include_used_fonts = style.LineHeight().IsNegative(); |
| 22 } |
| 23 |
| 24 } // namespace blink |
OLD | NEW |