Commit ba4cfa8e authored by Yoichi Osato's avatar Yoichi Osato Committed by Commit Bot

[LayoutNG] Not paint ellipsis selection

This patch stops painting selection on ellipsis like
legacy implementation.

This patch fixes:
 fast/css/text-overflow-ellipsis-vertical-select.html
Rebases are image updates for that.

Notes:
FireFox and Edge don't paint it either.
WebKit paints them when any truncated text were selected.
No one (including NG) seems to have implemented the spec behavior:
https://www.w3.org/TR/css-ui-4/#ellipsis-interaction
> Selecting the ellipsis should select the ellipsed text.
> If all of the ellipsed text is selected, UAs should show selection of the ellipsis.
> Behavior of partially-selected ellipsed text is up to the UA.

Bug: 708452
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I4a9c3bc1904b762acefadaf6a90b511de4004078
Reviewed-on: https://chromium-review.googlesource.com/1116401
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570998}
parent b3559beb
...@@ -777,6 +777,9 @@ LayoutSelectionStatus LayoutSelection::ComputeSelectionStatus( ...@@ -777,6 +777,9 @@ LayoutSelectionStatus LayoutSelection::ComputeSelectionStatus(
const NGPaintFragment& fragment) const { const NGPaintFragment& fragment) const {
const NGPhysicalTextFragment& text_fragment = const NGPhysicalTextFragment& text_fragment =
ToNGPhysicalTextFragmentOrDie(fragment.PhysicalFragment()); ToNGPhysicalTextFragmentOrDie(fragment.PhysicalFragment());
// We don't paint selection on ellipsis.
if (text_fragment.StyleVariant() == NGStyleVariant::kEllipsis)
return {0, 0, SelectLineBreak::kNotSelected};
switch (text_fragment.GetLayoutObject()->GetSelectionState()) { switch (text_fragment.GetLayoutObject()->GetSelectionState()) {
case SelectionState::kStart: { case SelectionState::kStart: {
DCHECK(SelectionStart().has_value()); DCHECK(SelectionStart().has_value());
......
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