Fix tree closed due to Missing include in layout_text.cc
Add the missing include related to layout_ng_text_combine.h. It
is needed to create a new instance of LayoutNGTextCombine. The
code is creating the instance without having the necessary include.
BUG=chromium:1221124
Change-Id: Ie33beb56530376fe8aa904e08442872c9548d552
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2968703
Reviewed-by: Amr Aboelkher <amraboelkher@google.com>
Commit-Queue: Amr Aboelkher <amraboelkher@google.com>
Owners-Override: Amr Aboelkher <amraboelkher@google.com>
Cr-Commit-Position: refs/heads/master@{#893386}
diff --git a/third_party/blink/renderer/core/layout/layout_text.cc b/third_party/blink/renderer/core/layout/layout_text.cc
index c377b488..e498fc1 100644
--- a/third_party/blink/renderer/core/layout/layout_text.cc
+++ b/third_party/blink/renderer/core/layout/layout_text.cc
@@ -57,6 +57,7 @@
#include "third_party/blink/renderer/core/layout/line/glyph_overflow.h"
#include "third_party/blink/renderer/core/layout/line/inline_text_box.h"
#include "third_party/blink/renderer/core/layout/ng/inline/layout_ng_text.h"
+#include "third_party/blink/renderer/core/layout/ng/inline/layout_ng_text_combine.h"
#include "third_party/blink/renderer/core/layout/ng/inline/ng_abstract_inline_text_box.h"
#include "third_party/blink/renderer/core/layout/ng/inline/ng_fragment_item.h"
#include "third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.h"
@@ -2784,6 +2785,11 @@
NOT_DESTROYED();
if (UNLIKELY(!IsInLayoutNGInlineFormattingContext()))
return nullptr;
+ // When |this| is in text-combine box, we should use text-combine box as
+ // display client item to paint caret with affine transform.
+ const auto* const text_combine = DynamicTo<LayoutNGTextCombine>(Parent());
+ if (UNLIKELY(text_combine) && text_combine->NeedsAffineTransformInPaint())
+ return text_combine;
if (!IsSelected())
return nullptr;
if (const auto* client = GetSelectionDisplayItemClientMap().at(this))