Title: [256667] branches/safari-609-branch
- Revision
- 256667
- Author
- repst...@apple.com
- Date
- 2020-02-14 19:01:22 -0800 (Fri, 14 Feb 2020)
Log Message
Cherry-pick r256207. rdar://problem/59447263
Don't update selection when calling setSelectionRange on a disconnected input element
https://bugs.webkit.org/show_bug.cgi?id=207357
Reviewed by Antti Koivisto.
LayoutTests/imported/w3c:
Rebaselined the test that progressed a little. The test now passes offset checks but still fails direction check.
* web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt:
Source/WebCore:
Don't update FrameSelection when the text form control element is disconnected from document.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setSelectionRange):
LayoutTests:
Rebaselined the test that has progressed with this change.
* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-609-branch/LayoutTests/ChangeLog (256666 => 256667)
--- branches/safari-609-branch/LayoutTests/ChangeLog 2020-02-15 03:01:16 UTC (rev 256666)
+++ branches/safari-609-branch/LayoutTests/ChangeLog 2020-02-15 03:01:22 UTC (rev 256667)
@@ -1,3 +1,49 @@
+2020-02-14 Russell Epstein <repst...@apple.com>
+
+ Cherry-pick r256207. rdar://problem/59447263
+
+ Don't update selection when calling setSelectionRange on a disconnected input element
+ https://bugs.webkit.org/show_bug.cgi?id=207357
+
+ Reviewed by Antti Koivisto.
+
+ LayoutTests/imported/w3c:
+
+ Rebaselined the test that progressed a little. The test now passes offset checks but still fails direction check.
+
+ * web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt:
+
+ Source/WebCore:
+
+ Don't update FrameSelection when the text form control element is disconnected from document.
+
+ * html/HTMLTextFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::setSelectionRange):
+
+ LayoutTests:
+
+ Rebaselined the test that has progressed with this change.
+
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
+ * platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
+ * platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-02-07 Ryosuke Niwa <rn...@webkit.org>
+
+ Don't update selection when calling setSelectionRange on a disconnected input element
+ https://bugs.webkit.org/show_bug.cgi?id=207357
+
+ Reviewed by Antti Koivisto.
+
+ Rebaselined the test that has progressed with this change.
+
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
+ * platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
+ * platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
+
2020-02-13 Russell Epstein <repst...@apple.com>
Cherry-pick r256485. rdar://problem/59430261
Modified: branches/safari-609-branch/LayoutTests/imported/w3c/ChangeLog (256666 => 256667)
--- branches/safari-609-branch/LayoutTests/imported/w3c/ChangeLog 2020-02-15 03:01:16 UTC (rev 256666)
+++ branches/safari-609-branch/LayoutTests/imported/w3c/ChangeLog 2020-02-15 03:01:22 UTC (rev 256667)
@@ -1,3 +1,47 @@
+2020-02-14 Russell Epstein <repst...@apple.com>
+
+ Cherry-pick r256207. rdar://problem/59447263
+
+ Don't update selection when calling setSelectionRange on a disconnected input element
+ https://bugs.webkit.org/show_bug.cgi?id=207357
+
+ Reviewed by Antti Koivisto.
+
+ LayoutTests/imported/w3c:
+
+ Rebaselined the test that progressed a little. The test now passes offset checks but still fails direction check.
+
+ * web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt:
+
+ Source/WebCore:
+
+ Don't update FrameSelection when the text form control element is disconnected from document.
+
+ * html/HTMLTextFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::setSelectionRange):
+
+ LayoutTests:
+
+ Rebaselined the test that has progressed with this change.
+
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
+ * platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
+ * platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-02-07 Ryosuke Niwa <rn...@webkit.org>
+
+ Don't update selection when calling setSelectionRange on a disconnected input element
+ https://bugs.webkit.org/show_bug.cgi?id=207357
+
+ Reviewed by Antti Koivisto.
+
+ Rebaselined the test that progressed a little. The test now passes offset checks but still fails direction check.
+
+ * web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt:
+
2020-02-11 Alan Coon <alanc...@apple.com>
Cherry-pick r255668. rdar://problem/59299120
Modified: branches/safari-609-branch/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt (256666 => 256667)
--- branches/safari-609-branch/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt 2020-02-15 03:01:16 UTC (rev 256666)
+++ branches/safari-609-branch/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt 2020-02-15 03:01:22 UTC (rev 256667)
@@ -1,3 +1,3 @@
-FAIL text field selection for the input textarea assert_equals: updated selectionStart expected 1 but got 0
+FAIL text field selection for the input textarea assert_equals: final selectionDirection expected "forward" but got "none"
Modified: branches/safari-609-branch/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt (256666 => 256667)
--- branches/safari-609-branch/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt 2020-02-15 03:01:16 UTC (rev 256666)
+++ branches/safari-609-branch/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt 2020-02-15 03:01:22 UTC (rev 256667)
@@ -252,12 +252,12 @@
FAIL change state from time to reset Type error
FAIL change state from time to button Type error
FAIL change state from number to hidden Type error
-FAIL change state from number to text assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to search assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to tel assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to url assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to email assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to password assert_equals: selectionStart should be unchanged expected 2 but got 0
+PASS change state from number to text
+PASS change state from number to search
+PASS change state from number to tel
+PASS change state from number to url
+PASS change state from number to email
+PASS change state from number to password
FAIL change state from number to datetime-local Type error
FAIL change state from number to date Type error
FAIL change state from number to month Type error
Modified: branches/safari-609-branch/LayoutTests/platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt (256666 => 256667)
--- branches/safari-609-branch/LayoutTests/platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt 2020-02-15 03:01:16 UTC (rev 256666)
+++ branches/safari-609-branch/LayoutTests/platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt 2020-02-15 03:01:22 UTC (rev 256667)
@@ -252,17 +252,17 @@
FAIL change state from time to reset Type error
FAIL change state from time to button Type error
FAIL change state from number to hidden Type error
-FAIL change state from number to text assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to search assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to tel assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to url assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to email assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to password assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to datetime-local assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to date assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to month assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to week assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to time assert_equals: selectionStart should be unchanged expected 2 but got 0
+PASS change state from number to text
+PASS change state from number to search
+PASS change state from number to tel
+PASS change state from number to url
+PASS change state from number to email
+PASS change state from number to password
+PASS change state from number to datetime-local
+PASS change state from number to date
+PASS change state from number to month
+PASS change state from number to week
+PASS change state from number to time
FAIL change state from number to range Type error
FAIL change state from number to color assert_equals: input.value should be '#000000' after change of state expected "#000000" but got ""
FAIL change state from number to checkbox assert_equals: input.value should be 'on' after change of state expected "on" but got ""
Modified: branches/safari-609-branch/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt (256666 => 256667)
--- branches/safari-609-branch/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt 2020-02-15 03:01:16 UTC (rev 256666)
+++ branches/safari-609-branch/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt 2020-02-15 03:01:22 UTC (rev 256667)
@@ -252,17 +252,17 @@
FAIL change state from time to reset Type error
FAIL change state from time to button Type error
FAIL change state from number to hidden Type error
-FAIL change state from number to text assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to search assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to tel assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to url assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to email assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to password assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to datetime-local assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to date assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to month assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to week assert_equals: selectionStart should be unchanged expected 2 but got 0
-FAIL change state from number to time assert_equals: selectionStart should be unchanged expected 2 but got 0
+PASS change state from number to text
+PASS change state from number to search
+PASS change state from number to tel
+PASS change state from number to url
+PASS change state from number to email
+PASS change state from number to password
+PASS change state from number to datetime-local
+PASS change state from number to date
+PASS change state from number to month
+PASS change state from number to week
+PASS change state from number to time
FAIL change state from number to range Type error
FAIL change state from number to color Type error
FAIL change state from number to checkbox assert_equals: input.value should be 'on' after change of state expected "on" but got ""
Modified: branches/safari-609-branch/Source/WebCore/ChangeLog (256666 => 256667)
--- branches/safari-609-branch/Source/WebCore/ChangeLog 2020-02-15 03:01:16 UTC (rev 256666)
+++ branches/safari-609-branch/Source/WebCore/ChangeLog 2020-02-15 03:01:22 UTC (rev 256667)
@@ -1,3 +1,48 @@
+2020-02-14 Russell Epstein <repst...@apple.com>
+
+ Cherry-pick r256207. rdar://problem/59447263
+
+ Don't update selection when calling setSelectionRange on a disconnected input element
+ https://bugs.webkit.org/show_bug.cgi?id=207357
+
+ Reviewed by Antti Koivisto.
+
+ LayoutTests/imported/w3c:
+
+ Rebaselined the test that progressed a little. The test now passes offset checks but still fails direction check.
+
+ * web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt:
+
+ Source/WebCore:
+
+ Don't update FrameSelection when the text form control element is disconnected from document.
+
+ * html/HTMLTextFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::setSelectionRange):
+
+ LayoutTests:
+
+ Rebaselined the test that has progressed with this change.
+
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
+ * platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
+ * platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-02-07 Ryosuke Niwa <rn...@webkit.org>
+
+ Don't update selection when calling setSelectionRange on a disconnected input element
+ https://bugs.webkit.org/show_bug.cgi?id=207357
+
+ Reviewed by Antti Koivisto.
+
+ Don't update FrameSelection when the text form control element is disconnected from document.
+
+ * html/HTMLTextFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::setSelectionRange):
+
2020-02-13 Russell Epstein <repst...@apple.com>
Revert r256407. rdar://problem/59299143
Modified: branches/safari-609-branch/Source/WebCore/html/HTMLTextFormControlElement.cpp (256666 => 256667)
--- branches/safari-609-branch/Source/WebCore/html/HTMLTextFormControlElement.cpp 2020-02-15 03:01:16 UTC (rev 256666)
+++ branches/safari-609-branch/Source/WebCore/html/HTMLTextFormControlElement.cpp 2020-02-15 03:01:22 UTC (rev 256667)
@@ -289,6 +289,11 @@
auto innerText = innerTextElement();
bool hasFocus = document().focusedElement() == this;
if (!hasFocus && innerText) {
+ if (!isConnected()) {
+ cacheSelection(start, end, direction);
+ return;
+ }
+
// FIXME: Removing this synchronous layout requires fixing setSelectionWithoutUpdatingAppearance not needing up-to-date style.
document().updateLayoutIgnorePendingStylesheets();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes