[Editing] Control text truncation based on caret selection [chromium/src : main]

0 views
Skip to first unread message

Sambamurthy Bandaru (Gerrit)

unread,
Feb 13, 2026, 6:07:23 AM (2 days ago) Feb 13
to Shweta Bindal, Rohan Raja, AyeAye, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, feature-v...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, kinuko...@chromium.org, mac-r...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Rohan Raja and Shweta Bindal

Sambamurthy Bandaru added 3 comments

File third_party/blink/renderer/core/editing/selection_editor.cc
Line 153, Patchset 17 (Latest): UpdateContainsEntireSelectionFlagForElements(old_selection, new_selection);
Sambamurthy Bandaru . unresolved

Use below util functions to get old and new elements. If they are not same, set `SetContainsEntireSelection()`

Line 161, Patchset 17 (Latest): Element* element_to_clear = nullptr;
if (!old_selection.IsNone()) {
Node* old_anchor = old_selection.Anchor().AnchorNode();
Node* old_focus = old_selection.Focus().AnchorNode();
if (old_anchor && old_focus &&
old_anchor->parentElement() == old_focus->parentElement()) {
element_to_clear = old_anchor->parentElement();
}
}
Sambamurthy Bandaru . unresolved

Use an existing util function or create a new one to get `element` from selection.

Line 187, Patchset 17 (Latest): if (element_to_clear) {
if (LayoutObject* layout_object = element_to_clear->GetLayoutObject()) {
if (layout_object->ContainsEntireSelection()) {
layout_object->SetContainsEntireSelection(false);
const ComputedStyle* style = element_to_clear->GetComputedStyle();
if (style && !style->TextOverflow().IsClip()) {
layout_object->SetNeedsLayout(
layout_invalidation_reason::kStyleChange);
}
}
}
}
Sambamurthy Bandaru . unresolved

Move this to a function which takes above `element`, and the boolean flag to set

Open in Gerrit

Related details

Attention is currently required from:
  • Rohan Raja
  • Shweta Bindal
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia3efb21eb33b2c5277573048e2dd04991650cc24
Gerrit-Change-Number: 7452739
Gerrit-PatchSet: 17
Gerrit-Owner: Shweta Bindal <shweta...@microsoft.com>
Gerrit-Reviewer: Rohan Raja <ror...@microsoft.com>
Gerrit-Reviewer: Sambamurthy Bandaru <sambamurt...@microsoft.com>
Gerrit-Reviewer: Shweta Bindal <shweta...@microsoft.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-Attention: Shweta Bindal <shweta...@microsoft.com>
Gerrit-Attention: Rohan Raja <ror...@microsoft.com>
Gerrit-Comment-Date: Fri, 13 Feb 2026 11:06:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages