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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_line_height_metrics.h

Issue 2764753007: [LayoutNG] Add NGLineBoxFragment (Closed)
Patch Set: Rebase again as other CLs landed faster Created 3 years, 9 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 #ifndef NGLineHeightMetrics_h
6 #define NGLineHeightMetrics_h
7
8 #include "core/CoreExport.h"
9 #include "core/layout/ng/ng_physical_fragment.h"
10 #include "platform/fonts/FontBaseline.h"
11
12 namespace blink {
13
14 class ComputedStyle;
15 class FontMetrics;
16
17 // Represents line-progression metrics for line boxes and inline boxes.
18 struct NGLineHeightMetrics {
19 NGLineHeightMetrics() {}
20
21 // Use the leading from the 'line-height' property, or the font metrics of
22 // the primary font if 'line-height: normal'.
23 NGLineHeightMetrics(const ComputedStyle&, FontBaseline);
24
25 // Use the leading from the font metrics.
26 NGLineHeightMetrics(const FontMetrics&, FontBaseline);
27
28 void Unite(const NGLineHeightMetrics&);
29
30 // TODO(kojii): Replace these floats with LayoutUnit.
31 float ascent = 0;
32 float descent = 0;
33 float ascent_and_leading = 0;
34 float descent_and_leading = 0;
35
36 LayoutUnit LineHeight() const {
37 return LayoutUnit(ascent_and_leading + descent_and_leading);
38 }
39
40 private:
41 void Initialize(const FontMetrics&, FontBaseline, float line_height);
42 };
43
44 } // namespace blink
45
46 #endif // NGLineHeightMetrics_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698