commit 9c5a10468e474ed1a00b9b064dbf0b65468b6567
parent e5d9f3de48cf1118cda5726f6e20d93b9a7ba0eb
Author: agoloman <agoloman@mozilla.com>
Date: Wed, 15 Oct 2025 17:27:08 +0300
Revert "Bug 1993351 - Set selection as dirty when unbinding from frame r=masayuki" for causing wpt failures @selection-after-whitespace-change.html.
This reverts commit 11fd6a9e9ea76c5f000e187303ed6a8342fc1ad9.
Diffstat:
2 files changed, 0 insertions(+), 23 deletions(-)
diff --git a/dom/html/TextControlState.cpp b/dom/html/TextControlState.cpp
@@ -2441,12 +2441,6 @@ void TextControlState::UnbindFromFrame(nsTextControlFrame* aFrame) {
DebugOnly<bool> ok = SetValue(value, ValueSetterOption::ByInternalAPI);
// TODO Find something better to do if this fails...
NS_WARNING_ASSERTION(ok, "SetValue() couldn't allocate memory");
- // And mark the selection as dirty to make sure the selection will be
- // restored properly in RestoreSelectionState. See bug 1993351.
- if (IsSelectionCached()) {
- SelectionProperties& props = GetSelectionProperties();
- props.SetIsDirty();
- }
}
}
diff --git a/testing/web-platform/tests/html/semantics/forms/the-textarea-element/selection-after-whitespace-change.html b/testing/web-platform/tests/html/semantics/forms/the-textarea-element/selection-after-whitespace-change.html
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<meta charset="utf-8">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/testdriver.js"></script>
-<script src="/resources/testdriver-vendor.js"></script>
-<textarea id="t" style="white-space: nowrap">Hello</textarea>
-<script>
-promise_test(async () => {
- // Home and Delete
- await test_driver.send_keys(t, ["\uE011", "\uE017"]);
- t.style.whiteSpace = "pre-line";
- await new Promise(setTimeout);
- assert_equals(t.selectionStart, 0, "selectionStart should remain 0");
- assert_equals(t.selectionEnd, 0, "selectionEnd should remain 0");
-}, "Changing white-space should not change selection");
-</script>