Diff
Modified: trunk/LayoutTests/ChangeLog (291554 => 291555)
--- trunk/LayoutTests/ChangeLog 2022-03-21 08:45:10 UTC (rev 291554)
+++ trunk/LayoutTests/ChangeLog 2022-03-21 09:27:07 UTC (rev 291555)
@@ -1,3 +1,13 @@
+2022-03-21 Ziran Sun <z...@igalia.com>
+
+ [selection] HTMLTextFormControlElement::subtreeHasChanged() shouldn't be called in setRangeText
+ https://bugs.webkit.org/show_bug.cgi?id=237720
+
+ Reviewed by Chris Dumez.
+
+ Update test expectation as the test is now passing.
+ * fast/forms/setrangetext-expected.txt:
+
2022-03-21 Carlos Garcia Campos <cgar...@igalia.com>
REGRESSION(r286955): Rendering Links during search: highlighting fails
Modified: trunk/LayoutTests/fast/forms/setrangetext-expected.txt (291554 => 291555)
--- trunk/LayoutTests/fast/forms/setrangetext-expected.txt 2022-03-21 08:45:10 UTC (rev 291554)
+++ trunk/LayoutTests/fast/forms/setrangetext-expected.txt 2022-03-21 09:27:07 UTC (rev 291555)
@@ -597,7 +597,7 @@
Check that setRangeText() on disconnected elements doesn't crash and has proper values.
element.value = '0123456789'
element.setRangeText('ABC', 0, 0, 'select')
-FAIL element.value should be ABC0123456789. Was 0123456789.
+PASS element.value is "ABC0123456789"
Running tests on input with attributes: {"type":"button"}
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (291554 => 291555)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2022-03-21 08:45:10 UTC (rev 291554)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2022-03-21 09:27:07 UTC (rev 291555)
@@ -1,3 +1,14 @@
+2022-03-21 Ziran Sun <z...@igalia.com>
+
+ [selection] HTMLTextFormControlElement::subtreeHasChanged() shouldn't be called in setRangeText
+ https://bugs.webkit.org/show_bug.cgi?id=237720
+
+ Reviewed by Chris Dumez.
+
+ Update test expectations as more sub-tests are now passing.
+ * web-platform-tests/html/semantics/forms/textfieldselection/selection-value-interactions-expected.txt:
+ * web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setRangeText-expected.txt:
+
2022-03-20 Oriol Brufau <obru...@igalia.com>
Fix CSS cascade regarding logical properties
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-value-interactions-expected.txt (291554 => 291555)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-value-interactions-expected.txt 2022-03-21 08:45:10 UTC (rev 291554)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-value-interactions-expected.txt 2022-03-21 09:27:07 UTC (rev 291555)
@@ -1,6 +1,6 @@
-FAIL value dirty flag behavior after setRangeText on textarea not in body assert_equals: Calling setRangeText should set the value dirty flag expected "somexyzing" but got "set range text"
-FAIL value dirty flag behavior after setRangeText on input not in body assert_equals: Calling setRangeText should set the value dirty flag expected "somexyzing" but got "set range text"
+PASS value dirty flag behavior after setRangeText on textarea not in body
+PASS value dirty flag behavior after setRangeText on input not in body
PASS value dirty flag behavior after setRangeText on textarea in body
PASS value dirty flag behavior after setRangeText on input in body
PASS value dirty flag behavior after setRangeText on textarea in body with parsed default value
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setRangeText-expected.txt (291554 => 291555)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setRangeText-expected.txt 2022-03-21 08:45:10 UTC (rev 291554)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setRangeText-expected.txt 2022-03-21 09:27:07 UTC (rev 291555)
@@ -56,12 +56,12 @@
NOTRUN password setRangeText fires a select event
NOTRUN password setRangeText fires a select event when fully selected
NOTRUN password setRangeText fires a select event after select()
-FAIL display_none setRangeText with only one argument replaces the value between selectionStart and selectionEnd, otherwise replaces the value between 2nd and 3rd arguments assert_equals: expected "foobar2bar" but got "foobar"
-FAIL display_none selectionMode missing assert_equals: expected "foobar2bar" but got "foobar"
-FAIL display_none selectionMode 'select' assert_equals: expected "foofoo" but got "foobar"
-FAIL display_none selectionMode 'start' assert_equals: expected "foofoo" but got "foobar"
-FAIL display_none selectionMode 'end' assert_equals: expected "foofoobar" but got "foobar"
-FAIL display_none selectionMode 'preserve' assert_equals: expected "foo" but got "foobar"
+PASS display_none setRangeText with only one argument replaces the value between selectionStart and selectionEnd, otherwise replaces the value between 2nd and 3rd arguments
+PASS display_none selectionMode missing
+PASS display_none selectionMode 'select'
+PASS display_none selectionMode 'start'
+PASS display_none selectionMode 'end'
+PASS display_none selectionMode 'preserve'
PASS display_none setRangeText with 3rd argument greater than 2nd argument throws an IndexSizeError exception
PASS display_none setRangeText without argument throws a type error
NOTRUN display_none setRangeText fires a select event
@@ -78,12 +78,12 @@
NOTRUN textarea setRangeText fires a select event
NOTRUN textarea setRangeText fires a select event when fully selected
NOTRUN textarea setRangeText fires a select event after select()
-FAIL input_not_in_doc setRangeText with only one argument replaces the value between selectionStart and selectionEnd, otherwise replaces the value between 2nd and 3rd arguments assert_equals: expected "foobar2bar" but got "foobar"
-FAIL input_not_in_doc selectionMode missing assert_equals: expected "foobar2bar" but got "foobar"
-FAIL input_not_in_doc selectionMode 'select' assert_equals: expected "foofoo" but got "foobar"
-FAIL input_not_in_doc selectionMode 'start' assert_equals: expected "foofoo" but got "foobar"
-FAIL input_not_in_doc selectionMode 'end' assert_equals: expected "foofoobar" but got "foobar"
-FAIL input_not_in_doc selectionMode 'preserve' assert_equals: expected "foo" but got "foobar"
+PASS input_not_in_doc setRangeText with only one argument replaces the value between selectionStart and selectionEnd, otherwise replaces the value between 2nd and 3rd arguments
+PASS input_not_in_doc selectionMode missing
+PASS input_not_in_doc selectionMode 'select'
+PASS input_not_in_doc selectionMode 'start'
+PASS input_not_in_doc selectionMode 'end'
+PASS input_not_in_doc selectionMode 'preserve'
PASS input_not_in_doc setRangeText with 3rd argument greater than 2nd argument throws an IndexSizeError exception
PASS input_not_in_doc setRangeText without argument throws a type error
NOTRUN input_not_in_doc setRangeText fires a select event
Modified: trunk/Source/WebCore/ChangeLog (291554 => 291555)
--- trunk/Source/WebCore/ChangeLog 2022-03-21 08:45:10 UTC (rev 291554)
+++ trunk/Source/WebCore/ChangeLog 2022-03-21 09:27:07 UTC (rev 291555)
@@ -1,3 +1,19 @@
+2022-03-21 Ziran Sun <z...@igalia.com>
+
+ [selection] HTMLTextFormControlElement::subtreeHasChanged() shouldn't be called in setRangeText
+ https://bugs.webkit.org/show_bug.cgi?id=237720
+
+ Reviewed by Chris Dumez.
+
+ We shouldn't call HTMLTextFormControlElement::subtreeHasChanged() in HTMLTextFormControlElement::setRangeText.
+ It has been removed in patch for bug 237641. This patch is to further remove unnecessary code.
+
+ This change refers and imports some of the changes in chromium CL at
+ https://codereview.chromium.org/1577243002
+
+ * html/HTMLTextFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::setRangeText):
+
2022-03-21 Carlos Garcia Campos <cgar...@igalia.com>
REGRESSION(r286955): Rendering Links during search: highlighting fails
Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (291554 => 291555)
--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp 2022-03-21 08:45:10 UTC (rev 291554)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp 2022-03-21 09:27:07 UTC (rev 291555)
@@ -255,13 +255,6 @@
else
text.insert(replacement, start);
- // FIXME: This shouldn't need synchronous style update, or renderer at all.
- if (!renderer())
- document().updateStyleIfNeeded();
-
- if (!renderer())
- return { };
-
setValue(text, TextFieldEventBehavior::DispatchNoEvent, TextControlSetValueSelection::DoNotSet);
if (equalLettersIgnoringASCIICase(selectionMode, "select")) {