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

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

Issue 2867293002: [LayoutNG] Compute baseline from fragment tree (Closed)
Patch Set: Cleanup Created 3 years, 5 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_baseline.h
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_baseline.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_baseline.h
new file mode 100644
index 0000000000000000000000000000000000000000..226dca13e54c13db5400de2eb66d214bbd41aa30
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_baseline.h
@@ -0,0 +1,45 @@
+// 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.
+
+#ifndef NGBaseline_h
+#define NGBaseline_h
+
+#include "platform/LayoutUnit.h"
+#include "platform/fonts/FontBaseline.h"
+
+namespace blink {
+
+class LayoutBox;
+class NGLayoutInputNode;
+
+enum class NGBaselineAlgorithmType {
+ // Compute baselines for atomic inlines.
+ kAtomicInline,
+ // Compute baselines for atomic inlines using the first line style.
+ kAtomicInlineForFirstLine,
+ // Compute baseline of first line box.
+ kFirstLine
+};
+
+// Baselines are products of layout.
+// To compute baseline, add requests to NGConstraintSpace and run Layout().
+struct NGBaselineRequest {
+ NGBaselineAlgorithmType algorithm_type;
+ FontBaseline baseline_type;
+};
+
+// Represents a computed baseline position.
+struct NGBaseline {
+ NGBaselineAlgorithmType algorithm_type;
+ FontBaseline baseline_type;
+ LayoutUnit offset;
+
+ // @return if the node needs to propagate baseline requests/results.
+ static bool ShouldPropagateBaselines(const NGLayoutInputNode);
+ static bool ShouldPropagateBaselines(LayoutBox*);
+};
+
+} // namespace blink
+
+#endif // NGBaseline_h

Powered by Google App Engine
This is Rietveld 408576698