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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.cc

Issue 2803433002: [LayoutNG] Initial support for the 'vertical-align' property (Closed)
Patch Set: Move NGInlineBoxState to its own file 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698