Skip to content

Allow autocomplete URL tokens on input type=url - #327

Open
cpruijsen wants to merge 1 commit into
squizlabs:masterfrom
cpruijsen:fix/issue-325
Open

Allow autocomplete URL tokens on input type=url#327
cpruijsen wants to merge 1 commit into
squizlabs:masterfrom
cpruijsen:fix/issue-325

Conversation

@cpruijsen

Copy link
Copy Markdown

isUrl now accepts type="url", so WCAG 1.3.5 (H98) no longer reports autocomplete="url" (and photo / impp) as an error. input type="url" was outside the URL autocomplete control group.

Fixes #325. Confirmed against the WordPress comment-form website field in https://core.trac.wordpress.org/ticket/64307 (<input type="url" autocomplete="url">).

Summary

isUrl matches the other specialised groups (tel, number, date) and the HTML autocomplete control-group table. Spec: URL group is hidden / text / search / url / textarea / select (HTML 5.2 and WHATWG).

The patch adds url to isUrl and leaves the existing email clause in place. Replacing email with url would match the spec exactly (email is the Username group, which this sniff does not implement), but would newly flag type="email" plus URL tokens. That is a separate spec-accuracy change. Can drop email if you prefer spec-strict grouping.

Test plan

  • Tests/WCAG2/1_3_5_Autocomplete_Url.html: no Error *.H98 on type=url + autocomplete=url / photo; still no error on type=text; still Error on type=number
  • Same fixture fails those two type=url assertions when the isUrl line is reverted
  • npm test (grunt eslint)
  • PhantomJS Contrib/Testing/HTMLCS_Test.js Tests/WCAG2/1_3_5_Autocomplete_Url.html if you have PhantomJS
  • Bookmarklet / auditor on a page with <input type="url" autocomplete="url"> (WordPress comment form)

isUrl treated type=url as outside the URL control group, so valid
markup such as autocomplete="url" was reported as H98.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing url input type in isUrl

1 participant