RubyLB: Add InlineItemResultRubyColumn
It represents data for a kOpenRubyColumn-type InlineItemResult.
This CL has no behavior changes.
Bug: 324111880
Change-Id: Ifc7d9c579abf12378013120101927a7bfb0e3e70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5377563
Commit-Queue: Kent Tamura <tkent@chromium.org>
Auto-Submit: Kent Tamura <tkent@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1276072}
diff --git a/third_party/blink/renderer/core/layout/build.gni b/third_party/blink/renderer/core/layout/build.gni
index 33f60ce..83df94f1 100644
--- a/third_party/blink/renderer/core/layout/build.gni
+++ b/third_party/blink/renderer/core/layout/build.gni
@@ -248,6 +248,7 @@
"inline/inline_item.h",
"inline/inline_item_result.cc",
"inline/inline_item_result.h",
+ "inline/inline_item_result_ruby_column.h",
"inline/inline_item_segment.cc",
"inline/inline_item_segment.h",
"inline/inline_item_span.h",
diff --git a/third_party/blink/renderer/core/layout/inline/inline_item_result.cc b/third_party/blink/renderer/core/layout/inline/inline_item_result.cc
index addd441..da5c4fc7 100644
--- a/third_party/blink/renderer/core/layout/inline/inline_item_result.cc
+++ b/third_party/blink/renderer/core/layout/inline/inline_item_result.cc
@@ -5,6 +5,7 @@
#include "third_party/blink/renderer/core/layout/inline/inline_item_result.h"
#include "third_party/blink/renderer/core/layout/inline/inline_item.h"
+#include "third_party/blink/renderer/core/layout/inline/inline_item_result_ruby_column.h"
#include "third_party/blink/renderer/core/layout/layout_result.h"
#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h"
@@ -57,6 +58,7 @@
visitor->Trace(shape_result);
visitor->Trace(hyphen);
visitor->Trace(layout_result);
+ visitor->Trace(ruby_column);
visitor->Trace(positioned_float);
}
diff --git a/third_party/blink/renderer/core/layout/inline/inline_item_result.h b/third_party/blink/renderer/core/layout/inline/inline_item_result.h
index 7b5729c4..8344ca5 100644
--- a/third_party/blink/renderer/core/layout/inline/inline_item_result.h
+++ b/third_party/blink/renderer/core/layout/inline/inline_item_result.h
@@ -25,6 +25,7 @@
class LayoutResult;
class ShapeResult;
class ShapeResultView;
+struct InlineItemResultRubyColumn;
struct PositionedFloat;
// The result of measuring InlineItem.
@@ -121,6 +122,9 @@
// LayoutResult for atomic inline items.
Member<const LayoutResult> layout_result;
+ // Data for kOpenRubyColumn type. This member is null for other types.
+ Member<InlineItemResultRubyColumn> ruby_column;
+
// PositionedFloat for floating inline items. Should only be present for
// positioned floats (not unpositioned). It indicates where it was placed
// within the BFC.
diff --git a/third_party/blink/renderer/core/layout/inline/inline_item_result_ruby_column.h b/third_party/blink/renderer/core/layout/inline/inline_item_result_ruby_column.h
new file mode 100644
index 0000000..1f417c4f
--- /dev/null
+++ b/third_party/blink/renderer/core/layout/inline/inline_item_result_ruby_column.h
@@ -0,0 +1,33 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INLINE_INLINE_ITEM_RESULT_RUBY_COLUMN_H_
+#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INLINE_INLINE_ITEM_RESULT_RUBY_COLUMN_H_
+
+#include "third_party/blink/renderer/core/layout/inline/line_info.h"
+
+namespace blink {
+
+// A data specific to InlineItemResults with InlineItem::kOpenRubyColumn type.
+struct InlineItemResultRubyColumn
+ : public GarbageCollected<InlineItemResultRubyColumn> {
+ void Trace(Visitor* visitor) const {
+ visitor->Trace(base_line);
+ visitor->Trace(annotation_line_list);
+ }
+
+ // A LineInfo for the base level.
+ LineInfo base_line;
+
+ // A list of annotation level LineInfo. [0] is the outermost one.
+ HeapVector<LineInfo, 1> annotation_line_list;
+
+ // A list of flags for ruby-position:under. The size of this list must be
+ // same as annotation_line_list.
+ Vector<bool, 1> is_under_annotation_list;
+};
+
+} // namespace blink
+
+#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INLINE_INLINE_ITEM_RESULT_RUBY_COLUMN_H_
diff --git a/third_party/blink/renderer/core/layout/inline/line_info.h b/third_party/blink/renderer/core/layout/inline/line_info.h
index cc5bdd9..52b64280 100644
--- a/third_party/blink/renderer/core/layout/inline/line_info.h
+++ b/third_party/blink/renderer/core/layout/inline/line_info.h
@@ -318,4 +318,6 @@
} // namespace blink
+WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::LineInfo)
+
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INLINE_LINE_INFO_H_