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

Unified 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698