r67283 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67282‎ | r67283 | r67284 >
Date:17:18, 3 June 2010
Author:simetrical
Status:ok
Tags:
Comment:
(bug 23769) Disable HTML5 form validation for now

Is implemented in recent WebKit but with no UI, so it's worse than just
giving a server-side error. The only other implementation right now is
Opera and its UI is pretty ugly, so not yet worth the effort to do UA
sniffing. Will backport to 1.16, as a regression fix.
Modified paths:
  • /trunk/phase3/HISTORY (modified) (history)
  • /trunk/phase3/includes/Html.php (modified) (history)

Diff [purge]

Index: trunk/phase3/HISTORY
@@ -192,10 +192,7 @@
193193 * The default output format is now HTML 5 instead of XHTML 1.0 Transitional.
194194 This can be disabled by setting $wgHtml5 = false;. Specific features enabled
195195 if HTML 5 is used:
196 -** New HTML 5 input attributes allow JavaScript-free input validation in some
197 - cutting-edge browsers. E.g., some inputs will be autofocused, users will
198 - not be allowed to submit forms with certain types of invalid values (like
199 - numbers outside the permitted ranges), etc.
 196+** Some extra inputs will be autofocused, in supporting browsers.
200197 ** The summary attribute has been removed from tables of contents. summary is
201198 obsolete in HTML 5 and wasn't useful here anyway.
202199 ** Unnecessary type="" attribute removed for CSS and JS.
Index: trunk/phase3/includes/Html.php
@@ -370,6 +370,16 @@
371371 # and we'd like consistency and better compression anyway.
372372 $key = strtolower( $key );
373373
 374+ # Bug 23769: Blacklist all form validation attributes for now. Current
 375+ # (June 2010) WebKit has no UI, so the form just refuses to submit
 376+ # without telling the user why, which is much worse than failing
 377+ # server-side validation. Opera is the only other implementation at
 378+ # this time, and has ugly UI, so just kill the feature entirely until
 379+ # we have at least one good implementation.
 380+ if ( in_array( $key, array( 'max', 'min', 'pattern', 'required', 'step' ) ) ) {
 381+ continue;
 382+ }
 383+
374384 # See the "Attributes" section in the HTML syntax part of HTML5,
375385 # 9.1.2.3 as of 2009-08-10. Most attributes can have quotation
376386 # marks omitted, but not all. (Although a literal " is not

Follow-up revisions

RevisionCommit summaryAuthorDate
r67284Backport r67283: (bug 23769) Disable HTML5 form validation for now...simetrical17:22, 3 June 2010
r67285Password not always required on account creation...simetrical17:31, 3 June 2010
r67975MFT r67283, r67869 (bug 23769): disable HTML 5 form validation attributeststarling02:01, 14 June 2010
r68797Disable form validation more thoroughly...simetrical22:14, 30 June 2010
r68799Backport r68797 "Disable form validation more thoroughly"...simetrical22:29, 30 June 2010
r100422Add required attribute to captcha answers per...platonides14:59, 21 October 2011

Status & tagging log