forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notify user of HTML validation error messages
Make HTML native validation of form controls accessible A simple example is @required on a form control. Blink provides a helpful message box if the user attempts to submit a form with a required field left empty. The control is also focused. This CL produces an accessible alert for the notification when it appears. Bug: 897039 Change-Id: Ib78ce09821d794c8b35ca151c1f6a153adff9414 Reviewed-on: https://chromium-review.googlesource.com/c/1403980 Reviewed-by: Kent Tamura <tkent@chromium.org> Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org> Commit-Queue: Aaron Leventhal <aleventhal@chromium.org> Cr-Commit-Position: refs/heads/master@{#625551}
- Loading branch information
1 parent
3344a6d
commit 50f6ce8
Showing
26 changed files
with
445 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
content/test/data/accessibility/aria/aria-alert-expected-mac.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
AXWebArea | ||
++AXGroup AXRoleDescription='alert' AXARIAAtomic='1' | ||
++AXGroup AXSubrole=AXApplicationAlert AXRoleDescription='alert' AXARIAAtomic='1' | ||
++++AXStaticText AXValue='This test is for aria role="alert"' AXARIAAtomic='0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
content/test/data/accessibility/event/report-validity-invalid-field-expected-mac.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
AXFocusedUIElementChanged on AXTextField AXTitle="Pet name:" | ||
AXLiveRegionChanged on AXGroup AXDescription="Please enter pet name" | ||
AXLiveRegionCreated on AXGroup AXDescription="Please enter pet name" |
2 changes: 2 additions & 0 deletions
2
content/test/data/accessibility/event/report-validity-invalid-field-expected-win.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
EVENT_OBJECT_FOCUS on <input#in1> role=ROLE_SYSTEM_TEXT name="Pet name:" FOCUSED,FOCUSABLE IA2_STATE_EDITABLE,IA2_STATE_INVALID_ENTRY,IA2_STATE_REQUIRED,IA2_STATE_SELECTABLE_TEXT,IA2_STATE_SINGLE_LINE | ||
EVENT_SYSTEM_ALERT on role=ROLE_SYSTEM_ALERT name="Please enter pet name" |
21 changes: 21 additions & 0 deletions
21
content/test/data/accessibility/event/report-validity-invalid-field.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- | ||
@WIN-DENY:* | ||
@WIN-ALLOW:EVENT_OBJECT_FOCUS* | ||
@WIN-ALLOW:EVENT_SYSTEM_ALERT* | ||
@WIN-ALLOW:EVENT_OBJECT_LIVE* | ||
@MAC-DENY:* | ||
@MAC-ALLOW:AXFocusedUIElementChanged* | ||
@MAC-ALLOW:AXFocusedUIElementChanged* | ||
@MAC-ALLOW:AXLiveRegion* | ||
--> | ||
<!DOCTYPE html> | ||
<form> | ||
<label for="in1">Pet name:</label><input id="in1" required> | ||
</form> | ||
<script> | ||
function go() { | ||
const in1 = document.querySelector('input'); | ||
in1.setCustomValidity('Please enter pet name'); | ||
in1.reportValidity(); | ||
} | ||
</script> |
8 changes: 8 additions & 0 deletions
8
content/test/data/accessibility/html/form-validation-message-expected-blink.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
rootWebArea | ||
++form | ||
++++labelText | ||
++++++staticText name='Pet name:' | ||
++++++++inlineTextBox name='Pet name:' | ||
++++textField required name='Pet name:' errormessageId=alert invalidState=true | ||
++++++genericContainer | ||
++alert containerLiveRelevant='additions' containerLiveStatus='assertive' name='Please enter pet name' liveRelevant='additions' liveStatus='assertive' containerLiveAtomic=true containerLiveBusy=false liveAtomic=true |
6 changes: 6 additions & 0 deletions
6
content/test/data/accessibility/html/form-validation-message-expected-mac.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
AXWebArea | ||
++AXGroup | ||
++++AXGroup | ||
++++++AXStaticText AXValue='Pet name:' | ||
++++AXTextField AXTitle='Pet name:' | ||
++AXGroup AXSubrole=AXApplicationAlert AXDescription='Please enter pet name' |
6 changes: 6 additions & 0 deletions
6
content/test/data/accessibility/html/form-validation-message-expected-win.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE | ||
++IA2_ROLE_FORM | ||
++++IA2_ROLE_LABEL | ||
++++++ROLE_SYSTEM_STATICTEXT name='Pet name:' | ||
++++ROLE_SYSTEM_TEXT name='Pet name:' FOCUSABLE IA2_STATE_INVALID_ENTRY IA2_STATE_REQUIRED | ||
++ROLE_SYSTEM_ALERT name='Please enter pet name' |
14 changes: 14 additions & 0 deletions
14
content/test/data/accessibility/html/form-validation-message.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- | ||
@BLINK-ALLOW:live* | ||
@BLINK-ALLOW:container* | ||
@MAC-ALLOW:AXSubrole=AXApplicationAlert | ||
--> | ||
<!DOCTYPE html> | ||
<form> | ||
<label for="in1">Pet name:</label><input id="in1" required> | ||
</form> | ||
<script> | ||
const in1 = document.querySelector('input'); | ||
in1.setCustomValidity('Please enter pet name'); | ||
in1.reportValidity(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.