Closed Bug 1805800 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 37516 - Fix delete character in password field with trailing white spaces

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 37516 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/37516
Details from upstream follow.

Xiaocheng Hu <xiaochengh@chromium.org> wrote:

Fix delete character in password field with trailing white spaces

When deleting a character, DeleteSelectionCommand uses
DeleteInsignificantText for white space fixup, which in turn uses
TextIterator to obtain the white-space-collapsed text of the text node.

However, when working in a password field, TextIterator by default gets
the rendered text, where all characters are replaced by bullets. Then
the fixup code replaces a trailing white space by a bullet.

Since in this case we need the original text, this patch sets
EmitsOriginalText behavior, and also implements it in TextIterator to
fix the bug.

Note: TextIterator had a legacy code path that implements
EmitsOriginalText, but we didn't implement it for NG because we couldn't
find any case where this behavior makes a difference before this bug
report. That's why we left a TODO there without implementing it.

Fixed: 1400844
Change-Id: I7fa5a1372516894c3831e38deb97ed6e3c567ea0
Reviewed-on: https://chromium-review.googlesource.com/4109573
WPT-Export-Revision: a2ada584a860dad50e530d8fed044f616a973bca

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b55e95c1ef55 [wpt PR 37516] - Fix delete character in password field with trailing white spaces, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
You need to log in before you can comment on or make changes to this bug.