haikuwebkit/LayoutTests/accessibility/ios-simulator/form-control-validation-mes...

36 lines
946 B
HTML
Raw Permalink Normal View History

HTML form validation bubble disappears https://bugs.webkit.org/show_bug.cgi?id=191418 Reviewed by Simon Fraser. Source/WebCore: If we validate a form and find an invalid form control, we'll scroll it into view and show the validation bubble. However, scrolling the element into view may be an asynchronous operation, in which case it would discard the validation bubble prematurely because scrolling hides the validation bubble. To address the issue, we now show the validation message asynchronously after focusing the element (and potentially scrolling it into view). Test: fast/forms/scroll-into-view-and-show-validation-message.html * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::focusAndShowValidationMessage): LayoutTests: Add API test coverage and update existing tests to use form-validation.js and avoid code duplication. * fast/forms/form-validation.js: Added. (getValidationBubbleContents): (getValidationBubble.return.new.Promise.): (getValidationBubble): * fast/forms/ios/validation-bubble-dismiss-on-tap-expected.txt: * fast/forms/ios/validation-bubble-dismiss-on-tap.html: * fast/forms/navigation-dismisses-validation-bubbles-expected.txt: Renamed from LayoutTests/http/tests/navigation/navigation-dismisses-validation-bubbles-expected.txt. * fast/forms/navigation-dismisses-validation-bubbles.html: Renamed from LayoutTests/http/tests/navigation/navigation-dismisses-validation-bubbles.html. * fast/forms/resources/check-validation-bubble-not-visible.html: Renamed from LayoutTests/http/tests/navigation/resources/check-validation-bubble-not-visible.html. * fast/forms/scroll-into-view-and-show-validation-message-expected.txt: Added. * fast/forms/scroll-into-view-and-show-validation-message.html: Added. * fast/forms/validation-bubble-disappears-when-input-detached-expected.txt: * fast/forms/validation-bubble-disappears-when-input-detached.html: * fast/forms/validation-bubble-disappears-when-input-moved-expected.txt: * fast/forms/validation-bubble-disappears-when-input-moved.html: * fast/forms/validation-bubble-disappears-when-input-no-longer-visible-expected.txt: * fast/forms/validation-bubble-disappears-when-input-no-longer-visible.html: * fast/forms/validation-bubble-escape-key-dismiss-expected.txt: * fast/forms/validation-bubble-escape-key-dismiss.html: * fast/forms/validation-custom-message-expected.txt: * fast/forms/validation-custom-message.html: * fast/forms/validation-message-detached-iframe-expected.txt: * fast/forms/validation-message-detached-iframe.html: * fast/forms/validation-message-detached-iframe2-expected.txt: * fast/forms/validation-message-detached-iframe2.html: * fast/forms/validation-message-minimum-font-size-expected.txt: * fast/forms/validation-message-minimum-font-size.html: * fast/forms/validation-messages-expected.txt: * fast/forms/validation-messages.html: * platform/gtk/TestExpectations: * platform/ios-wk1/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/206252@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-09 17:37:52 +00:00
<!DOCTYPE html>
<html>
<head>
<script>
</script>
HTML form validation bubble disappears https://bugs.webkit.org/show_bug.cgi?id=191418 Reviewed by Simon Fraser. Source/WebCore: If we validate a form and find an invalid form control, we'll scroll it into view and show the validation bubble. However, scrolling the element into view may be an asynchronous operation, in which case it would discard the validation bubble prematurely because scrolling hides the validation bubble. To address the issue, we now show the validation message asynchronously after focusing the element (and potentially scrolling it into view). Test: fast/forms/scroll-into-view-and-show-validation-message.html * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::focusAndShowValidationMessage): LayoutTests: Add API test coverage and update existing tests to use form-validation.js and avoid code duplication. * fast/forms/form-validation.js: Added. (getValidationBubbleContents): (getValidationBubble.return.new.Promise.): (getValidationBubble): * fast/forms/ios/validation-bubble-dismiss-on-tap-expected.txt: * fast/forms/ios/validation-bubble-dismiss-on-tap.html: * fast/forms/navigation-dismisses-validation-bubbles-expected.txt: Renamed from LayoutTests/http/tests/navigation/navigation-dismisses-validation-bubbles-expected.txt. * fast/forms/navigation-dismisses-validation-bubbles.html: Renamed from LayoutTests/http/tests/navigation/navigation-dismisses-validation-bubbles.html. * fast/forms/resources/check-validation-bubble-not-visible.html: Renamed from LayoutTests/http/tests/navigation/resources/check-validation-bubble-not-visible.html. * fast/forms/scroll-into-view-and-show-validation-message-expected.txt: Added. * fast/forms/scroll-into-view-and-show-validation-message.html: Added. * fast/forms/validation-bubble-disappears-when-input-detached-expected.txt: * fast/forms/validation-bubble-disappears-when-input-detached.html: * fast/forms/validation-bubble-disappears-when-input-moved-expected.txt: * fast/forms/validation-bubble-disappears-when-input-moved.html: * fast/forms/validation-bubble-disappears-when-input-no-longer-visible-expected.txt: * fast/forms/validation-bubble-disappears-when-input-no-longer-visible.html: * fast/forms/validation-bubble-escape-key-dismiss-expected.txt: * fast/forms/validation-bubble-escape-key-dismiss.html: * fast/forms/validation-custom-message-expected.txt: * fast/forms/validation-custom-message.html: * fast/forms/validation-message-detached-iframe-expected.txt: * fast/forms/validation-message-detached-iframe.html: * fast/forms/validation-message-detached-iframe2-expected.txt: * fast/forms/validation-message-detached-iframe2.html: * fast/forms/validation-message-minimum-font-size-expected.txt: * fast/forms/validation-message-minimum-font-size.html: * fast/forms/validation-messages-expected.txt: * fast/forms/validation-messages.html: * platform/gtk/TestExpectations: * platform/ios-wk1/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/206252@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-09 17:37:52 +00:00
<script src="../../resources/js-test.js"></script>
</head>
<body id="body">
<form>
Required text input: <input id="input" type="text" required=""><input id="submit" type="submit" id="firstSubmitButton">
</form>
<script>
description("This tests that we are exposing form validation message through hint on iOS.");
HTML form validation bubble disappears https://bugs.webkit.org/show_bug.cgi?id=191418 Reviewed by Simon Fraser. Source/WebCore: If we validate a form and find an invalid form control, we'll scroll it into view and show the validation bubble. However, scrolling the element into view may be an asynchronous operation, in which case it would discard the validation bubble prematurely because scrolling hides the validation bubble. To address the issue, we now show the validation message asynchronously after focusing the element (and potentially scrolling it into view). Test: fast/forms/scroll-into-view-and-show-validation-message.html * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::focusAndShowValidationMessage): LayoutTests: Add API test coverage and update existing tests to use form-validation.js and avoid code duplication. * fast/forms/form-validation.js: Added. (getValidationBubbleContents): (getValidationBubble.return.new.Promise.): (getValidationBubble): * fast/forms/ios/validation-bubble-dismiss-on-tap-expected.txt: * fast/forms/ios/validation-bubble-dismiss-on-tap.html: * fast/forms/navigation-dismisses-validation-bubbles-expected.txt: Renamed from LayoutTests/http/tests/navigation/navigation-dismisses-validation-bubbles-expected.txt. * fast/forms/navigation-dismisses-validation-bubbles.html: Renamed from LayoutTests/http/tests/navigation/navigation-dismisses-validation-bubbles.html. * fast/forms/resources/check-validation-bubble-not-visible.html: Renamed from LayoutTests/http/tests/navigation/resources/check-validation-bubble-not-visible.html. * fast/forms/scroll-into-view-and-show-validation-message-expected.txt: Added. * fast/forms/scroll-into-view-and-show-validation-message.html: Added. * fast/forms/validation-bubble-disappears-when-input-detached-expected.txt: * fast/forms/validation-bubble-disappears-when-input-detached.html: * fast/forms/validation-bubble-disappears-when-input-moved-expected.txt: * fast/forms/validation-bubble-disappears-when-input-moved.html: * fast/forms/validation-bubble-disappears-when-input-no-longer-visible-expected.txt: * fast/forms/validation-bubble-disappears-when-input-no-longer-visible.html: * fast/forms/validation-bubble-escape-key-dismiss-expected.txt: * fast/forms/validation-bubble-escape-key-dismiss.html: * fast/forms/validation-custom-message-expected.txt: * fast/forms/validation-custom-message.html: * fast/forms/validation-message-detached-iframe-expected.txt: * fast/forms/validation-message-detached-iframe.html: * fast/forms/validation-message-detached-iframe2-expected.txt: * fast/forms/validation-message-detached-iframe2.html: * fast/forms/validation-message-minimum-font-size-expected.txt: * fast/forms/validation-message-minimum-font-size.html: * fast/forms/validation-messages-expected.txt: * fast/forms/validation-messages.html: * platform/gtk/TestExpectations: * platform/ios-wk1/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/206252@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-09 17:37:52 +00:00
jsTestIsAsync = true;
if (window.accessibilityController) {
var input = accessibilityController.accessibleElementById("input");
HTML form validation bubble disappears https://bugs.webkit.org/show_bug.cgi?id=191418 Reviewed by Simon Fraser. Source/WebCore: If we validate a form and find an invalid form control, we'll scroll it into view and show the validation bubble. However, scrolling the element into view may be an asynchronous operation, in which case it would discard the validation bubble prematurely because scrolling hides the validation bubble. To address the issue, we now show the validation message asynchronously after focusing the element (and potentially scrolling it into view). Test: fast/forms/scroll-into-view-and-show-validation-message.html * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::focusAndShowValidationMessage): LayoutTests: Add API test coverage and update existing tests to use form-validation.js and avoid code duplication. * fast/forms/form-validation.js: Added. (getValidationBubbleContents): (getValidationBubble.return.new.Promise.): (getValidationBubble): * fast/forms/ios/validation-bubble-dismiss-on-tap-expected.txt: * fast/forms/ios/validation-bubble-dismiss-on-tap.html: * fast/forms/navigation-dismisses-validation-bubbles-expected.txt: Renamed from LayoutTests/http/tests/navigation/navigation-dismisses-validation-bubbles-expected.txt. * fast/forms/navigation-dismisses-validation-bubbles.html: Renamed from LayoutTests/http/tests/navigation/navigation-dismisses-validation-bubbles.html. * fast/forms/resources/check-validation-bubble-not-visible.html: Renamed from LayoutTests/http/tests/navigation/resources/check-validation-bubble-not-visible.html. * fast/forms/scroll-into-view-and-show-validation-message-expected.txt: Added. * fast/forms/scroll-into-view-and-show-validation-message.html: Added. * fast/forms/validation-bubble-disappears-when-input-detached-expected.txt: * fast/forms/validation-bubble-disappears-when-input-detached.html: * fast/forms/validation-bubble-disappears-when-input-moved-expected.txt: * fast/forms/validation-bubble-disappears-when-input-moved.html: * fast/forms/validation-bubble-disappears-when-input-no-longer-visible-expected.txt: * fast/forms/validation-bubble-disappears-when-input-no-longer-visible.html: * fast/forms/validation-bubble-escape-key-dismiss-expected.txt: * fast/forms/validation-bubble-escape-key-dismiss.html: * fast/forms/validation-custom-message-expected.txt: * fast/forms/validation-custom-message.html: * fast/forms/validation-message-detached-iframe-expected.txt: * fast/forms/validation-message-detached-iframe.html: * fast/forms/validation-message-detached-iframe2-expected.txt: * fast/forms/validation-message-detached-iframe2.html: * fast/forms/validation-message-minimum-font-size-expected.txt: * fast/forms/validation-message-minimum-font-size.html: * fast/forms/validation-messages-expected.txt: * fast/forms/validation-messages.html: * platform/gtk/TestExpectations: * platform/ios-wk1/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/206252@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-09 17:37:52 +00:00
shouldBeEqualToString("input.helpText", "AXHint: ");
document.getElementById("submit").click();
handle = setInterval(function() {
if (input.helpText === "AXHint: ")
return;
clearInterval(handle);
HTML form validation bubble disappears https://bugs.webkit.org/show_bug.cgi?id=191418 Reviewed by Simon Fraser. Source/WebCore: If we validate a form and find an invalid form control, we'll scroll it into view and show the validation bubble. However, scrolling the element into view may be an asynchronous operation, in which case it would discard the validation bubble prematurely because scrolling hides the validation bubble. To address the issue, we now show the validation message asynchronously after focusing the element (and potentially scrolling it into view). Test: fast/forms/scroll-into-view-and-show-validation-message.html * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::focusAndShowValidationMessage): LayoutTests: Add API test coverage and update existing tests to use form-validation.js and avoid code duplication. * fast/forms/form-validation.js: Added. (getValidationBubbleContents): (getValidationBubble.return.new.Promise.): (getValidationBubble): * fast/forms/ios/validation-bubble-dismiss-on-tap-expected.txt: * fast/forms/ios/validation-bubble-dismiss-on-tap.html: * fast/forms/navigation-dismisses-validation-bubbles-expected.txt: Renamed from LayoutTests/http/tests/navigation/navigation-dismisses-validation-bubbles-expected.txt. * fast/forms/navigation-dismisses-validation-bubbles.html: Renamed from LayoutTests/http/tests/navigation/navigation-dismisses-validation-bubbles.html. * fast/forms/resources/check-validation-bubble-not-visible.html: Renamed from LayoutTests/http/tests/navigation/resources/check-validation-bubble-not-visible.html. * fast/forms/scroll-into-view-and-show-validation-message-expected.txt: Added. * fast/forms/scroll-into-view-and-show-validation-message.html: Added. * fast/forms/validation-bubble-disappears-when-input-detached-expected.txt: * fast/forms/validation-bubble-disappears-when-input-detached.html: * fast/forms/validation-bubble-disappears-when-input-moved-expected.txt: * fast/forms/validation-bubble-disappears-when-input-moved.html: * fast/forms/validation-bubble-disappears-when-input-no-longer-visible-expected.txt: * fast/forms/validation-bubble-disappears-when-input-no-longer-visible.html: * fast/forms/validation-bubble-escape-key-dismiss-expected.txt: * fast/forms/validation-bubble-escape-key-dismiss.html: * fast/forms/validation-custom-message-expected.txt: * fast/forms/validation-custom-message.html: * fast/forms/validation-message-detached-iframe-expected.txt: * fast/forms/validation-message-detached-iframe.html: * fast/forms/validation-message-detached-iframe2-expected.txt: * fast/forms/validation-message-detached-iframe2.html: * fast/forms/validation-message-minimum-font-size-expected.txt: * fast/forms/validation-message-minimum-font-size.html: * fast/forms/validation-messages-expected.txt: * fast/forms/validation-messages.html: * platform/gtk/TestExpectations: * platform/ios-wk1/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/206252@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-09 17:37:52 +00:00
shouldBeEqualToString("input.helpText", "AXHint: Fill out this field");
finishJSTest();
}, 10);
}
</script>
</body>
</html>