From 99ff08340f12db8d867a0ed04f176802b7e0a355 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 14 Jul 2023 12:29:51 -0700 Subject: [PATCH] Remove incremental attribute and search event https://bugs.webkit.org/show_bug.cgi?id=195818 rdar://48937114 Reviewed by Aditya Keerthi. These are non-standard and barely used. They are put behind a flag and will be kept around for a while in case they are still being used somewhere. * LayoutTests/TestExpectations: * LayoutTests/fast/dom/Window/get-set-properties-expected.txt: * LayoutTests/fast/dom/Window/get-set-properties.html: * LayoutTests/fast/dom/Window/resources/window-properties.js: * LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt: * LayoutTests/fast/dom/event-attribute-availability-expected.txt: * LayoutTests/fast/dom/event-attribute-availability.html: * LayoutTests/fast/dom/event-handler-attributes-expected.txt: * LayoutTests/fast/dom/event-handler-attributes.html: * LayoutTests/fast/dom/resources/wrapper-identity-base.js: * LayoutTests/fast/dom/wrapper-identity-expected.txt: * LayoutTests/fast/events/onsearch-enter-expected.txt: Removed. * LayoutTests/fast/events/onsearch-enter.html: Removed. * LayoutTests/fast/forms/incremental-dom-property-expected.txt: Removed. * LayoutTests/fast/forms/incremental-dom-property.html: Removed. * LayoutTests/fast/forms/input-search-press-escape-key-expected.txt: Removed. * LayoutTests/fast/forms/input-search-press-escape-key.html: Removed. * LayoutTests/fast/forms/search-event-delay-expected.txt: Removed. * LayoutTests/fast/forms/search-event-delay.html: Removed. * LayoutTests/http/tests/security/cross-frame-access-get-expected.txt: * LayoutTests/http/tests/security/cross-frame-access-get.html: * LayoutTests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor-expected.txt: * LayoutTests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html: * LayoutTests/http/tests/security/cross-frame-access-put-expected.txt: * LayoutTests/http/tests/security/cross-frame-access-put.html: * LayoutTests/http/tests/security/resources/cross-frame-iframe-for-put-test.html: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/historical-expected.txt: * LayoutTests/platform/gtk/fast/dom/Window/window-lookup-precedence-expected.txt: * LayoutTests/platform/ios/TestExpectations: * LayoutTests/platform/mac-wk2/fast/dom/Window/window-lookup-precedence-expected.txt: * LayoutTests/platform/mac/fast/dom/objc-wrapper-identity-expected.txt: * LayoutTests/platform/wincairo/TestExpectations: * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h: * Source/WebCore/bindings/js/WebCoreBuiltinNames.h: * Source/WebCore/dom/GlobalEventHandlers.idl: * Source/WebCore/html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): * Source/WebCore/html/HTMLInputElement.idl: * Source/WebCore/html/SearchInputType.cpp: (WebCore::SearchInputType::handleKeydownEvent): (WebCore::SearchInputType::searchEventsShouldBeDispatched const): * Source/WebCore/html/shadow/TextControlInnerElements.cpp: (WebCore::SearchFieldCancelButtonElement::defaultEventHandler): * Source/WebCore/rendering/RenderSearchField.cpp: (WebCore::RenderSearchField::valueChanged): * Source/WebKit/Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultSearchInputIncrementalAttributeAndSearchEventEnabled): * Source/WebKit/Shared/WebPreferencesDefaultValues.h: * Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h: * Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm: (WebKit::defaultSearchInputIncrementalAttributeAndSearchEventEnabled): Canonical link: https://commits.webkit.org/266068@main --- LayoutTests/TestExpectations | 2 - .../Window/get-set-properties-expected.txt | 2 - .../fast/dom/Window/get-set-properties.html | 1 - .../dom/Window/resources/window-properties.js | 1 - .../window-lookup-precedence-expected.txt | 2 - .../event-attribute-availability-expected.txt | 8 -- .../dom/event-attribute-availability.html | 2 +- .../dom/event-handler-attributes-expected.txt | 10 --- .../fast/dom/event-handler-attributes.html | 1 - .../dom/resources/wrapper-identity-base.js | 1 - .../fast/dom/wrapper-identity-expected.txt | 1 - .../fast/events/onsearch-enter-expected.txt | 4 - LayoutTests/fast/events/onsearch-enter.html | 25 ------ .../incremental-dom-property-expected.txt | 13 --- .../fast/forms/incremental-dom-property.html | 28 ------- ...input-search-press-escape-key-expected.txt | 17 ---- .../forms/input-search-press-escape-key.html | 79 ------------------- .../forms/search-event-delay-expected.txt | 9 --- .../fast/forms/search-event-delay.html | 64 --------------- .../cross-frame-access-get-expected.txt | 2 - .../security/cross-frame-access-get.html | 1 - ...cess-getOwnPropertyDescriptor-expected.txt | 2 - ...frame-access-getOwnPropertyDescriptor.html | 1 - .../cross-frame-access-put-expected.txt | 2 - .../security/cross-frame-access-put.html | 1 - .../cross-frame-iframe-for-put-test.html | 2 - .../semantics/forms/historical-expected.txt | 8 +- .../window-lookup-precedence-expected.txt | 2 - LayoutTests/platform/ios/TestExpectations | 3 - .../window-lookup-precedence-expected.txt | 2 - .../dom/objc-wrapper-identity-expected.txt | 1 - .../platform/wincairo/TestExpectations | 1 - .../Preferences/UnifiedWebPreferences.yaml | 14 ++++ .../wtf/cocoa/RuntimeApplicationChecksCocoa.h | 1 + .../WebCore/bindings/js/WebCoreBuiltinNames.h | 1 + Source/WebCore/dom/GlobalEventHandlers.idl | 2 +- Source/WebCore/html/HTMLInputElement.cpp | 3 +- Source/WebCore/html/HTMLInputElement.idl | 2 +- Source/WebCore/html/SearchInputType.cpp | 6 +- .../html/shadow/TextControlInnerElements.cpp | 3 +- .../WebCore/rendering/RenderSearchField.cpp | 3 +- .../Shared/WebPreferencesDefaultValues.cpp | 10 +++ .../Shared/WebPreferencesDefaultValues.h | 1 + .../mac/WebView/WebPreferencesDefaultValues.h | 1 + .../WebView/WebPreferencesDefaultValues.mm | 6 ++ 45 files changed, 51 insertions(+), 300 deletions(-) delete mode 100644 LayoutTests/fast/events/onsearch-enter-expected.txt delete mode 100644 LayoutTests/fast/events/onsearch-enter.html delete mode 100644 LayoutTests/fast/forms/incremental-dom-property-expected.txt delete mode 100644 LayoutTests/fast/forms/incremental-dom-property.html delete mode 100644 LayoutTests/fast/forms/input-search-press-escape-key-expected.txt delete mode 100644 LayoutTests/fast/forms/input-search-press-escape-key.html delete mode 100644 LayoutTests/fast/forms/search-event-delay-expected.txt delete mode 100644 LayoutTests/fast/forms/search-event-delay.html diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations index 09abb20f169a..c0309b4cf7e9 100644 --- a/LayoutTests/TestExpectations +++ b/LayoutTests/TestExpectations @@ -1361,8 +1361,6 @@ webkit.org/b/72698 media/audio-garbage-collect.html [ Skip ] # This test times out. webkit.org/b/172527 fast/mediacapturefromelement/CanvasCaptureMediaStream-request-frame-events.html [ Skip ] -webkit.org/b/53990 fast/forms/search-event-delay.html [ Pass Failure ] - webkit.org/b/124932 media/video-size.html [ Pass Failure ] webkit.org/b/126166 [ Debug ] js/dfg-int32array.html [ Skip ] diff --git a/LayoutTests/fast/dom/Window/get-set-properties-expected.txt b/LayoutTests/fast/dom/Window/get-set-properties-expected.txt index 971ef67ecced..0a33bbe90cfb 100644 --- a/LayoutTests/fast/dom/Window/get-set-properties-expected.txt +++ b/LayoutTests/fast/dom/Window/get-set-properties-expected.txt @@ -342,8 +342,6 @@ PASS: canGet('onresize') should be 'true' and is. PASS: canSet('onresize') should be 'true' and is. PASS: canGet('onscroll') should be 'true' and is. PASS: canSet('onscroll') should be 'true' and is. -PASS: canGet('onsearch') should be 'true' and is. -PASS: canSet('onsearch') should be 'true' and is. PASS: canGet('onselect') should be 'true' and is. PASS: canSet('onselect') should be 'true' and is. PASS: canGet('onsubmit') should be 'true' and is. diff --git a/LayoutTests/fast/dom/Window/get-set-properties.html b/LayoutTests/fast/dom/Window/get-set-properties.html index 4ea5a9ef74b8..8708285fcc01 100644 --- a/LayoutTests/fast/dom/Window/get-set-properties.html +++ b/LayoutTests/fast/dom/Window/get-set-properties.html @@ -243,7 +243,6 @@ "onreset", "onresize", "onscroll", - "onsearch", "onselect", "onsubmit", "onunload", diff --git a/LayoutTests/fast/dom/Window/resources/window-properties.js b/LayoutTests/fast/dom/Window/resources/window-properties.js index 1e96d847d8ca..0805fda362e5 100644 --- a/LayoutTests/fast/dom/Window/resources/window-properties.js +++ b/LayoutTests/fast/dom/Window/resources/window-properties.js @@ -186,7 +186,6 @@ var propertyInfo = [ ["onreset", "object"], ["onresize", "object"], ["onscroll", "object"], - ["onsearch", "object"], ["onselect", "object"], ["onsubmit", "object"], ["onunload", "object"], diff --git a/LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt b/LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt index 5e1f6abb9e93..d9db88205111 100644 --- a/LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt +++ b/LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt @@ -373,8 +373,6 @@ PASS win['onresize'] is null PASS win['onresize'] is null PASS win['onscroll'] is null PASS win['onscroll'] is null -PASS win['onsearch'] is null -PASS win['onsearch'] is null PASS win['onselect'] is null PASS win['onselect'] is null PASS win['onsubmit'] is null diff --git a/LayoutTests/fast/dom/event-attribute-availability-expected.txt b/LayoutTests/fast/dom/event-attribute-availability-expected.txt index 7a14e76b091b..48fff0a8fc50 100644 --- a/LayoutTests/fast/dom/event-attribute-availability-expected.txt +++ b/LayoutTests/fast/dom/event-attribute-availability-expected.txt @@ -40,7 +40,6 @@ PASS 'oncopy' in element is true PASS 'onbeforepaste' in element is true PASS 'onpaste' in element is true PASS 'onreset' in element is true -PASS 'onsearch' in element is true PASS 'onselectstart' in element is true Test SVGElement PASS 'onabort' in svgelement is true @@ -79,7 +78,6 @@ PASS 'oncopy' in svgelement is true PASS 'onbeforepaste' in svgelement is true PASS 'onpaste' in svgelement is true PASS 'onreset' in svgelement is true -PASS 'onsearch' in svgelement is true PASS 'onselectstart' in svgelement is true Test Document @@ -119,7 +117,6 @@ PASS 'oncopy' in document is true PASS 'onbeforepaste' in document is true PASS 'onpaste' in document is true PASS 'onreset' in document is true -PASS 'onsearch' in document is true PASS 'onselectstart' in document is true Test Window @@ -159,7 +156,6 @@ PASS 'oncopy' in window is true FAIL 'onbeforepaste' in window should be true. Was false. PASS 'onpaste' in window is true PASS 'onreset' in window is true -PASS 'onsearch' in window is true PASS 'onselectstart' in window is true Test Text Node @@ -199,7 +195,6 @@ PASS 'oncopy' in textNode is false PASS 'onbeforepaste' in textNode is false PASS 'onpaste' in textNode is false PASS 'onreset' in textNode is false -PASS 'onsearch' in textNode is false PASS 'onselectstart' in textNode is false Test Attribute @@ -239,7 +234,6 @@ PASS 'oncopy' in attribute is false PASS 'onbeforepaste' in attribute is false PASS 'onpaste' in attribute is false PASS 'onreset' in attribute is false -PASS 'onsearch' in attribute is false PASS 'onselectstart' in attribute is false Test HTMLBodyElement @@ -279,7 +273,6 @@ PASS 'oncopy' in body is true PASS 'onbeforepaste' in body is true PASS 'onpaste' in body is true PASS 'onreset' in body is true -PASS 'onsearch' in body is true PASS 'onselectstart' in body is true PASS 'onbeforeunload' in body is true PASS 'onmessage' in body is true @@ -330,7 +323,6 @@ PASS 'oncopy' in frameSet is true PASS 'onbeforepaste' in frameSet is true PASS 'onpaste' in frameSet is true PASS 'onreset' in frameSet is true -PASS 'onsearch' in frameSet is true PASS 'onselectstart' in frameSet is true PASS 'onbeforeunload' in frameSet is true PASS 'onmessage' in frameSet is true diff --git a/LayoutTests/fast/dom/event-attribute-availability.html b/LayoutTests/fast/dom/event-attribute-availability.html index 484fb1846450..f7076b987187 100644 --- a/LayoutTests/fast/dom/event-attribute-availability.html +++ b/LayoutTests/fast/dom/event-attribute-availability.html @@ -20,7 +20,7 @@ // "onshow", "onstalled", "onsuspend", "ontimeupdate", "onvolumechange", "onwaiting", // WebKit extensions - "onbeforecut", "oncut", "onbeforecopy", "oncopy", "onbeforepaste", "onpaste", "onreset", "onsearch", + "onbeforecut", "oncut", "onbeforecopy", "oncopy", "onbeforepaste", "onpaste", "onreset", "onselectstart" ]; diff --git a/LayoutTests/fast/dom/event-handler-attributes-expected.txt b/LayoutTests/fast/dom/event-handler-attributes-expected.txt index 7c2581c6fe3f..ae3621ffcce1 100644 --- a/LayoutTests/fast/dom/event-handler-attributes-expected.txt +++ b/LayoutTests/fast/dom/event-handler-attributes-expected.txt @@ -64,7 +64,6 @@ PASS testScriptAttribute(window, "ratechange") is "window" PASS testScriptAttribute(window, "reset") is "window" PASS testScriptAttribute(window, "resize") is "window" PASS testScriptAttribute(window, "scroll") is "window" -PASS testScriptAttribute(window, "search") is "window" PASS testScriptAttribute(window, "seeked") is "window" PASS testScriptAttribute(window, "seeking") is "window" PASS testScriptAttribute(window, "select") is "window" @@ -153,7 +152,6 @@ PASS testScriptAttribute(document, "readystatechange") is "document" PASS testScriptAttribute(document, "reset") is "document" PASS testScriptAttribute(document, "resize") is "document" PASS testScriptAttribute(document, "scroll") is "document" -PASS testScriptAttribute(document, "search") is "document" PASS testScriptAttribute(document, "seeked") is "document" PASS testScriptAttribute(document, "seeking") is "document" PASS testScriptAttribute(document, "select") is "document" @@ -248,7 +246,6 @@ PASS testElementAttribute(element, "ratechange") is "target" PASS testElementAttribute(element, "reset") is "target" PASS testElementAttribute(element, "resize") is "target" PASS testElementAttribute(element, "scroll") is "target" -PASS testElementAttribute(element, "search") is "target" PASS testElementAttribute(element, "seeked") is "target" PASS testElementAttribute(element, "seeking") is "target" PASS testElementAttribute(element, "select") is "target" @@ -341,7 +338,6 @@ PASS testElementAttribute(inputElement, "ratechange") is "target" PASS testElementAttribute(inputElement, "reset") is "target" PASS testElementAttribute(inputElement, "resize") is "target" PASS testElementAttribute(inputElement, "scroll") is "target" -PASS testElementAttribute(inputElement, "search") is "target" PASS testElementAttribute(inputElement, "seeked") is "target" PASS testElementAttribute(inputElement, "seeking") is "target" PASS testElementAttribute(inputElement, "select") is "target" @@ -434,7 +430,6 @@ PASS testElementAttribute(audioElement, "ratechange") is "target" PASS testElementAttribute(audioElement, "reset") is "target" PASS testElementAttribute(audioElement, "resize") is "target" PASS testElementAttribute(audioElement, "scroll") is "target" -PASS testElementAttribute(audioElement, "search") is "target" PASS testElementAttribute(audioElement, "seeked") is "target" PASS testElementAttribute(audioElement, "seeking") is "target" PASS testElementAttribute(audioElement, "select") is "target" @@ -527,7 +522,6 @@ PASS testElementAttribute(videoElement, "ratechange") is "target" PASS testElementAttribute(videoElement, "reset") is "target" PASS testElementAttribute(videoElement, "resize") is "target" PASS testElementAttribute(videoElement, "scroll") is "target" -PASS testElementAttribute(videoElement, "search") is "target" PASS testElementAttribute(videoElement, "seeked") is "target" PASS testElementAttribute(videoElement, "seeking") is "target" PASS testElementAttribute(videoElement, "select") is "target" @@ -633,7 +627,6 @@ PASS testElementAttribute(bodyElement, "progress") is "target" PASS testElementAttribute(bodyElement, "ratechange") is "target" PASS testElementAttribute(bodyElement, "reset") is "target" FAIL testElementAttribute(bodyElement, "scroll") should be target. Was window. -PASS testElementAttribute(bodyElement, "search") is "target" PASS testElementAttribute(bodyElement, "seeked") is "target" PASS testElementAttribute(bodyElement, "seeking") is "target" PASS testElementAttribute(bodyElement, "select") is "target" @@ -729,7 +722,6 @@ PASS testElementAttribute(framesetElement, "progress") is "target" PASS testElementAttribute(framesetElement, "ratechange") is "target" PASS testElementAttribute(framesetElement, "reset") is "target" FAIL testElementAttribute(framesetElement, "scroll") should be target. Was window. -PASS testElementAttribute(framesetElement, "search") is "target" PASS testElementAttribute(framesetElement, "seeked") is "target" PASS testElementAttribute(framesetElement, "seeking") is "target" PASS testElementAttribute(framesetElement, "select") is "target" @@ -812,7 +804,6 @@ PASS testElementAttribute(rectElement, "ratechange") is "target" PASS testElementAttribute(rectElement, "reset") is "target" PASS testElementAttribute(rectElement, "resize") is "target" PASS testElementAttribute(rectElement, "scroll") is "target" -PASS testElementAttribute(rectElement, "search") is "target" PASS testElementAttribute(rectElement, "seeked") is "target" PASS testElementAttribute(rectElement, "seeking") is "target" PASS testElementAttribute(rectElement, "select") is "target" @@ -915,7 +906,6 @@ PASS testElementAttribute(nonHTMLElement, "readystatechange") is "none" PASS testElementAttribute(nonHTMLElement, "reset") is "none" PASS testElementAttribute(nonHTMLElement, "resize") is "none" PASS testElementAttribute(nonHTMLElement, "scroll") is "none" -PASS testElementAttribute(nonHTMLElement, "search") is "none" PASS testElementAttribute(nonHTMLElement, "seeked") is "none" PASS testElementAttribute(nonHTMLElement, "seeking") is "none" PASS testElementAttribute(nonHTMLElement, "select") is "none" diff --git a/LayoutTests/fast/dom/event-handler-attributes.html b/LayoutTests/fast/dom/event-handler-attributes.html index 2cb922d78ada..5f1e2b0ddde1 100644 --- a/LayoutTests/fast/dom/event-handler-attributes.html +++ b/LayoutTests/fast/dom/event-handler-attributes.html @@ -76,7 +76,6 @@ "transitionend", "volumechange", "waiting", - "search", "wheel", "webkitanimationend", "webkitanimationiteration", diff --git a/LayoutTests/fast/dom/resources/wrapper-identity-base.js b/LayoutTests/fast/dom/resources/wrapper-identity-base.js index 806b29c4d410..974376138c55 100644 --- a/LayoutTests/fast/dom/resources/wrapper-identity-base.js +++ b/LayoutTests/fast/dom/resources/wrapper-identity-base.js @@ -137,7 +137,6 @@ var staticWindowProperties = [ 'onreset', 'onresize', 'onscroll', - 'onsearch', 'onselect', 'onsubmit', 'onunload', diff --git a/LayoutTests/fast/dom/wrapper-identity-expected.txt b/LayoutTests/fast/dom/wrapper-identity-expected.txt index 478e9b7b8141..9a3cdddf8205 100644 --- a/LayoutTests/fast/dom/wrapper-identity-expected.txt +++ b/LayoutTests/fast/dom/wrapper-identity-expected.txt @@ -146,7 +146,6 @@ PASS var object = window['onmousewheel']; isEqualJS(object, object); is true PASS var object = window['onreset']; isEqualJS(object, object); is true PASS var object = window['onresize']; isEqualJS(object, object); is true PASS var object = window['onscroll']; isEqualJS(object, object); is true -PASS var object = window['onsearch']; isEqualJS(object, object); is true PASS var object = window['onselect']; isEqualJS(object, object); is true PASS var object = window['onsubmit']; isEqualJS(object, object); is true PASS var object = window['onunload']; isEqualJS(object, object); is true diff --git a/LayoutTests/fast/events/onsearch-enter-expected.txt b/LayoutTests/fast/events/onsearch-enter-expected.txt deleted file mode 100644 index 641bbbb8f029..000000000000 --- a/LayoutTests/fast/events/onsearch-enter-expected.txt +++ /dev/null @@ -1,4 +0,0 @@ -This tests that onSearch fires correctly. - -Test Passed - diff --git a/LayoutTests/fast/events/onsearch-enter.html b/LayoutTests/fast/events/onsearch-enter.html deleted file mode 100644 index 79c6b51484ce..000000000000 --- a/LayoutTests/fast/events/onsearch-enter.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - This tests that onSearch fires correctly.
- -
- - diff --git a/LayoutTests/fast/forms/incremental-dom-property-expected.txt b/LayoutTests/fast/forms/incremental-dom-property-expected.txt deleted file mode 100644 index 192de3296ffe..000000000000 --- a/LayoutTests/fast/forms/incremental-dom-property-expected.txt +++ /dev/null @@ -1,13 +0,0 @@ -Test for https://bugs.webkit.org/show_bug.cgi?id=50335 - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS input.incremental is true -PASS input.incremental is false -PASS input.hasAttribute("incremental") is true -PASS input.hasAttribute("incremental") is false -PASS successfullyParsed is true - -TEST COMPLETE - diff --git a/LayoutTests/fast/forms/incremental-dom-property.html b/LayoutTests/fast/forms/incremental-dom-property.html deleted file mode 100644 index f03a749d2087..000000000000 --- a/LayoutTests/fast/forms/incremental-dom-property.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - -

-
- - - - diff --git a/LayoutTests/fast/forms/input-search-press-escape-key-expected.txt b/LayoutTests/fast/forms/input-search-press-escape-key-expected.txt deleted file mode 100644 index b498bb62ca8e..000000000000 --- a/LayoutTests/fast/forms/input-search-press-escape-key-expected.txt +++ /dev/null @@ -1,17 +0,0 @@ -PASS input.value is "" -PASS searchEventObserved is true -PASS input.value is "" -PASS searchEventObserved is true -PASS input.value is "foo" -PASS searchEventObserved is false -PASS input.value is "foo" -PASS searchEventObserved is false -PASS input.value is "foo" -PASS searchEventObserved is false -PASS successfullyParsed is true - -TEST COMPLETE - -This tests if the value in a search input form is cleared and a 'search' event is triggered, when we press the Escape key. To run (a part of) this test manually, type some text in the search form and then press the Escape key. If the text is cleared, then the test passes. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". diff --git a/LayoutTests/fast/forms/input-search-press-escape-key.html b/LayoutTests/fast/forms/input-search-press-escape-key.html deleted file mode 100644 index 79b9263cdbca..000000000000 --- a/LayoutTests/fast/forms/input-search-press-escape-key.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - -

- -

- - - - - diff --git a/LayoutTests/fast/forms/search-event-delay-expected.txt b/LayoutTests/fast/forms/search-event-delay-expected.txt deleted file mode 100644 index 6090854146ec..000000000000 --- a/LayoutTests/fast/forms/search-event-delay-expected.txt +++ /dev/null @@ -1,9 +0,0 @@ -This tests the delay between when you type and the search event fires. - -As of this writing we can't use DOM events to type into a search field, so the test uses the event sender and only runs under DumpRenderTree. - - - -The two rows below should match. -0.5 0.4 0.3 0.2 0.2 0 -0.5 0.4 0.3 0.2 0.2 0 diff --git a/LayoutTests/fast/forms/search-event-delay.html b/LayoutTests/fast/forms/search-event-delay.html deleted file mode 100644 index 19dc4d3a55e4..000000000000 --- a/LayoutTests/fast/forms/search-event-delay.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - -

This tests the delay between when you type and the search event fires.

- -

As of this writing we can't use DOM events to type into a search field, so the test uses the event sender and only runs under DumpRenderTree.

- -

- -
The two rows below should match.
-
0.5 0.4 0.3 0.2 0.2 0

-
- - diff --git a/LayoutTests/http/tests/security/cross-frame-access-get-expected.txt b/LayoutTests/http/tests/security/cross-frame-access-get-expected.txt index cf1e83080eee..45676abc2c83 100644 --- a/LayoutTests/http/tests/security/cross-frame-access-get-expected.txt +++ b/LayoutTests/http/tests/security/cross-frame-access-get-expected.txt @@ -186,7 +186,6 @@ CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://127.0.0.1:80 CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. -CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. This test checks cross-frame access security (rdar://problem/5251309). @@ -391,7 +390,6 @@ PASS: canGet('targetWindow.onmousewheel') should be 'false' and is. PASS: canGet('targetWindow.onreset') should be 'false' and is. PASS: canGet('targetWindow.onresize') should be 'false' and is. PASS: canGet('targetWindow.onscroll') should be 'false' and is. -PASS: canGet('targetWindow.onsearch') should be 'false' and is. PASS: canGet('targetWindow.onselect') should be 'false' and is. PASS: canGet('targetWindow.onsubmit') should be 'false' and is. PASS: canGet('targetWindow.onunload') should be 'false' and is. diff --git a/LayoutTests/http/tests/security/cross-frame-access-get.html b/LayoutTests/http/tests/security/cross-frame-access-get.html index c750213000d3..1cdb27a34339 100644 --- a/LayoutTests/http/tests/security/cross-frame-access-get.html +++ b/LayoutTests/http/tests/security/cross-frame-access-get.html @@ -178,7 +178,6 @@ "onreset", "onresize", "onscroll", - "onsearch", "onselect", "onsubmit", "onunload", diff --git a/LayoutTests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor-expected.txt b/LayoutTests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor-expected.txt index 1d5e3b4f2622..494b57fa44bb 100644 --- a/LayoutTests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor-expected.txt +++ b/LayoutTests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor-expected.txt @@ -195,7 +195,6 @@ CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://127.0.0.1:80 CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. -CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. This test checks cross-frame access security of getOwnPropertyDescriptor (https://bugs.webkit.org/show_bug.cgi?id=32119). @@ -374,7 +373,6 @@ PASS: canGetDescriptor(targetWindow, 'onmousewheel') should be 'false' and is. PASS: canGetDescriptor(targetWindow, 'onreset') should be 'false' and is. PASS: canGetDescriptor(targetWindow, 'onresize') should be 'false' and is. PASS: canGetDescriptor(targetWindow, 'onscroll') should be 'false' and is. -PASS: canGetDescriptor(targetWindow, 'onsearch') should be 'false' and is. PASS: canGetDescriptor(targetWindow, 'onselect') should be 'false' and is. PASS: canGetDescriptor(targetWindow, 'onsubmit') should be 'false' and is. PASS: canGetDescriptor(targetWindow, 'onunload') should be 'false' and is. diff --git a/LayoutTests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html b/LayoutTests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html index be8e7aa323c3..2ea68f646a0f 100644 --- a/LayoutTests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html +++ b/LayoutTests/http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html @@ -172,7 +172,6 @@ "onreset", "onresize", "onscroll", - "onsearch", "onselect", "onsubmit", "onunload", diff --git a/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt b/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt index 5f534de62797..f9c991d0628a 100644 --- a/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt +++ b/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt @@ -131,7 +131,6 @@ CONSOLE MESSAGE: PASS: window.onmousewheel should be 'null' and is. CONSOLE MESSAGE: PASS: window.onreset should be 'null' and is. CONSOLE MESSAGE: PASS: window.onresize should be 'null' and is. CONSOLE MESSAGE: PASS: window.onscroll should be 'null' and is. -CONSOLE MESSAGE: PASS: window.onsearch should be 'null' and is. CONSOLE MESSAGE: PASS: window.onselect should be 'null' and is. CONSOLE MESSAGE: PASS: window.onsubmit should be 'null' and is. CONSOLE MESSAGE: PASS: window.onunload should be 'null' and is. @@ -317,7 +316,6 @@ PASS: Unable to set property onmousewheel: SecurityError: Blocked a frame with o PASS: Unable to set property onreset: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. PASS: Unable to set property onresize: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. PASS: Unable to set property onscroll: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. -PASS: Unable to set property onsearch: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. PASS: Unable to set property onselect: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. PASS: Unable to set property onsubmit: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. PASS: Unable to set property onunload: SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match. diff --git a/LayoutTests/http/tests/security/cross-frame-access-put.html b/LayoutTests/http/tests/security/cross-frame-access-put.html index fd6430f38593..c330928ad053 100644 --- a/LayoutTests/http/tests/security/cross-frame-access-put.html +++ b/LayoutTests/http/tests/security/cross-frame-access-put.html @@ -166,7 +166,6 @@ setForbiddenProperty(targetWindow, "onreset"); setForbiddenProperty(targetWindow, "onresize"); setForbiddenProperty(targetWindow, "onscroll"); - setForbiddenProperty(targetWindow, "onsearch"); setForbiddenProperty(targetWindow, "onselect"); setForbiddenProperty(targetWindow, "onsubmit"); setForbiddenProperty(targetWindow, "onunload"); diff --git a/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-put-test.html b/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-put-test.html index 17a7d5338385..31264b682265 100644 --- a/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-put-test.html +++ b/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-put-test.html @@ -181,7 +181,6 @@ var onresetOld = window.onreset; var onresizeOld = window.onresize; var onscrollOld = window.onscroll; - var onsearchOld = window.onsearch; var onselectOld = window.onselect; var onsubmitOld = window.onsubmit; var onunloadOld = window.onunload; @@ -380,7 +379,6 @@ shouldBe("window.onreset", "onresetOld"); shouldBe("window.onresize", "onresizeOld"); shouldBe("window.onscroll", "onscrollOld"); - shouldBe("window.onsearch", "onsearchOld"); shouldBe("window.onselect", "onselectOld"); shouldBe("window.onsubmit", "onsubmitOld"); shouldBe("window.onunload", "onunloadOld"); diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/historical-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/historical-expected.txt index d63c925a8e79..c191c2dac042 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/historical-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/historical-expected.txt @@ -9,9 +9,9 @@ PASS progress.form should not be supported PASS meter.form should not be supported PASS form.item should not be supported PASS form.namedItem should not be supported -FAIL window.onsearch should not be supported assert_false: expected false got true -FAIL document.onsearch should not be supported assert_false: expected false got true -FAIL input.onsearch should not be supported assert_false: expected false got true -FAIL input.incremental should not be supported assert_false: expected false got true +PASS window.onsearch should not be supported +PASS document.onsearch should not be supported +PASS input.onsearch should not be supported +PASS input.incremental should not be supported PASS should not be supported diff --git a/LayoutTests/platform/gtk/fast/dom/Window/window-lookup-precedence-expected.txt b/LayoutTests/platform/gtk/fast/dom/Window/window-lookup-precedence-expected.txt index 387cba383739..c3f9f601ceef 100644 --- a/LayoutTests/platform/gtk/fast/dom/Window/window-lookup-precedence-expected.txt +++ b/LayoutTests/platform/gtk/fast/dom/Window/window-lookup-precedence-expected.txt @@ -373,8 +373,6 @@ PASS win['onresize'] is null PASS win['onresize'] is null PASS win['onscroll'] is null PASS win['onscroll'] is null -PASS win['onsearch'] is null -PASS win['onsearch'] is null PASS win['onselect'] is null PASS win['onselect'] is null PASS win['onsubmit'] is null diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations index 2a343645d9bb..9b5a4f067046 100644 --- a/LayoutTests/platform/ios/TestExpectations +++ b/LayoutTests/platform/ios/TestExpectations @@ -969,7 +969,6 @@ fast/events/onchange-select-popup.html [ Skip ] fast/events/onchange-setvalue.html [ Skip ] fast/events/onchange-text-form-field.html [ Skip ] fast/events/onchange-textfield.html [ Skip ] -fast/events/onsearch-enter.html [ Skip ] fast/events/popup-when-select-change.html [ Skip ] fast/events/recorded-keydown-event.html [ Skip ] fast/events/related-target-focusevent.html [ Skip ] @@ -997,7 +996,6 @@ fast/forms/implicit-submission.html [ Skip ] fast/forms/input-first-letter-edit.html [ Skip ] fast/forms/input-image-submit.html [ Skip ] fast/forms/input-maxlength-inserting-in-middle.html [ Skip ] -fast/forms/input-search-press-escape-key.html [ Skip ] fast/forms/listbox-non-contiguous-keyboard-selection.html [ Skip ] fast/forms/listbox-onchange.html [ Skip ] fast/forms/listbox-typeahead-cyrillic.html [ Skip ] @@ -1013,7 +1011,6 @@ fast/forms/radio/radio-group-keyboard-change-event.html [ Skip ] fast/forms/range/range-keyboard-oninput-event.html [ Skip ] fast/forms/range/range-type-change-onchange.html fast/forms/restore-selection-after-layout.html [ Skip ] -fast/forms/search-event-delay.html [ Skip ] fast/forms/select-accesskey.html [ Skip ] fast/dom/accesskey-focus-element.html [ Skip ] fast/forms/select-cache-desynchronization.html [ Skip ] diff --git a/LayoutTests/platform/mac-wk2/fast/dom/Window/window-lookup-precedence-expected.txt b/LayoutTests/platform/mac-wk2/fast/dom/Window/window-lookup-precedence-expected.txt index 387cba383739..c3f9f601ceef 100644 --- a/LayoutTests/platform/mac-wk2/fast/dom/Window/window-lookup-precedence-expected.txt +++ b/LayoutTests/platform/mac-wk2/fast/dom/Window/window-lookup-precedence-expected.txt @@ -373,8 +373,6 @@ PASS win['onresize'] is null PASS win['onresize'] is null PASS win['onscroll'] is null PASS win['onscroll'] is null -PASS win['onsearch'] is null -PASS win['onsearch'] is null PASS win['onselect'] is null PASS win['onselect'] is null PASS win['onsubmit'] is null diff --git a/LayoutTests/platform/mac/fast/dom/objc-wrapper-identity-expected.txt b/LayoutTests/platform/mac/fast/dom/objc-wrapper-identity-expected.txt index a4dd4d647d21..c58e2b20440a 100644 --- a/LayoutTests/platform/mac/fast/dom/objc-wrapper-identity-expected.txt +++ b/LayoutTests/platform/mac/fast/dom/objc-wrapper-identity-expected.txt @@ -145,7 +145,6 @@ PASS var object = window['onmousewheel']; isEqualObjC(object, object); is true PASS var object = window['onreset']; isEqualObjC(object, object); is true PASS var object = window['onresize']; isEqualObjC(object, object); is true PASS var object = window['onscroll']; isEqualObjC(object, object); is true -PASS var object = window['onsearch']; isEqualObjC(object, object); is true PASS var object = window['onselect']; isEqualObjC(object, object); is true PASS var object = window['onsubmit']; isEqualObjC(object, object); is true PASS var object = window['onunload']; isEqualObjC(object, object); is true diff --git a/LayoutTests/platform/wincairo/TestExpectations b/LayoutTests/platform/wincairo/TestExpectations index f948b155f4f8..5a462cec757d 100644 --- a/LayoutTests/platform/wincairo/TestExpectations +++ b/LayoutTests/platform/wincairo/TestExpectations @@ -1688,7 +1688,6 @@ fast/forms/range/slider-transformed.html [ Skip ] fast/forms/scroll-into-view-and-show-validation-message.html [ Skip ] fast/forms/search-cancel-button-style-sharing.html [ Skip ] fast/forms/search-display-none-cancel-button.html [ Skip ] -fast/forms/search-event-delay.html [ Skip ] fast/forms/search-input-rtl.html [ Skip ] fast/forms/search-rtl.html [ Skip ] fast/forms/search-styled.html [ Skip ] diff --git a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml index 9fdd94e5bf4f..f417ee7bb1b4 100644 --- a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml +++ b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml @@ -5676,6 +5676,20 @@ ScrollingPerformanceTestingEnabled: WebCore: default: false +SearchInputIncrementalAttributeAndSearchEventEnabled: + type: bool + status: embedder + category: html + humanReadableName: "Search control incremental attribute and search event" + humanReadableDescription: "Enable search control incremental attribute and search event support" + defaultValue: + WebKitLegacy: + default: WebKit::defaultSearchInputIncrementalAttributeAndSearchEventEnabled() + WebKit: + default: WebKit::defaultSearchInputIncrementalAttributeAndSearchEventEnabled() + WebCore: + default: false + SecureContextChecksEnabled: type: bool status: internal diff --git a/Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h b/Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h index e5b149f90257..aaade3d4d0dd 100644 --- a/Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h +++ b/Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h @@ -71,6 +71,7 @@ enum class SDKAlignedBehavior { NoLaBanquePostaleQuirks, NoMoviStarPlusCORSPreflightQuirk, NoPokerBrosBuiltInTagQuirk, + NoSearchInputIncrementalAttributeAndSearchEvent, NoShowModalDialog, NoTheSecretSocietyHiddenMysteryWindowOpenQuirk, NoTypedArrayAPIQuirk, diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h index 0c947b34fcdd..f70459a8d2e9 100644 --- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h +++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h @@ -580,6 +580,7 @@ namespace WebCore { macro(onpush) \ macro(onpushsubscriptionchange) \ macro(onrtctransform) \ + macro(onsearch) \ macro(ontouchcancel) \ macro(ontouchend) \ macro(ontouchmove) \ diff --git a/Source/WebCore/dom/GlobalEventHandlers.idl b/Source/WebCore/dom/GlobalEventHandlers.idl index 9041bc403835..ac202e781f69 100644 --- a/Source/WebCore/dom/GlobalEventHandlers.idl +++ b/Source/WebCore/dom/GlobalEventHandlers.idl @@ -105,7 +105,7 @@ interface mixin GlobalEventHandlers { // Non-standard additions. attribute EventHandler onmousewheel; - [NotEnumerable] attribute EventHandler onsearch; + [NotEnumerable, EnabledBySetting=SearchInputIncrementalAttributeAndSearchEventEnabled] attribute EventHandler onsearch; [NotEnumerable, Conditional=TOUCH_EVENTS, EnabledBySetting=TouchEventsEnabled] attribute EventHandler ontouchcancel; [NotEnumerable, Conditional=TOUCH_EVENTS, EnabledBySetting=TouchEventsEnabled] attribute EventHandler ontouchend; [NotEnumerable, Conditional=TOUCH_EVENTS, EnabledBySetting=TouchEventsEnabled] attribute EventHandler ontouchmove; diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp index 6ff289390947..95d2f3966c5f 100644 --- a/Source/WebCore/html/HTMLInputElement.cpp +++ b/Source/WebCore/html/HTMLInputElement.cpp @@ -1270,7 +1270,8 @@ void HTMLInputElement::defaultEventHandler(Event& event) if (m_inputType->shouldSubmitImplicitly(event)) { if (isSearchField()) { addSearchResult(); - onSearch(); + if (document().settings().searchInputIncrementalAttributeAndSearchEventEnabled()) + onSearch(); } // Form submission finishes editing, just as loss of focus does. // If there was a change, send the event now. diff --git a/Source/WebCore/html/HTMLInputElement.idl b/Source/WebCore/html/HTMLInputElement.idl index ce0c758a32d4..bb8105712ce2 100644 --- a/Source/WebCore/html/HTMLInputElement.idl +++ b/Source/WebCore/html/HTMLInputElement.idl @@ -90,7 +90,7 @@ [CEReactions=NotNeeded, Reflect] attribute DOMString align; [CEReactions=NotNeeded, Reflect] attribute DOMString useMap; - [CEReactions=NotNeeded, Reflect] attribute boolean incremental; + [EnabledBySetting=SearchInputIncrementalAttributeAndSearchEventEnabled, CEReactions=NotNeeded, Reflect] attribute boolean incremental; // See http://www.w3.org/TR/html-media-capture/ [CEReactions=NotNeeded, Conditional=MEDIA_CAPTURE, Reflect] attribute DOMString capture; diff --git a/Source/WebCore/html/SearchInputType.cpp b/Source/WebCore/html/SearchInputType.cpp index f91c87220d94..b8901d129d51 100644 --- a/Source/WebCore/html/SearchInputType.cpp +++ b/Source/WebCore/html/SearchInputType.cpp @@ -147,7 +147,8 @@ auto SearchInputType::handleKeydownEvent(KeyboardEvent& event) -> ShouldCallBase if (key == "U+001B"_s) { Ref protectedInputElement(*element()); protectedInputElement->setValue(emptyString(), DispatchChangeEvent); - protectedInputElement->onSearch(); + if (protectedInputElement->document().settings().searchInputIncrementalAttributeAndSearchEventEnabled()) + protectedInputElement->onSearch(); event.setDefaultHandled(); return ShouldCallBaseEventHandler::Yes; } @@ -191,7 +192,8 @@ void SearchInputType::searchEventTimerFired() bool SearchInputType::searchEventsShouldBeDispatched() const { ASSERT(element()); - return element()->hasAttributeWithoutSynchronization(incrementalAttr); + return element()->document().settings().searchInputIncrementalAttributeAndSearchEventEnabled() + && element()->hasAttributeWithoutSynchronization(incrementalAttr); } void SearchInputType::didSetValueByUserEdit() diff --git a/Source/WebCore/html/shadow/TextControlInnerElements.cpp b/Source/WebCore/html/shadow/TextControlInnerElements.cpp index 5d3a7f51023e..5075a15f4e20 100644 --- a/Source/WebCore/html/shadow/TextControlInnerElements.cpp +++ b/Source/WebCore/html/shadow/TextControlInnerElements.cpp @@ -349,7 +349,8 @@ void SearchFieldCancelButtonElement::defaultEventHandler(Event& event) if (event.type() == eventNames().clickEvent) { input->setValue(emptyString(), DispatchChangeEvent); - input->onSearch(); + if (input->document().settings().searchInputIncrementalAttributeAndSearchEventEnabled()) + input->onSearch(); event.setDefaultHandled(); } diff --git a/Source/WebCore/rendering/RenderSearchField.cpp b/Source/WebCore/rendering/RenderSearchField.cpp index 1bc8ec47b85b..35a4cc85d08b 100644 --- a/Source/WebCore/rendering/RenderSearchField.cpp +++ b/Source/WebCore/rendering/RenderSearchField.cpp @@ -235,7 +235,8 @@ void RenderSearchField::valueChanged(unsigned listIndex, bool fireEvents) } } else { inputElement().setValue(itemText(listIndex)); - if (fireEvents) + if (inputElement().document().settings().searchInputIncrementalAttributeAndSearchEventEnabled() + && fireEvents) inputElement().onSearch(); inputElement().select(); } diff --git a/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp b/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp index a8df75016375..adee5748e53c 100644 --- a/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp +++ b/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp @@ -314,4 +314,14 @@ bool defaultUseGPUProcessForDOMRenderingEnabled() return false; } +bool defaultSearchInputIncrementalAttributeAndSearchEventEnabled() +{ +#if PLATFORM(COCOA) + static bool newSDK = linkedOnOrAfterSDKWithBehavior(SDKAlignedBehavior::NoSearchInputIncrementalAttributeAndSearchEvent); + return !newSDK; +#else + return false; +#endif +} + } // namespace WebKit diff --git a/Source/WebKit/Shared/WebPreferencesDefaultValues.h b/Source/WebKit/Shared/WebPreferencesDefaultValues.h index ba23f5fa9a71..92a6c0753ce7 100644 --- a/Source/WebKit/Shared/WebPreferencesDefaultValues.h +++ b/Source/WebKit/Shared/WebPreferencesDefaultValues.h @@ -105,6 +105,7 @@ bool defaultLiveRangeSelectionEnabled(); bool defaultShouldEnableScreenOrientationAPI(); bool defaultPopoverAttributeEnabled(); bool defaultUseGPUProcessForDOMRenderingEnabled(); +bool defaultSearchInputIncrementalAttributeAndSearchEventEnabled(); #if HAVE(SC_CONTENT_SHARING_PICKER) bool defaultUseSCContentSharingPicker(); diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h b/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h index 211b18570add..fe6e97aef228 100644 --- a/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h +++ b/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h @@ -67,6 +67,7 @@ bool defaultAllowDisplayOfInsecureContent(); bool defaultAllowRunningOfInsecureContent(); bool defaultShouldConvertInvalidURLsToBlank(); bool defaultPopoverAttributeEnabled(); +bool defaultSearchInputIncrementalAttributeAndSearchEventEnabled(); #if PLATFORM(MAC) bool defaultPassiveWheelListenersAsDefaultOnDocument(); diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm b/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm index f6b257aaac24..874c8d8006d2 100644 --- a/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm +++ b/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm @@ -213,6 +213,12 @@ bool defaultPopoverAttributeEnabled() return newSDK; } +bool defaultSearchInputIncrementalAttributeAndSearchEventEnabled() +{ + static bool newSDK = linkedOnOrAfterSDKWithBehavior(SDKAlignedBehavior::NoSearchInputIncrementalAttributeAndSearchEvent); + return !newSDK; +} + #if PLATFORM(MAC) bool defaultPassiveWheelListenersAsDefaultOnDocument()