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

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

Issue 2803433002: [LayoutNG] Initial support for the 'vertical-align' property (Closed)
Patch Set: Move all On*() to NGInlineLayoutStateStack 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/inline/ng_line_height_metrics.h
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_height_metrics.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_height_metrics.h
index 46125ce733afffc8af686351765028660088c7d7..8c171a1762efc351e65ccb900462e781c3f1ba61 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_height_metrics.h
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_height_metrics.h
@@ -19,7 +19,8 @@ class FontMetrics;
// compute metrics for line boxes.
// https://drafts.csswg.org/css2/visudet.html#line-height
struct NGLineHeightMetrics {
- NGLineHeightMetrics() {}
+ NGLineHeightMetrics()
+ : ascent(LayoutUnit::Min()), descent(LayoutUnit::Min()) {}
NGLineHeightMetrics(LayoutUnit initial_ascent, LayoutUnit initial_descent)
: ascent(initial_ascent), descent(initial_descent) {}
@@ -30,10 +31,15 @@ struct NGLineHeightMetrics {
// Compute from FontMetrics. The leading is not included.
NGLineHeightMetrics(const FontMetrics&, FontBaseline);
+ bool IsEmpty() const { return ascent == LayoutUnit::Min(); }
+
// Add the leading. Half the leading is added to ascent and descent each.
// https://drafts.csswg.org/css2/visudet.html#leading
void AddLeading(LayoutUnit line_height);
+ // Move the metrics by the specified amount, in line progression direction.
+ void Move(LayoutUnit);
+
// Unite a metrics for an inline box to a metrics for a line box.
void Unite(const NGLineHeightMetrics&);

Powered by Google App Engine
This is Rietveld 408576698