Commit dae891fc authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Make ComputeNGLocalCaretRect() to use text direction of line box

This patch changes |ComputeNGLocalCaretRect()| to use text direction of
line box instead of containing block to handle dir=auto correctly to
pass the test "editing/caret/caret-direction-auto.html" for TextAreaNG.

Before this patch, |ComputeNGLocalCaretRect()| limits caret position to
right edge of line box when dir=auto and text content leads direction as
RTL even if direction of line containing caret is LTR.

After this patch, |ComputeNGLocalCaretRect()| uses direction of line to
limit caret position correctly.

Bug: 1137666
Change-Id: Id8c8245833955427b45a286a2d742c6d31d492eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2497962
Commit-Queue: Kent Tamura <tkent@chromium.org>
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820682}
parent 5e52fddf
......@@ -120,7 +120,7 @@ PhysicalRect ComputeLocalCaretRectAtTextOffset(const NGInlineCursor& cursor,
const ComputedStyle& block_style = fragment.Style();
bool should_align_caret_right =
ShouldAlignCaretRight(block_style.GetTextAlign(is_last_line),
block_style.Direction()) &&
line_box.Current().BaseDirection()) &&
(style.GetUnicodeBidi() != UnicodeBidi::kPlaintext ||
IsLtr(cursor.Current().ResolvedDirection()));
......
......@@ -1183,7 +1183,6 @@ crbug.com/1121942 virtual/layout_ng_printing/printing/webgl-oversized-printing.h
### Textarea NG
crbug.com/1140307 accessibility/inline-text-textarea.html [ Failure ]
crbug.com/1137666 editing/caret/caret-direction-auto.html [ Failure ]
# ====== LayoutNG-only failures until here ======
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment