ContainsSelectionFocus()) {Shweta BindalI guess `ContainsSelectionFocus()` should be `object_to_check->ContainsSelectionFocus()` for the following case:
```html
<div style="text-overflow:ellispsis">
<div>sub-block</div>
foo | bar (this is wrapped by an anonymous block-flow)
</div>
```
Good catch. Changed to object_to_check->ContainsSelectionFocus() and set the flag on the non-anonymous parent that owns the text-overflow style.
Since ShouldTruncateOverflowingText() is evaluated during each child's inline layout and LayoutNG caches child results, the flag change alone doesn't cause cache misses — so we explicitly call SetNeedsLayout() on each block child (and on the block itself when it has no block children) to force re-evaluation.
Shweta BindalWhy will it be removed?
Kent TamuraIt was written when someone added change in styleadjuster to change text-overflow property on focus. Now since we are directly setting it from layout, I dont think it will matter if placeholder is clipped or not since user cannot interact with placeholder in any way
Shweta BindalDo you mean this CL will change the placeholder/autocomplete behavior?
Will a placeholder have no ellipsis? Will a placeholder have an ellipsis even if the text control is focused? What about interoperability with other browsers? Can we change the behavior by a separated patch?
Anyway, we should update the test for the new behavior, not remove the test.
For placeholder yes behavior will change, placeholder's ellipsis text will not we converted into clipped on selection or focus.
Firefox also behaves in the same way
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Shweta BindalWhy will it be removed?
Kent TamuraIt was written when someone added change in styleadjuster to change text-overflow property on focus. Now since we are directly setting it from layout, I dont think it will matter if placeholder is clipped or not since user cannot interact with placeholder in any way
Shweta BindalDo you mean this CL will change the placeholder/autocomplete behavior?
Will a placeholder have no ellipsis? Will a placeholder have an ellipsis even if the text control is focused? What about interoperability with other browsers? Can we change the behavior by a separated patch?
Anyway, we should update the test for the new behavior, not remove the test.
For placeholder yes behavior will change, placeholder's ellipsis text will not we converted into clipped on selection or focus.
Firefox also behaves in the same way
I recommend to drop the placeholder behavior change from this CL, and handle it in a separated CL and behind a separated runtime flag.
Shweta BindalWhy will it be removed?
Kent TamuraIt was written when someone added change in styleadjuster to change text-overflow property on focus. Now since we are directly setting it from layout, I dont think it will matter if placeholder is clipped or not since user cannot interact with placeholder in any way
Shweta BindalDo you mean this CL will change the placeholder/autocomplete behavior?
Will a placeholder have no ellipsis? Will a placeholder have an ellipsis even if the text control is focused? What about interoperability with other browsers? Can we change the behavior by a separated patch?
Anyway, we should update the test for the new behavior, not remove the test.
Kent TamuraFor placeholder yes behavior will change, placeholder's ellipsis text will not we converted into clipped on selection or focus.
Firefox also behaves in the same way
I recommend to drop the placeholder behavior change from this CL, and handle it in a separated CL and behind a separated runtime flag.
Made the changes. Will handle removing styleAdjuster code in separate PR
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
during editing. This was a hack in StyleAdjuster.The hack in StyleAdjust is only for placeholder and suggestions. This sentense should be removed.
<input>'s behavior is in TextControlInnerEditorElement::CustomStyleForLayoutObject().
The hack in StyleAdjust is only for placeholder and suggestions. This sentense should be removed.
<input>'s behavior is in TextControlInnerEditorElement::CustomStyleForLayoutObject().
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/58159.
When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.
WPT Export docs:
https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
38 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
[Editing] Control text truncation based on selection
Previously, text-overflow ellipsis was converted to clip
for focused input elements and placeholders to avoid rendering ellipsis
during editing.
Instead:
- Add |LayoutObject::ContainsSelection()| bitfield to track selection state
- In |SelectionEditor::SetSelection()|, notify parent elements of selection
changes and update their |ContainsSelection()| state
- In InlineLayoutAlgorithm, skip ellipsis truncation if block contains
selection |LayoutBlockFlow::ContainsSelection()|
New WPT tests verify ellipsis suppression in editable div/input/textarea
with caret. Updates multiple platform baselines for selection-aware
ellipsis rendering.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/58159
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
return block;This doesn't do what it says in the method name - e.g. it can return a non-LayoutBlock object is this safe?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |