| Index: third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.cc
|
| diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..40ad0d4baa98bfdfe9849cdcaa8fc3b321e2f912
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.cc
|
| @@ -0,0 +1,24 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "core/layout/ng/inline/ng_inline_box_state.h"
|
| +
|
| +#include "core/layout/ng/inline/ng_inline_node.h"
|
| +#include "core/style/ComputedStyle.h"
|
| +
|
| +namespace blink {
|
| +
|
| +// Compute text metrics for a box. All text in a box share the same metrics.
|
| +void NGInlineBoxState::ComputeTextMetrics(const NGLayoutInlineItem& item,
|
| + FontBaseline baseline_type) {
|
| + const ComputedStyle& style = *item.Style();
|
| + text_metrics = NGLineHeightMetrics(style, baseline_type);
|
| + text_top = -text_metrics.ascent;
|
| + text_metrics.AddLeading(style.ComputedLineHeightAsFixed());
|
| + metrics.Unite(text_metrics);
|
| +
|
| + include_used_fonts = style.LineHeight().IsNegative();
|
| +}
|
| +
|
| +} // namespace blink
|
|
|