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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_line_height_metrics.cc

Issue 2811783002: [LayoutNG] Move inline files to the inline directory (Closed)
Patch Set: Fix unit tests 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
Index: third_party/WebKit/Source/core/layout/ng/ng_line_height_metrics.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_line_height_metrics.cc b/third_party/WebKit/Source/core/layout/ng/ng_line_height_metrics.cc
deleted file mode 100644
index 8a62dcf74e26d8e6acc2125ec0e7bb03997e54a7..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/core/layout/ng/ng_line_height_metrics.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-// 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/ng_line_height_metrics.h"
-
-#include "core/style/ComputedStyle.h"
-
-namespace blink {
-
-NGLineHeightMetrics::NGLineHeightMetrics(const ComputedStyle& style,
- FontBaseline baseline_type) {
- const SimpleFontData* font_data = style.GetFont().PrimaryFont();
- DCHECK(font_data);
- Initialize(font_data->GetFontMetrics(), baseline_type);
-}
-
-NGLineHeightMetrics::NGLineHeightMetrics(const FontMetrics& font_metrics,
- FontBaseline baseline_type) {
- Initialize(font_metrics, baseline_type);
-}
-
-void NGLineHeightMetrics::Initialize(const FontMetrics& font_metrics,
- FontBaseline baseline_type) {
- ascent = font_metrics.FixedAscent(baseline_type);
- descent = font_metrics.FixedDescent(baseline_type);
-}
-
-void NGLineHeightMetrics::AddLeading(LayoutUnit line_height) {
- 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.
- ascent += half_leading.Floor();
- descent = line_height - ascent;
-}
-
-void NGLineHeightMetrics::Unite(const NGLineHeightMetrics& other) {
- ascent = std::max(ascent, other.ascent);
- descent = std::max(descent, other.descent);
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698